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): line_image=np.zeros_like(image) 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.
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
Edit: You’ll likely have the same problem with your line arg…I think it needs to be a tuple as well.
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.