Ask Your Question

how to extract Edge lists ?

asked 2013-05-16 02:52:44 -0600

Jawaher Khemakhem gravatar image

updated 2013-05-16 03:06:40 -0600

I am working on binary image .I have extracted skeleton and the only junction point in the image. image description

Now I have to extract a list of points :

-from the top-left of the image to the junction point (nearly) in the middle .

-from the junction point to the top- right point in the image .

Any idea to do it ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-05-16 03:21:45 -0600

Notas gravatar image

Write a method that works like Breadth-first search and does the following: It starts on a position in the image. Put that position in a list. Then in a loop, do the following: Get and remove the point at the beginning of the list and make it black in the current image so it won't be added again. Put that point in another list (this is the list that you want). Look at every point around your position and if it is not black, add it to the beginning of the list. Then start the loop again.

Of course, when using this you have to make your junction point, otherwise it will traverse every point in the image. So you start the method on every point around your junction and get three lists.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2013-05-16 02:52:44 -0600

Seen: 283 times

Last updated: May 16 '13