我一直在尝试运行django应用程序(带有面部识别的考勤系统)。
我在python中使用opencv3.2,在anaconda框架上使用pip安装了opencv-pythonopencv-contrib-python之后,我仍然会收到这样的错误

opencv error file cannot be opened for reading
cv::face::FaceRecognizer::read".
file c:\projects\opencv-python\opencv_contrib\modules\face\src\facerec.cpp line 61.

最佳答案

我有同样的问题。实际上问题出在这里。

recognizer = cv2.face.LBPHFaceRecognizer_create()
recognizer.read("recognizers/face-trainner.yml")//path should be correct

上面的代码片段的第二行中有一个路径。您应该为培训模型提供正确的路径,这对我有用。

10-08 08:55
查看更多