Closed melvin2204 closed 6 years ago
Removing that erroneous line fixed it for me, and it still works!
The legacy 'cv' submodule has been removed from OpenCV 3+. Also the name of the "CV_HAAR_SCALE_IMAGE" has been altered, along with some other things.
To fix the issue, change the following line:
flags=cv2.cv.CV_HAAR_SCALE_IMAGE
With this line:
flags=cv2.CASCADE_SCALE_IMAGE
That should fix the issue you're having. Also, I noticed that the code refers to the cascade file as "haarcascade.xml" even tough the name is "haarcascade_.xml" in the repository (notice the underscore). Add the underscore in your code, or change the filename to fix this as well.
I had to change "haarcascade.xml"
to full path to it, like /home/username/simple_opencv_pi_face_detector/haarcascade.xml
Error: flags=cv2.cv.CV_HAAR_SCALE_IMAGE AttributeError: 'module' object has no attribute 'cv'
Windows 10 Python 3.4 CV 3.4.0