0

So I am getting this error after i updated all the packages.

    <ipython-input-48-e9a9716d4b8c> in extractText(path)
     15     plt.show()
     16 
---> 17     img, contours, hierarchy = cv2.findContours(edged, cv2.RETR_LIST, cv2.CHAIN_APPROX_NONE)
     18     contours = sorted(contours, key=cv2.contourArea, reverse=True)
     19 

ValueError: not enough values to unpack (expected 3, got 2)
Jeru Luke
  • 20,118
  • 13
  • 80
  • 87
Mohit Yadav
  • 45
  • 2
  • 7

1 Answers1

4

In openCV4, cv2.findContours() returns 2 values contours, hierarchy, so it should be:

contours, hierarchy = cv2.findContours(edged, cv2.RETR_LIST, cv2.CHAIN_APPROX_NONE)
Ha Bom
  • 2,787
  • 3
  • 15
  • 29