gigafide / simple_opencv_pi_face_detector

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

Running the code I get an error #6

Open Just-another-pleb opened 6 years ago

Just-another-pleb commented 6 years ago

After finally getting opencv installed and working, I run the code and get an error pointing to line 32: flags = cv2.cv.CV_HAAR_SCALE_IMAGE

(I shall try to type it from the other machine's screen so I can't drag/drop sorry.) Traceback (most recent call last): File "face_tracker_picam.py", line 32, in , flags = cv2.cv.CV_HAAR_SCALE_IMAGE AttributeError: 'module' object has no attribute 'cv'

farhany commented 6 years ago

Are you using the latest code? Code adds a check for OpenCV 3 and below...

Depending on your version of Python, following may help too -- just in case:

Python 2.x: pip install opencv-python
Python 3.x, pip3 install opencv-python

Just-another-pleb commented 6 years ago

I am running it as shown on the site.

I have a working RPI ZW with a camera and want to get the script working.

I saw it and followed the github link and downloaded the file/s.

Following the steps, it doesn't work and it is beyond my knowledge level.

On 18 July 2018 at 16:12, Farhan Yousaf notifications@github.com wrote:

Are you using the latest code? Code adds a check for OpenCV 3 and below...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gigafide/simple_opencv_pi_face_detector/issues/6#issuecomment-405820569, or mute the thread https://github.com/notifications/unsubscribe-auth/AmClmMm59BqEvicKOMjmYaHtK2KS3_YRks5uHtHfgaJpZM4VPkiE .

farhany commented 6 years ago

Ah, you're using the Pi. It probably needs the same changes in the face_tracker_picam.py script... What does pip list show?

Just-another-pleb commented 6 years ago

As reuqested:

pip list Package Version


cffi 0.8.6 chardet 2.3.0 codebug-i2c-tether 0.2.3 codebug-tether 0.7.0 colorama 0.3.2 cryptography 0.6.1 Flask 0.10.1 gpiozero 1.4.0 html5lib 0.999 itsdangerous 0.24 Jinja2 2.7.3 MarkupSafe 0.23 mcpi 0.1.1 numpy 1.8.2 opencv-python 3.4.1.15 pgzero 1.1 picamera 1.13 picraft 1.0 pifacecommon 4.2.1 pifacedigitalio 3.1.0 pigpio 1.35 Pillow 2.6.1 pip 10.0.1 ply 3.4 pycparser 2.10 pygame 1.9.2a0 pygobject 3.14.0 pyinotify 0.9.4 pyOpenSSL 0.14 pyserial 2.6 python-apt 0.9.3.12 python-debian 0.1.27 requests 2.4.3 RPi.GPIO 0.6.3 RTIMULib 7.2.1 sense-emu 1.0 sense-hat 2.2.0 setuptools 5.5.1 six 1.8.0 smbus 1.1 spidev 3.0 twython 3.1.2 urllib3 1.9.1 Werkzeug 0.9.6 wheel 0.24.0

On 20 July 2018 at 16:43, Farhan Yousaf notifications@github.com wrote:

Ah, you're using the Pi. It probably needs the same changes in the face_tracker_picam.py script... What does pip list show?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gigafide/simple_opencv_pi_face_detector/issues/6#issuecomment-406504537, or mute the thread https://github.com/notifications/unsubscribe-auth/AmClmDolyJzAi3c13Owz2hmsvpNeo_9pks5uIXwHgaJpZM4VPkiE .

Just-another-pleb commented 6 years ago

Any update from what I sent you about my RPI?

On 20 July 2018 at 16:43, Farhan Yousaf notifications@github.com wrote:

Ah, you're using the Pi. It probably needs the same changes in the face_tracker_picam.py script... What does pip list show?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gigafide/simple_opencv_pi_face_detector/issues/6#issuecomment-406504537, or mute the thread https://github.com/notifications/unsubscribe-auth/AmClmDolyJzAi3c13Owz2hmsvpNeo_9pks5uIXwHgaJpZM4VPkiE .