您可以通过多种方式执行此操作,例如:
img=im2double(imread('SWal5.png'));
m = bwmorph(~img,'shrink',Inf);
[ix iy] = find(m);
tri = delaunay(iy,ix);
image(img)
hold on
triplot(tri,iy,ix,'g')
set(gca,'Ydir','reverse')
axis square off
Run Code Online (Sandbox Code Playgroud)

如果您想要类似于a的东西plot,那么您可以在运行该find步骤后尝试此操作:
[ix ii]=sort(ix);
iy = iy(ii);
imshow(img)
hold on
plot(iy,ix,'k')
set(gca,'Ydir','reverse')
Run Code Online (Sandbox Code Playgroud)
