White Lane Detection

Hi, I am implementing a lane detection algorithm and I am using find_line_segments() on the RGB565 pixel format. I was getting consistent results, but encountered an issue with the algorithm detecting outside edges and generating lines where they shouldn’t be.

To fix this I wanted to convert the image to binary to only detect white lines, but when I do this the find_line_segments() doesn’t pick up the lines. I even came across an older post
(White lines detection) and tried it on my end with no luck. Any suggestions would be greatly appreciated!

Find_line_segments() doesn’t really work on binary images. The algorithm for that assumes there’s some grayscale content. It does not like the sharp edges of a binary image. Please note find_line_segments() is the OpenCV LSD algorithm.

Regarding it detecting lines where they shouldn’t be. Can you filter these out? That’s the typical approach.

Thanks for the quick reply! Yes I tried filtering, but it got tricky on cases where outside lines would meet the criteria. For example, the edge of the carpet that is closely parallel to the lane would often get picked up. I’ll keep playing around with it and thanks again for the help.