Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SystemError: new style getargs format but argument is not a tuple?

Tags:

python

opencv

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]