3

I have been trying to run a django application (attendance system with face recognition).
I'm using python with opencv3.2 and after installing both opencv-python and opencv-contrib-python using pip on anaconda framework, i still get error like this

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.
Dmitrii Z.
  • 2,287
  • 3
  • 19
  • 29
raghav kharbanda
  • 31
  • 1
  • 1
  • 3

1 Answers1

2

I had the the same problem. Actually problem happens here.

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

There is a path in the second line of the above code snippet. You should give the correct path for the training model and this works for me.

Chamila Maddumage
  • 3,304
  • 2
  • 32
  • 43