如何在 g++ 上使用 opencv 编译项目 c++
How to compile project c++ with opencv on g++ ?
我ubuntu 14.04
和opencv
用于C++
我想运行这个项目:https://github.com/sharpe-developer/Realtime-Digit-Classifier
如果我这样做:
g++ -o l RealtimeDigitClassifier.cpp `pkg-config --cflags --libs opencv`
我得到 :
In file included from HogSvm.h:19:0,
from RealtimeDigitClassifier.cpp:16:
Svm.h:44:23: error: ‘cv::ml’ has not been declared
void SetType(cv::ml::SVM::Types type) const;
^
Svm.h:44:38: error: expected ‘,’ or ‘...’ before ‘type’
void SetType(cv::ml::SVM::Types type) const;
^
Svm.h:45:25: error: ‘cv::ml’ has not been declared
void SetKernel(cv::ml::SVM::KernelTypes kernel) const;
^
Svm.h:45:46: error: expected ‘,’ or ‘...’ before ‘kernel’
void SetKernel(cv::ml::SVM::KernelTypes kernel) const;
^
Svm.h:63:13: error: ‘ml’ is not a member of ‘cv’
cv::Ptr<cv::ml::SVM> m_svm;
^
Svm.h:63:13: error: ‘ml’ is not a member of ‘cv’
Svm.h:63:24: error: template argument 1 is invalid
cv::Ptr<cv::ml::SVM> m_svm;
^
RealtimeDigitClassifier.cpp: In function ‘void ProcessFrame(const HogSvm&, const HogSvm&, cv::Mat&, cv::Mat&)’:
RealtimeDigitClassifier.cpp:60:34: error: ‘>>’ should be ‘> >’ within a nested template argument list
std::vector<std::vector<Point>> contours;
^
RealtimeDigitClassifier.cpp:99:35: error: ‘to_string’ is not a member of ‘std’
putText(displayFrame, std::to_string(prediction), boundRect.tl() - Point(0, 5), FONT_HERSHEY_PLAIN, 1.4, Scalar(0, 0, 0));
^
RealtimeDigitClassifier.cpp: In function ‘int main(int, char**)’:
RealtimeDigitClassifier.cpp:141:57: error: ‘CAP_PROP_FRAME_WIDTH’ was not declared in this scope
Size vidSize = Size(static_cast<int>(vidCapture.get(CAP_PROP_FRAME_WIDTH)),
^
RealtimeDigitClassifier.cpp:142:57: error: ‘CAP_PROP_FRAME_HEIGHT’ was not declared in this scope
static_cast<int>(vidCapture.get(CAP_PROP_FRAME_HEIGHT)));
^
问题是什么以及如何编译此项目?
cv::ml 尚未声明可能表明您没有正确配置 openCV,错误:"to_string"不是 'std' 的成员可能是由过时的 libstdc++ 引起的,请尝试使用 -std=c++11 标志编译
相关文章:
- 在编译C++代码(具有dlib和opencv)到WASM时面临问题
- 未定义的引用 .. 使用 OpenCV 编译 C++ 代码时,从命令行
- 尝试为 OpenCV 3.4.3 编译opencv_traincascade
- Gtk+ 3 使用 OpenCV 编译时出错
- 如何在 g++ 上使用 opencv 编译项目 c++
- 用Mac OS X Sierra上的OpenCV C 编译Hello World
- 为 OpenCV 编译 MATLAB 绑定
- OpenCV 编译错误与非自由/feature2d.hpp.
- OpenCV 2.4.2 编译"operations.hpp"问题
- Opencv 2.4 编译错误与 objectdetect.hpp.
- 使用 OpenCV 编译头文件.自己的类定义
- 在Windows下为OpenCV编译MinGW库
- Beaglebone上的OpenCV编译错误
- 在mex函数中使用OpenCV:编译后出错
- c++ opencv编译错误- Windows7 64位使用Eclipse CDT
- g++ openCV 编译错误在不存在的行上
- OpenCv编译和链接错误
- OpenCV 2.3编译问题-未定义的参考- Ubuntu 11.10
- 奇怪的opencv编译错误
- OpenCV C++/C 编译错误:未定义对 'cv::fastFree(void*)' 的引用