title: Error when using cv2.findContours
body: <p>I tried to find contours for image, but it gives an error.</p>
  
  <p>My code is: </p>
  
  <pre><code>import cv2
  import numpy as np
  
  img = cv2.imread('star.jpg',0)
  
  ret,thresh = cv2.threshold(img,127,255,0)
  
  contours,hierarchy = cv2.findContours(thresh, 1, 2)
  </code></pre>
  
  <p>error is: </p>
  
  <blockquote>
    <p><code>Traceback (most recent call last): File "C:\Python27\OpenCVContore.py", line 5, in &lt;module&gt; contours,hierarchy,thresh = cv2.findContours(thresh, 1, 2) error: ........\opencv\modules\core\src\matrix.cpp:236: error: (-215) step[dims-1] == (size_t)CV_ELEM_SIZE(flags) in function cv::Mat::create</code></p>
  </blockquote>
  
  <p>I am using <code>Python 2.7</code> <code>OpenCV 2.4.7,2.4.11</code></p>
  
  <p>Any help is appreciated.</p>