Error using cv2.findContours(), with python
<p>I've recently started learning OpenCV on Python.</p>

<p>I'm referring to <a href="http://docs.opencv.org/3.1.0/d4/d73/tutorial_py_contours_begin.html" rel="noreferrer" title="this">this</a> tutorial here, to get some help on getting the contours of an image.</p>

<p>My code is - </p>

<pre><code>import cv2
import numpy as np

img = cv2.imread('shapes.jpg', 0)
img = cv2.medianBlur(img, 5)
thresh =     cv2.adaptiveThreshold(img,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C,\
cv2.THRESH_BINARY,11,2)

cv2.imshow('Thresh', thresh)
cv2.waitKey(0)
cv2.destroyAllWindows()

image, contours, hierarchy =   cv2.findContours(thresh.copy(),cv2.RETR_LIST,cv2.CHAIN_APPROX_SIMPLE)

cv2.drawContours(image, countours, -1, (0,255,0), 3)
cv2.imshow('Contours', img)
cv2.waitKey(0)
cv2.destroyAllWindows()
</code></pre>

<p>The first thresholded image is appearing, but after that I get an error message as</p>

<pre><code>Traceback (most recent call last):
  File "contours.py", line 21, in &lt;module&gt;
    image, contours, hierarchy =     cv2.findContours(thresh.copy(),cv2.RETR_LIST,cv2.CHAIN_APPROX_SIMPLE)
ValueError: need more than 2 values to unpack
</code></pre>

<p>Any help to resolve this issue will be appreciated.</p>