AttributeError: module ‘cv2.cv2‘ has no attribute ‘face‘问题处理

在学习人脸识别调试程序是如下如下问题:

recognizer = cv2.face.LBPHFaceRecognizer_create()
AttributeError: module 'cv2.cv2' has no attribute 'face'

经过多方查找分析得到:默认的pip install opencv-python中缺少一些贡献库模块,所以你需要pip安装opencv-contrib-python

opencv-python 是只包含了主要模块的包,opencv-contrib-python包含了主要模块以及扩展模块,扩展模块主要是包含了一些带专利的收费算法(如shift特征检测)以及一些在测试的新的算法(稳定后会合并到主要模块)。

opencv-contrib-python模块下载地址:

https://pypi.org/project/opencv-contrib-python/#files

你可能感兴趣的:(人脸识别,自动驾驶,机器学习,深度学习)