title: Solve error: Expected Ptr<cv::UMat> for argument '%s'
body: <pre><code>FcascPath='/content/drive/MyDrive/COTM july/Copy of haarcascade_frontalface_default.xml'
  
  #Create the haar cascade
  faceCascade = cv2.CascadeClassifier(FcascPath)
  
  def imgdetect(gray,image):
    faces=faceCascade.detectMultiScale(gray,1.3,5)
    for (x,y,w,h) in faces:
      cv2.rectangle(image,(x,y),(x+w,y+h),(0,255,0),2)
      roi_gray=gray[y:y+h,x:x+w]
    return image
  
  i10=&quot;/content/drive/MyDrive/COTM july/Faces /10.jpg&quot;
  gr = cv2.cvtColor(i10, cv2.COLOR_BGR2GRAY)
  
  canvas=imgdetect(gr,i10)
  cv2.imshow(&quot;resultvideo&quot;, canavs)
  </code></pre>
  <p>And it is showing this:</p>
  <p>TypeError                                 Traceback (most recent call last)
   in ()
  13
  14 i10=&quot;/content/drive/MyDrive/COTM july/Faces /10.jpg&quot;
  ---&gt; 15 gr = cv2.cvtColor(i10, cv2.COLOR_BGR2GRAY)
  16
  17 canvas=imgdetect(gr,i10)</p>
  <p>TypeError: Expected Ptr&lt;cv::UMat&gt; for argument '%s</p>