You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you specify the version of OpenCV used by you?
It seems that you are getting the error because the function cv2.findContours is returning only two values instead of three values.
A possible cause will be you are using OpenCV version less than 3.0.
A possible solution is to remove the variable im2 at line no. 118, the change is given below:
im2, cnts, hierarchy = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) ---> current line
cnts, hierarchy = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) ---> changed line
I try to run your project
but it can not be run
So this is an error
$ python3 main.py --videos videos
/Users/teamzoon/Downloads/Human-detection-and-Tracking-master/videos/6.mp4*.mp4
['/Users/teamzoon/Downloads/Human-detection-and-Tracking-master/videos/6.mp4']
(360, 640, 3)
(360, 640, 3)
Traceback (most recent call last):
File "main.py", line 160, in
temp = background_subtraction(previous_frame, frame_resized_grayscale, min_area)
File "main.py", line 118, in background_subtraction
im2, cnts, hierarchy = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
ValueError: not enough values to unpack (expected 3, got 2)
The text was updated successfully, but these errors were encountered: