how to find the length and width of connected components
2 次查看(过去 30 天)
显示 更早的评论
hi everyone.
i want to know how to find the length and width of connected components as i already label the connected components using bwlabel and draw the boundries using regionprops and boundry but now the only thing i need to know is how to find the length and width of that drawn boundries(connected components). as i want to seprate those regions that have length and width equall to humans.
2 个评论
回答(2 个)
darova
2020-3-26
Use regionprops
If you used bwlabel, can't you just separate?
[L,n] = bwlabel(image);
data = regionprops(L,'area');
area = cat(1,data.Area);
[~,ix] = sort(area,'descend');
imshow(L==ix(1)) % show biggest region
pause(1)
imshow(L==ix(2)) % show second biggest region
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Call Python from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!