Ask Your Question

Revision history [back]

error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'

I am running the below code and getting the error. Although, I changed the path of the image and gave absolute path as well, but things are not working. Kindly help!!

import cv2 import numpy as np image = cv2.imread("C:\test_image.jpg")

try: cv2.imshow('result', image) cv2.waitKey(0)

except: print("Here")

error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'

I am running the below code and getting the error. Although, I changed the path of the image and gave absolute path as well, but things are not working. Kindly help!!

import cv2
import numpy as np 
image = cv2.imread("C:\test_image.jpg")

cv2.imread("C:\\test_image.jpg")

try: cv2.imshow('result', image) cv2.waitKey(0)

cv2.waitKey(0)

except: print("Here")

print("Here")