title: Getting an error OpenCV(3.4.1) C:\projects\opencv-python\opencv\modules\imgproc\src\thresh.cpp:1406: error: (-215)
body: <p>I ran the below code and I am getting an error as</p>
  
  <blockquote>
    <p>OpenCV(3.4.1)
    C:\projects\opencv-python\opencv\modules\imgproc\src\thresh.cpp:1406:
    error: (-215) src.type() == (((0) &amp; ((1 &lt;&lt; 3) - 1)) + (((1)-1) &lt;&lt; 3))
    in function cv::threshold</p>
  </blockquote>
  
  <p>I am not clear on what this means and how to fix it</p>
  
  <pre><code>import numpy as numpy
  from matplotlib import pyplot as matplot
  import pandas as pandas
  import math
  from sklearn import preprocessing
  from sklearn import svm
  import cv2
  
  blur = cv2.GaussianBlur(img,(5,5),0)
  ret3,th3 = cv2.threshold(blur,0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)
  image = numpy.invert(th3)
  matplot.imshow(image,'gray')
  matplot.show()
  </code></pre>