This error occurs when the input image to the cv2.resize() function has an empty size. This can happen if the input image is not loaded or read properly. Check if the input image is correctly loaded and if the file path is correct. Also, make sure that the input image is not empty or corrupted.

OpenCV Error: 'cv2.error: OpenCV(4.7.0) ... !ssize.empty()' in cv2.resize() - Troubleshooting Guide