Why python "line()" draw one line when called three times ?
Hi,
I am trying to draw a coordinate frame on an image from some points. The code is the following
def draw(img, corners):
points = tuple(map(tuple, corners))
img = cv2.line(img, points[0], points[1], (0,0,255), 3)
img = cv2.line(img, points[0], points[2], (0,255,0), 3)
img = cv2.line(img, points[0], points[3], (255,0,0), 3)
return img
However, only the first of the three lines is drawn. Any idea on what is going wrong ?
Guido
Make sure that your points are not equal or out of bound.
Alright I solve this, and there were two errors. First, I wasn't retrieving the returned image. Seconde cv2.line doesn't return an image (it returns none) I got misled by the opencv 3.0.0 documentation.