Ask Your Question

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?

edit retag close merge delete

Comments

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

( 2017-09-06 03:36:04 -0500 )edit

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.

( 2017-09-06 04:08:55 -0500 )edit

oh well, it depends on the amount of variance. You can learn your ideal thresholds over a set of training images?

( 2017-09-06 04:36:53 -0500 )edit

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.

( 2017-09-06 04:55:14 -0500 )edit
1

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

( 2017-09-06 05:40:21 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

This is the result I got preprocessing image :

Auto thresholding :

Hough Lines (Standard)result using Opencv demonstrator :

Hough Lines (Gradient based)result using Opencv demonstrator :

more

Comments

These are the results which i can achieve by playing around with HoughLineP parameters but i need more accuracy (line following the curvature), what I could think was to group the small segments somehow and fit a centerline maybe.

( 2017-09-06 06:30:15 -0500 )edit

Then instead of fitline you'll have to implement your function to fit curve using polynomial regression or other methods.

( 2017-09-06 08:35:54 -0500 )edit

to fit a line I have to group the pixel belonging to each road in the image and I have no idea how to group them.

( 2017-09-06 10:32:53 -0500 )edit

lines belonging to same group will have "same" slop. and small distance from each other .

( 2017-09-06 20:18:25 -0500 )edit

Stats

Asked: 2017-09-06 03:23:59 -0500

Seen: 612 times

Last updated: Sep 06 '17