I’m currently working on road lane line detection (how original ) and in order to detect the lines and the dotted line I use findContours and then approxPolyDP to obtain polygons. After that I find the midpoints of near horizontal segments.
Here’s the result with images:
Image with polygons and midpoints
That was the easy part, because now if I use an image with a turn, I will get polygons with more than 4 segments
Image with polygons (ignore the false positives)
I did a simple drawing to show you what I would like to obtain in that case, because I struggle to express it with words:
It’s about finding the “inner midpoints”, because the goal is to link the points to draw a line
I hope it is clear enough, if not I’ll make sure to update with more informations.