在opencv 3.0中缺少contrib模块? [英] contrib module missing in opencv 3.0?

查看:979
本文介绍了在opencv 3.0中缺少contrib模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用OpenCV 3.0测试版。

I am using OpenCV 3.0 beta.

我尝试使用createLBPHFaceRecognizer()创建一个面部识别器; class as,

I tried to create a face recogniser using createLBPHFaceRecognizer(); class as,

   **Ptr <FaceRecognizer> model =  createLBPHFaceRecognizer();**

我遇到的错误是

   **error: 'createLBPHFaceRecognizer' was not declared in this scope**

我研究过并发现该类存在于opencv2
contrib 模块中(opencv2 / contrib / contrib.hpp)在早期版本的OpenCV中

I have researched and found that the class exists in contrib module of opencv2 (opencv2/contrib/contrib.hpp) in previous versions of OpenCV

但是这个模块在opencv 3.0 beta中不可用。
那么在opencv 3.0中定义的识别器类在哪里?

But this module is not available in opencv 3.0 beta. So where are the recogniser classes defined in opencv 3.0?

如果没有定义它们,除了现有模块之外,我们如何添加该模块?

If they are not defined,how can we add this module in addition to the existing modules?

推荐答案

您必须下载并构建 opencv_contrib repo。

you will have to download and build the opencv_contrib repo.

运行cmake,make,make install,

after running cmake, make, make install,

#include <opencv2/face.hpp>

// note the additional namespace:    
cv::Ptr <cv::face::FaceRecognizer> model = cv::face::createLBPHFaceRecognizer();
// proceed as usual

这篇关于在opencv 3.0中缺少contrib模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆