llSourcell / Object_Detection_demo_LIVE

This is the code for the "How to do Object Detection with OpenCV" live session by Siraj Raval on Youtube
103 stars 80 forks source link

Some error is coming in the same script, i'm running on Windows 10 #2

Closed staticabhi closed 7 years ago

staticabhi commented 7 years ago

I'm using Python 3.5.1 | Anaconda 2.4.1 (64-bit)

and getting the following error in the same script:

ValueError: too many values to unpack (expected 2)

Probably in this line: contours, hierarchy = cv2.findContours(image, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)

staticabhi commented 7 years ago

Debugged the error! i am using openCV 3, so i had to update contours, hierarchy = cv2.findContours(image, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE) to _,contours, hierarchy = cv2.findContours(image, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)

After this i got another error in cv2.ellipse(image_with_ellipse, ellipse, green, 2, cv2.CV_AA). So if you're using openCV3 update this to cv2.ellipse(image_with_ellipse, ellipse, green, 2, cv2.LINE_AA)