從this question in SO我知道錯誤應該通過opencv contrib來解決,但問題是當我第一次使用cmake使用this guide by pyimagesearch構建opencv時,我還構建了opencvcontrib。如果我必須重建它,我該怎麼做呢?AttributeError:'模塊'對象沒有任何屬性'createLBPHFaceRecognizer'
這是錯誤:
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