kevinjycui / bad-apple

Code from my Bad Apple!! YouTube videos
https://www.youtube.com/playlist?list=PLsTVaNk5lQHmRy51gyAsVN16DHpv0gcfE
825 stars 108 forks source link

ms-paint/main.py ValueError: too many values to unpack (expected 2) #10

Open sudocpMATHdotPY opened 1 year ago

sudocpMATHdotPY commented 1 year ago

When I run the main.py file, I get this error:

contours, hierarchy = cv2.findContours(binary, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
ValueError: too many values to unpack (expected 2)

I have looked up ways to fix this, but it ends up returning an empty tuple for contours when fixed:

_, contours, hierarchy = cv2.findContours(binary, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
print(contours)

output: ()

Is there any fix I can use?

chocolatecakecake commented 1 year ago

reinstall python