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

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.

3 votesJW326.00
1 Answers

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)
Couldn't find what you were looking for?and we will find an expert to answer.
How helpful was this page?