cv2.error: OpenCV(3.4.2) C:\Miniconda3\conda-bld\opencv-suite_1534379934306\work\modules\imgproc\src\resize.cpp:3922: error: (-215:Assertion failed)
func != 0 in function ‘cv::hal::resize’
参考:
https://stackoverflow.com/questions/7385465/resize-an-image-and-changing-its-depth
原因:
回答评论1
resize输入输出数值类型或插值类型缺失
because OpenCV resize is missing support for certain combinations of input and output depths (numeric types), and interpolation types
解决方案:
回答评论3
转化类型
the image dtype was int64 (in Python). It worked as soon as I used uint8
我的情况是由于原本图片类型为int32 img.astype(‘uint8’)解决