opencv(4.1.2) /io/opencv/modules/imgproc/src/resize.cpp:3720: error: (-215:assertion failed) !ssize.empty() in function 'resize'

Explanation:

  1. The error message "(-215:assertion failed) !ssize.empty() in function 'resize'" indicates that an assertion check has failed in the "resize" function of the OpenCV library. Assertions are used to verify certain conditions and terminate the program if the condition is not met.

  2. The assertion being checked here is "!ssize.empty()". "ssize" is a variable that represents the size of the image being resized. The "empty()" function is used to check if the size is empty or not.

  3. An empty size indicates that the image being resized does not have any dimensions, which is not valid. Therefore, the assertion failure suggests that the input image size is empty, causing the error.

To fix this error, you need to ensure that the input image being passed to the "resize" function has valid dimensions and is not empty. You can do this by checking and validating the input image before calling the "resize" function.