Which method can we use to connect a skeleton road ?

I'm trying to determine all the possible paths to matches extremities of those curves (Road following)and choosing paths which verify a configuration like X, Y, T, _, and L in order to connect them(red curve) in a road skeleton not connected (white curve) like the example below :
I detected feature points like the picture below
but i'm stuck i don't know what approach use to do it because it requires a dynamique way .
i have to use a dynamic research window to determine the curve shape(configuration like X, Y, T, _, and L) that will complete the road network.
Any ideas please! Help is much appreciated

Answers (1)

I'm not sure what you're asking or how to answer. With the bwmorph() function you can find endpoints and branchpoints (the red * in your images). Any branchpoint can be checked out to see what it is. There are 256 possible combinations of the 8 surrounding pixels and there may be certain patterns that define each. Then you can make a look up table, like if it's
[0, 1, 0;
1, 1, 1;
0, 1, 1]
it's an "X".

5 Comments

mika
mika on 16 Apr 2014
Edited: mika on 16 Apr 2014
Can you explain please your ideas with an example
the problem is on how to connect curves in a dynamic window.
Well, what shape would you call the pattern example I gave? If the central pixel is set, you can have up to 4 separate "arms" branching off of it. If it has one arm, it's an endpoint or an elbow. If it has two arms, it's a line/curve. It if has 3 arms, it's a Y. If it has 4 arms it's an X. If you want to distinguish between Y and T you can do that. So just go through all 256 possibilities and make up a look up table.
the problem is that i have to connect the white curves in which i complete the skeleton by the red curves that verify patterns(X, Y, T, _, and L) because initially they don't exist and i have to find a method that can make this . is it possible ?
any ideas please! thank you
What do you mean by "connect" and what are "the red curves"? I don't see any red curves, just a set of isolated (x,y) coordinates where you placed a *. And like I said, you can construct a lookup table based on the pattern of the surrounding 8 pixels to determine if it's an X, a Y, etc.
I'm talking about red curves mentioned in the image below that it's expected to be the result i'm looking for taking for example the L pattern mentioned by the blue circle
can you explain a little bit how i can use a look up table because no idea about it and i don't know if it can be extended in a way to recover the more important feature points to give the right pattern.

Sign in to comment.

Categories

Asked:

on 16 Apr 2014

Edited:

on 21 Apr 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!