title: Adaptive Threshold Assertion Error OpenCV Python
body: <p>I am getting following error while using adaptive threshold in python opencv. I have successfully converted rgb image to grayscale but adaptive threshold still not working</p>
  
  <p>Code :</p>
  
  <pre><code>gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
  blurred = cv2.GaussianBlur(gray, (5, 5), 0)
  thresh = cv2.adaptiveThreshold(gray, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, 3, 1)
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>cv2.error: OpenCV(3.4.2) D:\Build\OpenCV\opencv-3.4.2\modules\imgproc\src\thresh.cpp:1524: error: (-215:Assertion failed) src.type() == (((0) &amp; ((1 &lt;&lt; 3) - 1)) + (((1)-1) &lt;&lt; 3)) in function 'cv::adaptiveThreshold'
  </code></pre>