title: TypeError: Expected Ptr<cv::UMat> for argument 'mat'
body: <p>I have the following code to capture data for my beginner face recognition project</p>
  <pre><code>ret, frame = cap.read()
  gray = []
  
  if ret:
      faces = detector.detectMultiScale(frame)
  
      for face in faces:
          x, y, w, h = face
          cut = frame[y:y+h, x:x+w]
          fix = cv2.resize(cut, (100, 100))
          gray = cv2.cvtColor(fix, cv2.COLOR_BGR2GRAY)
          gray = np.array(gray)
      cv2.imshow(&quot;My Face&quot;, gray)
  
  key = cv2.waitKey(1)
  if key == ord(&quot;q&quot;):
      break
  if key == ord(&quot;c&quot;):
      frames.append(gray.flatten())
      outputs.append([name])
  </code></pre>
  <p>It shows error</p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:/Users/satwi/Desktop/Satwik/MyPython/ML Bootcamp/face_recognition/face_recog_collector.py&quot;, line 30, in &lt;module&gt;
      cv2.imshow(&quot;My Face&quot;, gray)
  TypeError: Expected Ptr&lt;cv::UMat&gt; for argument 'mat'
  </code></pre>
  <p>Nothing seems to work to fix this error</p>