Opencv Python Error: Assertion Failed (size.width>0 && Size.height>0)
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('imag
Solution 1:
Its because cv2.line
returns None
and you are assigning that to your img
variable. So when you get to the next line and try to show the image, there is no image to be shown.
Replace img = cv2.line(img,(0,0),(50,50),(255,0,0),5)
with cv2.line(img,(0,0),(50,50),(255,0,0),5)
Read more about cv2.circle here.
Post a Comment for "Opencv Python Error: Assertion Failed (size.width>0 && Size.height>0)"