esdalmaijer / webcam-eyetracker

Webcam-based pupil-tracker, complete with GUI to perform calibrations.
http://www.pygaze.org/2015/06/webcam-eye-tracker/
GNU General Public License v3.0
294 stars 105 forks source link

Update cv2 usage #13

Closed JagjitBhatia-UIC closed 5 years ago

JagjitBhatia-UIC commented 5 years ago

The line "flags = cv2.cv.CV_HAAR_SCALE_IMAGE" was throwing an error. This is most likely because the updated Python OpenCV library no longer supports importing the legacy cv module. For more information, please visit the link below:

https://stackoverflow.com/questions/36242860/attribute-error-while-using-opencv-for-face-recognition

esdalmaijer commented 5 years ago

Yes, this is developed for an older OpenCV version. Unfortunately, the change you suggest would destroy backwards compatibility. An acceptable alternatives could be a try-except attempt (or, even better, detecting what version of OpenCV is used and using the appropriate flags from thereon). In addition, it should be changed for all OpenCV calls that hinge on the older versions, not just this one.