Save plotted lines in an matrix
Ältere Kommentare anzeigen
Here's my code to obtain these two lines:
[B,L,N,A] = bwboundaries(ImgClosed);
figure
imshow(ImgClosed)
hold on;
% Loop through object boundaries
for k = 1:N
% Boundary k is the parent of a hole if the k-th column of the adjacency matrix A contains a non-zero element
if (nnz(A(:,k)) > 0)
boundary = B{k};
plot(boundary(:,2),boundary(:,1),'r','LineWidth',2);
% Loop through the children of boundary k
for l = find(A(:,k))'
boundary = B{l};
plot(boundary(:,2),boundary(:,1),'g','LineWidth',2);
end
end
end
As ImgClosed is the binary image of the object I'm analysing.
And this is the result:

I want to save both lines (red and green) in an unique matrix so i can plot them again on top of another image. How can i save them?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Triangulations finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



