How Convert the 2D Binary Data to the Node-link Graph?

4 visualizzazioni (ultimi 30 giorni)
Changwoo Lee il 22 Giu 2023
Risposto: Gourab il 23 Giu 2023
Hello, I have a 2D binary data as follows:
Icomplement = imcomplement(I);
BW = imbinarize(Icomplement);
imshow(BW);
Then, I want to convert this 2D binary data to the Node-link Graph.
Finally, I want to detect where the disconnectivity of each link occurs.
Meanwhiles, I found the matlab code (skel2graph3D) on the link (https://kr.mathworks.com/matlabcentral/fileexchange/43527-skel2graph-3d)
However, this code might only support the conversion of 3D binary data to the node-link graph.
Therefore, my question is how to convert the 2D binary data to the node-link graph.
Is there any useful Matlab code library?
Your answers are of great help for me. Thank you very much.
0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

Risposte (1)

Gourab il 23 Giu 2023
Hi Changwoo,
After reading the question I get that you want to convert the 2D image to a node linked graph but you are unable to do it using "Skel2Graph3D” function.
You can use the “bwskel” function to convert the binary image BW to a skeleton and then using the “Skel2Graph3D” function plot it as a node-link graph.
Refer to the below code snippet.
% Invert image and binarize
BW = ~imbinarize(I);
% Compute skeleton using bwskel
skel = bwskel(BW);
% Convert skeleton to node-link graph
node_graph = Skel2Graph3D(skel,15);
figure;
h = plot(node_graph);
0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

Categorie

Scopri di più su Image Arithmetic in Help Center e File Exchange

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by