Skip to content

PYTHON cv2.resize Error “(-215:Assertion failed) !dsize.empty()” #450

Open
@josele69

Description

@josele69

I am trying to resize an image with cv2.resize function in PYTHON3 and I get the following error:

error: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-oduouqig\opencv\modules\imgproc\src\resize.cpp:3688: error: (-215:Assertion failed) !dsize.empty() in function 'cv::hal::resize'

My images are uint16 arrays:

img_ms.shape
(4, 57, 62)

img_pan.shape
(1, 1140, 1240)

The sample function I am using inside an image pansharpening script is:

downsampled_img_pan = cv2.resize(img_pan, (img_ms.shape[2], img_ms.shape[1]),
interpolation = cv2.INTER_AREA)[:, :, np.newaxis]

Thanks!

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions