Reputation: 17339
We try to detect lane lines on a running track (and with this information the upcoming direction).
We currently use the following (simplified) steps:
Binary: transform the input with a binary threshold
Cropped: crop the region of interest (currently just the lower half of the image)
Canny: detect edges and group them with HoughLinesP
Upward Lines & Closing: only keep lines with an extreme slope - ignore horizontal lines
Result: find connected components and fit quadratic function through each line
This works in general (examples: straight.png, left.png) but has issues if for example a horizontal connection line wasn't removed (example: problems.png - bottom right & bottom left). In such a case the two lines and the connection get interpreted as one connected component.
As our point of view can tilt a lot from left to right (camera mounted on a running person) it is quite hard to define a slope threshold for upwards pointing lines.
Is there a better way to get rid of non upwards pointing track lines? As the current solution with canny, hough transform and slope filtering is not optimal for curves and sometimes doesn't work at all (as described above).
Would it be possible to get from the cropped image straight to the separated lines through morphology operations? Similar to this example. I know we have no strict horizontal lines which makes any fitting kernel a lot more complex (I assume).
Currently, we try to use perspective transformations to get a bird view on the track. This should help to distinguish between horizontal and upward pointing lines.
Another small issue is too short lines which result in inaccurate approximated quadratic functions (most left line in problems.png and straight.png). This might be easily solvable (by requiring a minimal pixel count for a component to be counted as track line) and should not be part of this question.
EDIT (answer questions from vlad_tepesch)
What is with the curves? should they be part of your lane models or not?
We clearly want to detect curves of the running track - as this is needed for the direction estimation. But we want to ignore (remove) the horizontal connection curve on the bottom of the problems.png example.
4./6. rectification - camera distortion
I will take another look at rectification, until now I postponed it, as I thought it isn't that important.
7.3 how many pixel if overlap between segments is ignored (group pixel count)
Just draw all lines from a group and check the non zero pixel count?
10. lanes normally are not quadratic - look int clothoids instead - this may overkill so may be use a 3rd order polynomial instead
I get your point. Clothoids are out of scope at the moment, but I will keep them in mind. How would you go with the direction estimation if we use more complex fitting? Currently we just take the first coefficient of the 2nd oder polynomial to estimate the bending direction (and the degree of curvature to differentiate between curves and straight parts).
optional more advanced
Good point, we already thought about averaging results over multiple frames. I also keep that proposal in the back of my mind.
Straight
Left
Problems
Upvotes: 14
Views: 401
Reputation: 6883
It seems that your real problem is the filtering and the connecting step. because you filter out a lot of horizontal components, then for connecting of the unfiltered nearly vertical lines only sub optimal segments are left.
What is with the curves? should they be part of your lane models or not? At first I assume not, but it only has some influence during the grouping stage.
I would suggest the following steps
optional more advanced
Upvotes: 3