AttributeError:模块'cv2.cv2'没有属性'createFisherFaceRecognizer'

时间:2017-10-15 02:21:26

标签: python opencv face-recognition

我已经安装了opencv-python,然后尝试了这段代码:

*

import cv2
import glob as gb
import random
import numpy as np
#Emotion list
emojis = ["neutral", "anger", "contempt", "disgust", "fear", "happy", "sadness", "surprise"] 
 #Initialize fisher face classifier
fisher_face = cv2.createFisherFaceRecognizer()

*

但是我收到了这个错误。我尝试安装opencv-contrib-python,但它又给了我同样的问题。请帮助我。

提前致谢!

1 个答案:

答案 0 :(得分:1)

您可能正在使用 OpenCV 3.3 ,根据他们的documentation,此模块已移至face下。您可以使用cv2.face.FisherFaceRecognizer_create()

访问它