0

I am trying to read a GitHub repo that Detect "Car Number Plate" and I'm running it on google colab.
but I'm receiving this error when it tries to find contours:

ValueError: not enough values to unpack (expected 3, got 2)

here's my code:

```
(new, cnts, _) = cv2.findContours(edged.copy(), cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)
cnts=sorted(cnts, key = cv2.contourArea, reverse = True)[:30] 
NumberPlateCnt = None
```

Thanks for any help!

Jeru Luke
  • 20,118
  • 13
  • 80
  • 87
Sina
  • 11
  • 1

1 Answers1

0

To make it easier to answer your question it would be very useful to have the full stack trace so that we can see clearly in which line the code fails.

But, I assume that the error is raised in (new, cnts, _) = cv2.findContours(...) because cv2.findContours() only returns a tuple of two (contours and hierarchy). You can see this in the documentation and a use case in their guide.

Lars
  • 128
  • 2
  • 8
  • 1
    flag duplicate questions if you can, but the guidelines say to not answer them. – Christoph Rackwitz Jan 19 '22 at 10:25
  • I did flag it as a duplicate. But if you could point me to where in the guidelines it says not to answer, that would be nice because I cannot find that. – Lars Jan 19 '22 at 10:33