i am getting the cordinates of these all boundaries but i cannot understand how to store greeen boundaries in separate cell array with coresponding parent boundary number e.g( parant,cild 1 boundary) .my c0de is attached here
1 view (last 30 days)
Show older comments
[B,L,N,A] = bwboundaries(BW);
% figure; imshow(BW); 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
% enclosed_boundaries = find(A(:,k));
% end
%end
%enclosing_boundary = find(A(m,:));
0 Comments
Answers (0)
See Also
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!