Compile

Compile


OpenCV:src is not a numerical tuple


Try:


_,h = cv2.threshold(h, 245, 1, cv2.THRESH_BINARY) #245-255 x>245 y=1
_,s = cv2.threshold(h, 15, 1, cv2.THRESH_BINARY_INV) #1-15,x>15 y=0
cv2.threshold returns two values:










 1.为什么会出现这种错误?


 2.出现这种错误的解决方法?


 3.哪种方法最好,为什么?


 4.联想自己遇到过的类似问题,比较、思考、总结。


相信你这样子会走得更远。




g++ test.cpp -o out `pkg-config --cflags --libs opencv`   (note: ` is character on upper left of keyboard)
添加环境变量






g++ -I /usr/local/include -L /usr/local/lib test.cpp -o out -lopencv_world (note: library file name: libopencv_world.so)








32/64 位系统编译在32位系统上运行 => x86
32 系统上编译64位系统上运行 => x86_amd64
64 系统上编译在64位系统上运行 => amd64
(http://blog.csdn.net/wl2002200/article/details/52984241)


CC stands for "C compiler" (in GCC abbreviation it is also treated as "compiler collection").
LD is a linker (comes from "link editor" or from "loader").
These are also commonly used in makefiles (see Implicit variables chapter of GNU Make manual):


CPP stands for "C preprocessor"
CXX is a C++ compiler
AS is an assembly language compiler
AR is an archive-maintaining program




openCV cross compile


1. 3rd library cross compile: add build option for them
AFAICT the ctype_base class isn't provided by uClibc.


vi CMakeCache.txt
将所有“CMAKE_EXE_LINKER_FLAGS:STRING=”加上选项 
修改后:  CMAKE_EXE_LINKER_FLAGS:STRING=-lpthread -lrt -ldl
-ldl选项for: 
lib/libopencv_core.so: undefined reference to `dlopen'
lib/libopencv_core.so: undefined reference to `dlsym'


to be check: -DWITH_LAPACK=OFF






Sample 的make命令执行如下:
g++ -Wall -g -fPIC -std=gnu++11 -DLINUX -I/usr/local/include/gti -I/usr/local/GTISDK/Lib/Linux/OpenCV -c Sample.cpp  -o Sample.o


g++ -Wall -g -fPIC -std=gnu++11 -DLINUX -I/usr/local/include/gti -I/usr/local/GTISDK/Lib/Linux/OpenCV -c Samples.cpp  -o Samples.o


g++ -Wall -g -fPIC -std=gnu++11 -DLINUX -I/usr/local/include/gti -I/usr/local/GTISDK/Lib/Linux/OpenCV -c Classify.cpp  -o Classify.o


g++ -Wall -g -fPIC -std=gnu++11 -DLINUX -L/usr/local/Lib -o cnnSample Sample.o Samples.o Classify.o -lopencv_world -lGTILibrary-static -lftd3xx -lpthread -lX11








bulid INSTALL工程时,发生如下错误:
error MSB3073: The command "setlocal
E:\cmake3.0.0\CMake\bin\cmake.exe -DBUILD_TYPE=Debug -P cmake_install.cmake
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
:VCEnd" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets 132 5 INSTALL


查看输出信息发现是由于VS2013没有权限:


解决方法:以管理员身份运行VS2013






a value of type “const char *” cannot be assigned to an entity of type “char” C OOP
C++ has two types of constants consisting of characters - string literals and character literals.
String literals are enclosed in double quotes, and have type of const char *
Character literals are enclosed in single quotes, and have type char.


 argument of type "char *" is incompatible with parameter of type "LPCWSTR"
Set Project -> Properties -> General -> Character Set option to Use Multi-Byte Character Set

猜你喜欢

转载自blog.csdn.net/honk2012/article/details/80689037