I have an image containing segmentation results, like this one. 
I need to plot the neighborhood of patches painted in different colors. As a result, I need a structure representing the following 
Here the numbers are separate patches, and the lines are neighborhoods of patches. Currently, I cannot figure out where to start, what are the keywords for google.
Can anyone suggest anything useful?
The image is saved in the OpenCV class cv :: Mat, as for the graph, I plan to use the Boost.Graph library.
So, please give me some links to code samples and algorithms or keywords.
Thanks.
Update . After a coffee break and some discussions, the following occurred to me.
- Create a large lattice graph, where each node corresponds to each pixel in the image, and the links connect 8 or 4 neighbors.
- Label each node graph with a corresponding pixel value.
- Try merging nodes with the same label.
My other problem is that I am not familiar with BGL (but the book is on the way :)).
So what do you think of this decision?
Update2 Probably this link may help.
However, a solution has not yet been found.
source share