Error while resizing image: “error: (-215:Assertion failed) func != 0 in function 'resize'”
问题 I'm trying to preprocess images dataset, represented in numpy array with images of shape (28, 28) by rescaling them to (10, 10). I wrote a function for that: def resize_dataset(images): resized_images = [] for img in images: img = img.reshape((28,28)) resized_img = cv2.resize(img, dsize=(10, 10)) resized_images.append(resized_img) return numpy.array(resized_images) But when I actually try to rescale them, I get the following error in cv2.resize : error: OpenCV(4.0.0) /io/opencv/modules