关于python:AttributeError:’module’对象没有属性’createLBPHFaceRecognizer’

AttributeError: 'module' object has no attribute 'createLBPHFaceRecognizer'

从中的这个问题,我理解应该通过使用opencv contrib来解决这个错误,但问题是,当我第一次使用cmake通过pyimagesearch使用这个指南构建opencv时,我还构建了opencvcontrib。如果我必须重建它,我该怎么做呢?

这是错误:

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

也:

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


在搜索高和低cv2.face.LBPHFaceRecognizer_create()found that,只利用OpenCV做的把戏3.3.0 for with OpenCV的屁股我圣希望你发现它有用。P></


我executed this命令行:Python安装OpenCV contrib -皮普恩:3.4.0安装opencv,version hasP></

本厂与和EN公式:P></

1
2
import cv2
recognizer = cv2.face.LBPHFaceRecognizer_create()


createlbphfacerecognizer is in the()子cv2.face Python模块。恩,你应该使用cv2.face.createLBPHFaceRecognizer().access toP></