title: "image is not a numpy array, neither a scalar" from cv2
body: <p>This is my code:</p>
  <pre><code>import cv2
  cam=cv2.VideoCapture(0,cv2.CAP_DSHOW)
  cam.set(3,640)
  cam.set(4,480)
  detector=cv2.CascadeClassifier('C:\\Users\\Hp\\Downloads\\8f51e58ac0813cb695f3733926c77f52- 
  07eed8d5486b1abff88d7e34891f1326a9b6a6f5\\8f51e58ac0813cb695f3733926c77f52- 
  07eed8d5486b1abff88d7e34891f1326a9b6a6f5\\haarcascade_frontalface_default.xml')
  face_id=input(&quot;Enter a numeric face id: &quot;)
  print(&quot;taking sample, look at camera......&quot;)
  count=0
  while True:
        ret, img=cam.read('C:\\Users\\Hp\\Desktop\\leo software 
        company\\gamedata\\.vscode\\Maya.Ai')
        converted_image=cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
        faces=detector.detectMultiScale(converted_image, 1.3, 5)
        for (x,y,w,h) in faces:
            cv2.rectangle(img, (x,y),(x+w,y+h),(255,0,0),2)
            count += 1
            cv2.imwrite(&quot;samples/face.&quot;+str(face_id)+'.'+str(count)+&quot;.jpg&quot;, 
            converted_image[y:y+h,x:x+w])
            cv2.imshow('image',img)
            k=cv2.waitKey(100) &amp; 0xff
            if k == 27:
            break
           elif count&gt;=10:
           break
           print(&quot;id made succesfully&quot;)
           cam.release()
           cv2.destroyAllWindows
  </code></pre>
  <p>I am getting this error:</p>
  <pre class="lang-none prettyprint-override"><code>Traceback (most recent call last):
    File &quot;c:\Users\Hp\Desktop\leo software company\game data\.vscode\Maya.Ai\id.py&quot;, line 10, in &lt;module&gt;
      ret, img=cam.read('C:\\Users\\Hp\\Desktop\\leo software company\\game data\\.vscode\\Maya.Ai')
  cv2.error: OpenCV(4.5.5) :-1: error: (-5:Bad argument) in function 'read'
  &gt; Overload resolution failed:
  &gt;  - image is not a numpy array, neither a scalar
  &gt;  - Expected Ptr&lt;cv::UMat&gt; for argument 'image'
  </code></pre>