grouping/joining collinear segments
I am working on road extraction from the image. As a result of HoughLineP applied on the binary image shown below, I have small segments. what I want is to is to group the collinear segments and draw a center line, But i couldn't figure out how can I group the segments based on there proximity/connectivity, Or is there anyother approach to join collinear segments?
I am wondering if a binary pixel based classification between roads and other would not be a faster solution, combined with a thinning algorithm... You would need alot less fixes afterwards I guess
You mean filtering out pixel values of roads? In that case i guess it may give good result in one particular image but I will have to set the threshold values for every image, which is not desired thing.
oh well, it depends on the amount of variance. You can learn your ideal thresholds over a set of training images?
I guess it' will be difficult t to learn an ideal threshold as images are from different regions, though i have NIR as well and I can mask out vegetation from the images( images are from the agricultural areas). I followed an approach from a paper link which is based on finding center pixel from a distance transformed image. following that approach I have these segments as shown in the images.
I think you can get better results preprocessing your source image .
1) - Groupe small lines based on orientation , distance ... etc 2)- use line iterator and accumulate points for each group. 3) - fit line