I am getting an error in this code
def pre_processing(img):
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
img = cv2.equalizeHist(img)
img = img / 255
return img
while True:
success, img_original = cap.read()
img = np.asarray(img_original)
img = cv2.resize(img, (32, 32))
img = pre_processing(img)
cv2.imshow("Processsed Image", img)
img = img.reshape(1, 32, 32, 1)
I get this error:
Traceback (most recent call last): File "C:/Users/PycharmProjects/test.py", line 27, in img = cv2.resize(img,(32,32)) TypeError: Expected Ptr<cv::UMat> for argument 'src'