[Solved] Where is the error? “SystemError: new style getargs format but argument is not a tuple”

I am doing an image processing Lane Detection project. Im getting this error within my code. Im hoping someone can help me figure out how to fix this error.

Here is the function:

def draw_lane_lines(image, lines, color = [255,0,0], thickness=20):
  for line in lines:
    if line is not None:
    cv2.line(*(line_image, [line], color, thickness))

The name of the error is: SystemError: new style getargs format but argument is not a tuple.

The error seems to be in the last line of the code.

Solution #1:

You are correct in the origin of the problem; it’s the cv2.line function.
Take a look at this:

I think your color needs to be a tuple (255,0,0) instead of a list [255,0,0].

Edit: You’ll likely have the same problem with your line arg…I think it needs to be a tuple as well.

Respondent: Jesse McCall
Solution #2:

Not sure how that library formats colour, but normally it is in rounded brackets (255,36,239) which is probably the error about the tuple. Secondly, do not use an equals (=) when defining parameters.

color = [255,0,0]

Should be changed to:

colour = (255,0,0)
, color, thickness..

Also change thickness in the same way.

Respondent: George_E -old
The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Most Popular

To Top
India and Pakistan’s steroid-soaked rhetoric over Kashmir will come back to haunt them both clenbuterol australia bossier man pleads guilty for leadership role in anabolic steriod distribution conspiracy