致命错误:opencv2 / contrib / contrib.hpp'文件未找到(打开cv已建立) [英] fatal error: opencv2/contrib/contrib.hpp' file not found (open cv already built)
问题描述
我已根据这些打开cv文档。
我试图编译此 Eigenfaces演示,我收到以下错误。
致命错误:未找到'opencv2 / contrib / contrib.hpp'文件
关注是
#includeopencv2 / contrib / contrib.hpp
pre>
contrib目录不在我的
usr / local / include / opencv /
目录中。我参考了以下 SO问题,但它似乎只处理从头建立的情况。
此外,它引用的存储库 opencv_contrib 甚至不包含文件
contrib.hpp
如何简单地添加必要的源文件到我的当前版本,而不必完全重建一切?
解决方案由于你明显使用opencv3.0:
contrib部分已外包给单独的github repo
你必须得到它,附加到你的opencv然后:
#include< opencv2 / face.hpp>
using namespace cv;
Ptr< face :: FaceRecognizer> model = face :: createLBPHFaceRecognizer(...)
p>
I have downloaded and built open cv according to these open cv docs.
I am trying to compile this Eigenfaces demo, and I am getting the following error.
fatal error: 'opencv2/contrib/contrib.hpp' file not found
The line of concern is
#include "opencv2/contrib/contrib.hpp"
The contrib directory is not in my
usr/local/include/opencv/
directory. I have referenced the following SO Question, but it seems to only handle the case of building from scratch.Also, the repository that it references opencv_contrib does not even contain the file
contrib.hpp
How can I simply add the necessary source files to my current build without having to completely rebuild everything?
解决方案Since you're obviously using opencv3.0:
the contrib parts have been outsourced to a separate github repo
You'll have to get that, append it to your main opencv (re-)build, and then:
#include <opencv2/face.hpp> using namespace cv; Ptr<face::FaceRecognizer> model = face::createLBPHFaceRecognizer(...)
(an additional namespace was added here)
这篇关于致命错误:opencv2 / contrib / contrib.hpp'文件未找到(打开cv已建立)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!