I am currently working on a project of an automated car and I have an issue with HoughLinesP function. When the car is turnning, it detects a "ghost line". Bellow is the code of my function and these are the parameters:
edges: Output of the edge detector.
lines: A vector to store the coordinates of the start and end of the line.
rho: The resolution parameter \rho in pixels.
theta: The resolution of the parameter \theta in radians.
threshold: The minimum number of intersecting points to detect a line.
I increased the threshold parameter but it has a negative effect on the straight lines.
Any solution is welcome.
#Line segment detection
def detect_line_segments(cropped_edges):
rho = 1 #Precision in pixel, i.e. 1 pixel
angle = np.pi / 180 #Degree in radian, i.e. 1 degree
min_threshold = 10 #Minimal of votes
line_segments = cv2.HoughLinesP(cropped_edges, rho, angle, min_threshold, np.array([]),
minLineLength=5, maxLineGap=4)
return line_segments