[英]AttributeError: module 'cv2.cv2' has no attribute 'createFisherFaceRecognizer'
I have installed opencv-python and then tried this piece of code: 我已经安装了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()
* *
But I was getting this error. 但是我遇到了这个错误。 I tried installing opencv-contrib-python but again it gave me the same issue.Kindly help me.
我尝试安装opencv-contrib-python,但同样给了我同样的问题,请帮我。
Thanks in advance! 提前致谢!
Chances are you are using OpenCV 3.3 and according to their documentation , this module was moved under face
. 没准你正在使用的OpenCV 3.3,并根据他们的文档 ,这个模块被移至下
face
。 You can access it with cv2.face.FisherFaceRecognizer_create()
您可以使用
cv2.face.FisherFaceRecognizer_create()
访问它
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.