Ask Your Question
0

Build graph from an image

asked May 24 '13

Jawaher Khemakhem gravatar image

I have a binary image and I am trying to build undirected graph from this image in order to apply minimum spanning tree . My idea is from this paper http://cs.brown.edu/~pff/papers/seg-ijcv.pdf

I have no idea how to build the graph .

Preview: (hide)

1 answer

Sort by » oldest newest most voted
1

answered May 24 '13

Guanta gravatar image

updated May 25 '13

Sorry to not directly answer your question. However, from the paper exist the code by the authors: http://cs.brown.edu/~pff/segment/. So maybe you can just have a look at that?

Alternatively you could use other existing segmentation methods, e.g. Power-watersheds: http://powerwatershed.sourceforge.net/ or use one segmentation method of OpenCV, it comes with GrabCut, Watersheds, and (partially) MeanShift (pyrMeanShift()).

Preview: (hide)

Comments

Thank you very much for your reply , I looked at the code existent but I didn't understand how they built the graph from the image , precisely the algorithm I mean .

Jawaher Khemakhem gravatar imageJawaher Khemakhem (May 25 '13)edit

Sry, I don't hvae the time to dig into the code, but I guess (haven't implemented any graph-based algoritm myself yet) that the graph is actually the image itself, thus, a component of the graph is one pixel. Let's say you have a pixel w. value 100 next to one with 30 then the cost of using the edge between those two components could be (depending of course on the cost function) the difference between them, i.e. 70.

Guanta gravatar imageGuanta (May 25 '13)edit

Many thanks , I got the idea how we can build a graph from an image :)

Jawaher Khemakhem gravatar imageJawaher Khemakhem (May 25 '13)edit

Question Tools

Stats

Asked: May 24 '13

Seen: 1,706 times

Last updated: May 25 '13