How to create a graph of pixels?

I have this Matlab code that gives me in output this image in which I have a graph that sorrounds the obtacles. My idea now is to apply something like a Dijkstra algorithm to that graph or the shortestpath function of Matlab but I do not know how to create a graph of the pixels in white in the solution. Could anyone help me? Thanks
clc; clear all; close all;
img = imread('mappa3.png');
new_img = rgb2gray(img);
Icomplement = imcomplement(new_img);
BW = imbinarize(Icomplement);
out = bwskel(BW,'MinBranchLength',1e6);
imshow(out)

Answers (1)

Products

Release

R2021b

Asked:

on 15 May 2022

Edited:

on 15 May 2022

Community Treasure Hunt

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

Start Hunting!