AttributeError: module 'cv2.cv2' has no attribute 'createLBPHFaceRecognizer' in python 3.6.4 and opencv 3.4

AttributeError: module 'cv2.cv2' has no attribute 'createLBPHFaceRecognizer' in python 3.6.4 and opencv 3.4

我使用了不同类型的东西,我需要它在 3.6 Python 中工作。我也试试 roc = cv2.face.LBPHFaceRecognizer_create() 但得到相同的错误,但这次是面部模块。需要帮助。

相同的代码在 python 2.7.13、opencv 2.4.10 中工作。

如何让它在 python 3.6 和 opencv 3.4 中工作。 我在 windows 环境中工作。

您可能安装了 opencv-python 包而不是 opencv-contrib-python 包。当 OpenCV 出现并放入 contrib 存储库时,许多专有算法从 OpenCV 主存储库中删除。

尝试切换版本。