title: cv2.error: opencv(4.5.3) :-1: error: (-5:bad argument) in function 'resize'
body: <pre><code>import numpy as np
  import cv2
  import pickle
  
  ########### PARAMETERS ##############
  width = 640
  height = 480
  threshold = 0.65 # MINIMUM PROBABILITY TO CLASSIFY
  cameraNo = 1
  #####################################
  
  #### CREATE CAMERA OBJECT
  cap = cv2.VideoCapture(cameraNo)
  cap.set(3,width)
  cap.set(4,height)
  
  #### LOAD THE TRAINNED MODEL
  pickle_in = open(&quot;model_trained.p&quot;,&quot;rb&quot;)
  model = pickle.load(pickle_in)
  
  print(cv2.__version__)
  #### PREPORCESSING FUNCTION
  def preProcessing(img):
      img = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
      img = cv2.equalizeHist(img)
      img = img/255
      return img
  
      while True:
          success, imgOriginal = cap.read()
          img = np.asarray(imgOriginal)
          img = cv2.resize(img,(32,32))   &lt;------ ERROR HERE
          img = preProcessing(img)
          cv2.imshow(&quot;Processsed Image&quot;,img)
          img = img.reshape(1,32,32,1)
          #### PREDICT
          classIndex = int(model.predict_classes(img))
          #print(classIndex)
      predictions = model.predict(img)
      #print(predictions)
      probVal= np.amax(predictions)
      print(classIndex,probVal)
  
      if probVal&gt; threshold:
          cv2.putText(imgOriginal,str(classIndex) + &quot;   &quot;+str(probVal),
                      (50,50),cv2.FONT_HERSHEY_COMPLEX,
                      1,(0,0,255),1)
  
      cv2.imshow(&quot;Original Image&quot;,imgOriginal)
      if cv2.waitKey(1) &amp; 0xFF == ord('q'):
          break
  </code></pre>
  <h3 id="error-64ab">ERROR :</h3>
  <blockquote>
  <p>File &quot;E:/DATA_SCIENCE/MY_WORK/test.py&quot;, line 32, in </p>
  <blockquote>
  <p>img = cv2.resize(img,(32,32)) cv2.error: OpenCV(4.5.3) :-1: error: (-5:Bad argument) in function 'resize'
  Overload resolution failed:</p>
  <ul>
  <li>src data type = 17 is not supported</li>
  <li>Expected Ptr&lt;cv::UMat&gt; for argument 'src'</li>
  </ul>
  </blockquote>
  </blockquote>