title: How to properly use cv2.findContours() on opencv version 4.4.0.?
body: <p>Im trying to use cv2.findContours() on opencv version 4.4.0. (Im using Python version 3.8.5) but it throws an error, I cant figure out. Im not sure whats wrong with the code. Here's some background:</p>
  <p>According to OpenCV the syntax for <code>cv2.findContours()</code> is as follows:
  Python:
  <code>contours, hierarchy = cv.findContours(image, mode, method[, contours[, hierarchy[, offset]]])</code></p>
  <p>I looked for some examples to make sure how to properly implement it, heres what I found:</p>
  <ul>
  <li><p>example 1</p>
  <p><code>(_, contours, _) = cv2.findContours(binary_image, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)</code></p>
  </li>
  <li><p>example 2</p>
  <p><code>(_, cnts, _) = cv2.findContours(thresholded.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)</code></p>
  </li>
  </ul>
  <p>Those are from working projects I found online, there are plenty examples like those. So, Im trying to implement some  code I got from a video to gain some understanding on the topic but it does not seem to work for me and I cant find why. Heres the code:</p>
  <pre><code>import cv2 
  import numpy as np 
  
  imagen =cv2.imread('lettuce.jpg')
  gray = cv2.cvtColor(imagen,cv2.COLOR_BGR2GRAY)
  _,binary = cv2.threshold(gray,100,255,cv2.THRESH_BINARY)
  
  image,contours,hierarchy = cv2.findContours(binary,cv2.RETR_LIST,cv2.CHAIN_APPROX_SIMPLE)
  
  cv2.drawContours(image,contours, -1, (0,255,0),3)
  </code></pre>
  <p>Error:</p>
  <pre><code>Traceback (most recent call last):
    line 8, in &lt;module&gt;
      image,contours,hierarchy = cv2.findContours(binary,cv2.RETR_LIST,cv2.CHAIN_APPROX_SIMPLE)
  ValueError: not enough values to unpack (expected 3, got 2)
  </code></pre>