“'cv2.face'没有属性'LBPHFaceRecognizer_create'”,但如果从pip安装,则GUI会给出qt线程错误

时间:2019-01-22 20:48:01

标签: opencv ubuntu python-3.6

我正在尝试运行用于基本人脸识别的python脚本,但是从pip安装后运行时出现错误:

QObject::moveToThread: Current thread (0x24c8e90) is not the object's thread (0x20da6d0). Cannot move to target thread (0x24c8e90)

我发现了this question并解决了问题,但之后我得到了这个错误:

Traceback (most recent call last): File "face_recognition.py", line 21, in recognizer = cv2.face.LBPHFaceRecognizer_create() AttributeError: module 'cv2.face' has no attribute 'LBPHFaceRecognizer_create'

我找到了许多解决此问题的答案(for example),但所有人都建议从pip安装opencv-contrib-python软件包。 如何从apt-get中包含所需的软件包?

出现错误的代码: import cv2 import numpy as np recognizer = cv2.face.LBPHFaceRecognizer_create()

0 个答案:

没有答案