AttributeError:“模块"对象没有属性"createLBPHFaceRecognizer" [英] AttributeError: 'module' object has no attribute 'createLBPHFaceRecognizer'

查看:572
本文介绍了AttributeError:“模块"对象没有属性"createLBPHFaceRecognizer"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自 SO中的这个问题我知道应该通过使用opencv contrib来解决该错误,但是问题是,当我第一次使用cmake使用

From this question in SO I understand the error should be solved by having opencv contrib, but the thing is that when I first built opencv using cmake using this guide by pyimagesearch , I had also built opencvcontrib. If I must rebuild it, how exactly should I do it?

这是错误:

导入cv2
cv2.createLBPHFaceRecognizer()
追溯(最近一次通话):
文件"stdin",第1行,在模块中
AttributeError:模块"对象没有属性"createLBPHFaceRecognizer"

import cv2
cv2.createLBPHFaceRecognizer()
Traceback (most recent call last):
File "stdin", line 1, in module
AttributeError: 'module' object has no attribute 'createLBPHFaceRecognizer'

也:

导入cv2
帮助(cv2.face.createLBPHFaceRecognizer)
追溯(最近一次通话):
文件"stdin",第1行,在模块中
AttributeError:模块"对象没有属性面"

import cv2
help(cv2.face.createLBPHFaceRecognizer)
Traceback (most recent call last):
File "stdin", line 1, in module
AttributeError: 'module' object has no attribute 'face'

Mac OS,Python 2.7,Opencv 3.2

Mac OS, Python 2.7, Opencv 3.2

推荐答案

在上下搜索之后,我发现使用cv2.face.LBPHFaceRecognizer_create()只需使用opencv contrib即可完成opencv 3.3.0的技巧.希望你觉得它有用.

After searching high and low, I found that using cv2.face.LBPHFaceRecognizer_create() just do the trick for opencv 3.3.0 with opencv contrib. Hope you find it useful.

这篇关于AttributeError:“模块"对象没有属性"createLBPHFaceRecognizer"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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