close

[Fixed] OpenCV(4.1.2) error: (-215:Assertion failed) !ssize.empty() in function ‘cv::resize’

Today We are Going To Solve OpenCV(4.1.2) error: (-215:Assertion failed) !ssize.empty() in function ‘cv::resize’ in Python. Here we will Discuss All Possible Solutions and How this error Occurs So let’s get started with this Article.

How to Fix OpenCV(4.1.2) error: (-215:Assertion failed) !ssize.empty() in function ‘cv::resize’ Error?

  1. How to Fix OpenCV(4.1.2) error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize' Error?

    To Fix OpenCV(4.1.2) error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize' Error just Use the below code. To solve this error you can try the below code img=cv2.imread(filename) try: img = cv2.resize(img, (1400, 1000), interpolation=cv2.INTER_AREA) print(img.shape) except: break height, width , layers = img.shape size=(width,height)

  2. OpenCV(4.1.2) error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

    To Fix OpenCV(4.1.2) error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize' Error just Use the below code. To solve this error you can try the below code img=cv2.imread(filename) try: img = cv2.resize(img, (1400, 1000), interpolation=cv2.INTER_AREA) print(img.shape) except: break height, width , layers = img.shape size=(width,height)

Solution 1 : Use the below code

To solve this error you can try the below code

 img=cv2.imread(filename)
        try:
           img = cv2.resize(img, (1400, 1000), interpolation=cv2.INTER_AREA)
            print(img.shape)
        except:
        break
    height, width , layers = img.shape
    size=(width,height)

Conclusion

So these were all possible solutions to this error. I hope your error has been solved by this article. In the comments, tell us which solution worked? If you liked our article, please share it on your social media and comment on your suggestions. Thank you.

Also Read These Solutions

Leave a Comment