gigafide / simple_opencv_pi_face_detector

This is a simple Raspberry Pi OpenCV face detector
30 stars 24 forks source link

opencv Error #2

Closed Tarasus closed 6 years ago

Tarasus commented 6 years ago

File "face_tracker_usb.py", line 25, in flags=cv2.cv.CV_HAAR_SCALE_IMAGE AttributeError: module 'cv2.cv2' has no attribute 'cv'

Python 3.6.5 [GCC 7.3.0] Lubuntu on Ubuntu 18.04 LTS

Tarasus commented 6 years ago

Checked it out on Python 2.7.15rc1 [GCC 7.3.0] Got the same error message.

gigafide commented 6 years ago

You're using a newer version of OpenCV than I was using. In newer versions, you don't need the extra ".cv" in that line, so it should just be "cv2.CV_HAAR_SCALE_IMAGE"

reference: https://stackoverflow.com/questions/33177376/what-is-the-cv2-cv-replacement-in-opencv3

Tarasus commented 6 years ago

Thank you!