AttributeError: 模块 'cv2.cv2' 没有属性 'createLBHFaceRecognizer' [英] AttributeError: module 'cv2.cv2' has no attribute 'createLBPHFaceRecognizer'

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

问题描述

我在运行人脸识别代码时遇到了一些属性错误.我的人脸检测代码运行良好.但是当我尝试运行人脸识别代码时,它显示了一些属性错误.我用谷歌搜索并尝试遵循所有步骤.但是,它仍然显示相同的错误.这是我的代码:

I am facing some attribute error while running face recognizing the code. My face detects code run perfectly.But while I try to run the face recognizing code it shows some attribute error. I googled and tried to follow all the steps. But still, it shows the same error. Here is my code:

人脸识别

我收到以下错误:

C:UsersMANAppDataLocalProgramsPythonPython36python.exe C:/Users/MAN/PycharmProjects/facerecognition/Recognise/recognize1.py
Traceback (most recent call last):
  File "C:/Users/MAN/PycharmProjects/facerecognition/Recognise/recognize1.py", line 4, in <module>
    recognizer = cv2.createLBPHFaceRecognizer()
AttributeError: module 'cv2.cv2' has no attribute 'createLBPHFaceRecognizer'

Process finished with exit code 1.

我使用的是 Windows 平台.python 3.6 版本.提前致谢.

I am using Windows platform. python 3.6 version.Thanks in advance.

推荐答案

需要安装opencv-contrib

You need to install opencv-contrib

pip install opencv-contrib-python

它应该在那之后工作.

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

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