I am getting an error while running the following code.
import cv2
import numpy as np
img = cv2.imread('messi.jpg',0)
img = cv2.line(img,(0,0),(50,50),(255,0,0),5)
cv2.imshow("image",img)
cv2.waitKey(0)
cv2.destroyAllWindows()
The error says:
OpenCV Error: Assertion failed (size.width>0 && size.height>0) in unknown function, file ......\src\opencv\modules\highgui\src\window.cpp, line 261
Traceback (most recent call last):
File "F:\Computer programming\scripts\OpenCv\1.py", line 6, in cv2.imshow("image",img) cv2.error: ......\src\opencv\modules\highgui\src\window.cpp:261: error: (-215) size.width>0 && size.height>0
If I remove the line:
img = cv2.line(img,(0,0),(50,50),(255,0,0),5)
the script works.