TypeError: Expected cv::UMat for argument 'src'

I'm getting this issue, when I want to resize the image. Argument is has numpy.ndarray type and it's got to work.

opencvresizecv2
3 votesJW229.00
1 Answers
NN132.00
2

The reason might be the type of your matrix. Just make sure it has a proper type, e. g.

import cv2
import numpy as np

img = np.array(array).astype(np.uint8)
cv2.resize(img, new_size, interpolation=cv2.INTER_LINEAR)
Reply
Couldn't find what you were looking for?and we will find an expert to answer.
How helpful was this page?