Message Boards Message Boards


Create a graph of nodes and edges from an image?

Posted 8 months ago
1 Reply
2 Total Likes

I am using the commands given here to convert the following image to a graph of vertices and edges.

InputImage = link

DeleteSmallComponents[Binarize[Image], 40000]], \[Infinity]]

OutputImage = enter image description here

OutputImage contains some kinks that are not present in the original images. Also, there are some unfinished node-edge connections. The overall image has some disconnected segments.

When the Output Image is converted to a graph, knots appear in the graph.

Graph = MorphologicalGraph[OutputImage]

enter image description here

I would like to ask for suggestions on how to obtain a complete image without disconnections and knots.

Due to its exceptional value, the comment by @Szabolcs Horvát was moved to a stand-alone discussion thread and awarded a Staff Pick badge. @Natash A you can consider the information at the following URL to be answer to your question posted previously by @Szabolcs Horvát :

All sub-comments were transferred there too. Feel free to continue discussion at this original or the new thread.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract