Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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