Problem cv2.resize() reports an error

运行报错error: (-215:Assertion failed) !ssize.empty() in function ‘cv::resize‘

One, the problem cv2.resize() reports an error

cv2.error: OpenCV(3.4.3) C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize’

The possible errors are as follows, welcome to add:

Wrong writing
in the form of the image path: Wrong form: C:\Users\Desktop\test The
correct one should be: C:/Users/Desktop/test/

Note: The slash'\' has the meaning of escape character in the program

The picture path is
missing a slash (the picture is stored in the test folder). Error: C:/Users/Desktop/test is
correct: C:/Users/Desktop/test/

Note: Don’t forget the last slash, otherwise it will become the test folder instead of the pictures in it. Because of an accident, I was troubled for two days and thought it was the opencv pot. , Tried countless solutions, like an idiot! ! !

The format of the picture is wrong!
Note: Check whether your program has requirements for the required size or type.

The number of pictures is inconsistent!
Note: Check whether there is a parameter for pre-inputting the number of pictures in your program, and check whether the number of pictures in the folder is consistent with the parameters.

Chinese problem
Note: Do not include Chinese in the path, folder name, and picture name! .(In programming, try to use easy-to-understand English for all kinds of names. Pinyin hhh is not a good way to use it)

Guess you like

Origin blog.csdn.net/m0_37882192/article/details/108738901