Faced with the same problem and solved it by using tuples instead of lists:
# How it looked before:
point1, point2 = [x1, y1], [x2, y2]
# How it should be:
point1, point2 = (x1, y1), (x2, y2)
Python OpenCV drawing functions take points as tuples. Possibly your point1
and point2
are of some other type, eg. a list
maybe. So try this
cv2.line(output, tuple(point1), tuple(point2), (0,0,255),5)
The error is raised, because the OpenCV Python extensions call the function PyArg_ParseTuple()
with something that is not a tuple. [see here]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With