问题描述
我尝试按照以下指南在raspberry3上安装opencv3.4.0: https://www.life2coding.com/install-opencv-3-4-0-python-3-raspberry-pi-3/
I tried to install opencv3.4.0 on a raspberry3 following this guide: https://www.life2coding.com/install-opencv-3-4-0-python-3-raspberry-pi-3/
现在的问题是我不知道为什么python3会给我错误:
Now the problem is that I could not figure out why python3 gives me the error:
AttributeError: module 'cv2' has no attribute 'face'
每当我尝试执行
face_recognizer = cv2.face.LBPHFaceRecognizer_create()
我已经安装了opencv3.4.0以及其他模块:opencv3.4.0_contrib.我知道面部"必须成为额外模块的一部分.我仍然不知道是什么原因导致此错误.
I already installed opencv3.4.0 and also the additional modules: opencv3.4.0_contrib. I know that "face" needs to be part of the extra modules. Still I cannot figure out what causes this error.
有人可以帮我吗?
推荐答案
最后,我开始使用它了.我只是在两个安装中都使用了pip:
Finally, I got it working. I just used pip for both installations:
pip install opencv-python
pip install opencv-contrib-python
这篇关于AttributeError:模块"cv2"没有属性"face"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!