平台:嵌视科技arm板
-
/opt/gcc/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/tq-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/include/c++/4.6.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options. 解决方案:在build_arm.sh文件中只生成到Makefile文件就结束,在makefile文件中 加入 LINK = arm-none-linux-gnueabi-g++ -lts -std=c++0x
CXX = arm-none-linux-gnueabi-g++ -lts -std=c++0x 接着在终端输入make -
要用到IplImage与Mat之间的转换,如下:https://mp.youkuaiyun.com/postedit/81432133
-
error: 'createBackgroundSubtractorMOG2' was not declared in this scope 解决方案:(原因是opencv版本不同,3和2之间的函数调用有差别,也添加了#include <opencv/cvaux.h>) 原代码是:Ptr<BackgroundSubtractorMOG2> mog2 = createBackgroundSubtractorMOG2(History, T1, true); mog2->apply(moveFound, moveFound); 现代码为:Ptr<BackgroundSubtractorMOG2> mog2 = new BackgroundSubtractorMOG2(History, T1, true); mog2->operator()(moveFound, moveFound);
-
error: ISO C++ forbids in-class initialization of non-const static member 'flag'
解决方案:(c++版本不同,typedef struct定义的结构体类型中不能初始化un-const static 的变量) 在结构体外对变量赋初值,放置的位置不同也会出现错误,本段代码中将其放置在 void match(Mat frameHSV, vector<Rect> found)。了解一下结构体的定义与使用 -
error: call of overloaded 'Rect_(cv::Rect_<double>&)' is ambiguous 解决方案:double改int型
-
在Ubuntu16.04下的错误如下: src/moveDetect.h: In function 'void moveDetect(cv::Mat, cv::Mat&)':
src/moveDetect.h:26: error: 'class cv::BackgroundSubtractorMOG2' has no member named 'apply'
In file included from src/MainDlg.h:16,
from src/main.cpp:6:
src/svmDetect.h: In function 'void svmDetect(cv::Mat, std::vector<cv::Rect_<int>, std::allocator<cv::Rect_<int> > >&)':
src/svmDetect.h:27: warning: comparison between signed and unsigned integer expressions
In file included from src/MainDlg.h:17,
from src/main.cpp:6:
src/pedestrianJudge.h: In function 'void pedestrianJudge(cv::Mat, std::vector<cv::Rect_<int>, std::allocator<cv::Rect_<int> > >&)':
src/pedestrianJudge.h:30: warning: comparison between signed and unsigned integer expressions
src/pedestrianJudge.h:54: warning: comparison between signed and unsigned integer expressions
In file included from src/MainDlg.h:18,
from src/main.cpp:6:
src/particleFilter.h: At global scope:
src/particleFilter.h:40: error: 'default_random_engine' does not name a type
src/particleFilter.h:59: error: ISO C++ forbids initialization of member 'flag'
src/particleFilter.h:59: error: making 'flag' static
src/particleFilter.h:59: error: ISO C++ forbids in-class initialization of non-const static member 'flag'
src/particleFilter.h:61: error: ISO C++ forbids initialization of member 'deleteN'
src/particleFilter.h:61: error: making 'deleteN' static
src/particleFilter.h:61: error: ISO C++ forbids in-class initialization of non-const static member 'deleteN'
src/particleFilter.h: In function 'void match(cv::Mat, std::vector<cv::Rect_<int>, std::allocator<cv::Rect_<int> > >)':
src/particleFilter.h:102: warning: comparison between signed and unsigned integer expressions
src/particleFilter.h: In function 'void updateParticles(cv::Mat)':
src/particleFilter.h:185: error: 'e' was not declared in this scope
src/particleFilter.h:190: error: 'e' was not declared in this scope
src/particleFilter.h:273: error: call of overloaded 'Rect_(cv::Rect_<double>&)' is ambiguous
src/opencv2/core/operations.hpp:1902: note: candidates are: cv::Rect_<_Tp>::Rect_(const CvRect&) [with _Tp = int]
src/opencv2/core/operations.hpp:1901: note: cv::Rect_<_Tp>::Rect_(const cv::Rect_<_Tp>&) [with _Tp = int]
src/particleFilter.h: At global scope:
src/particleFilter.h:330: warning: unused parameter 'frameDetect'
Makefile:286: recipe for target 'main.o' failed
make: *** [main.o] Error 1