title: OpenCV: error: (-215:Assertion failed) _src.type() == CV_8UC1 in function 'cv::equalizeHist'
body: <p>I'm trying with the code from link below to blur faces in images:</p>
  
  <p><a href="https://stackoverflow.com/questions/18064914/how-to-use-opencv-python-to-blur-faces">How to use opencv (python) to blur faces?</a></p>
  
  <pre><code>image = cv2.imread('45.jpg')
  result_image = image.copy()
  
  # Specify the trained cascade classifier
  face_cascade_name = "‪C:/Users/User/Desktop/haarcascade_frontalface_alt.xml"
  
  # Create a cascade classifier
  face_cascade = cv2.CascadeClassifier()
  
  # Load the specified classifier
  face_cascade.load(face_cascade_name)
  
  #Preprocess the image
  grayimg = cv2.cvtColor(image, cv2.COLOR_BGR2HSV)
  grayimg = cv2.equalizeHist(grayimg)
  
  #Run the classifiers
  faces = face_cascade.detectMultiScale(grayimg, 1.1, 2, 0|cv2.cv.CV_HAAR_SCALE_IMAGE, (30, 30))
  
  print ("Faces detected")
  </code></pre>
  
  <p>But i got a Traceback error as follows. Please help. Thanks.</p>
  
  <pre><code>Traceback (most recent call last):
  
    File "&lt;ipython-input-70-d20c79f10494&gt;", line 15, in &lt;module&gt;
      grayimg = cv2.equalizeHist(grayimg)
  
  error: OpenCV(3.4.4) C:\projects\opencv-python\opencv\modules\imgproc\src\histogram.cpp:3334: error: (-215:Assertion failed) _src.type() == CV_8UC1 in function 'cv::equalizeHist'
  </code></pre>