how to find the length and width of connected components

2 ビュー (過去 30 日間)
QuestionsAccount
QuestionsAccount 2020 年 3 月 25 日
回答済み: Image Analyst 2020 年 6 月 18 日
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 件のコメント
darova
darova 2020 年 3 月 25 日
Can you show something? Hard to suggest something without a picture
QuestionsAccount
QuestionsAccount 2020 年 3 月 26 日
thanx for ur reply i solved that problem.
now i need to know how to "remove/separate the big connected regions from binary image", as i already label the connected components using bwlabel and draw the Bounding Boxes around connected components using regionprops and BoundingBox but the only thing i need to know is how to "remove/separate the big connected regions" as i want to seprate those regions that have length and width equall to humans from big regions.
Note: I don't want to use length and width constraints for doing the above thing neither i want to use area (blobmeasurments.area) for doing this. If you know some kind of algorithm for doing the above mention work then kindly share it will be very helpfull for me thanx. (please don't mention the built in matlab functions, as i need complete method for doing this, so plz give/suggest me an algorithm that i can apply for doing this).

サインインしてコメントする。

回答 (2 件)

darova
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
  7 件のコメント
QuestionsAccount
QuestionsAccount 2020 年 4 月 2 日
i already used the graythersh in preprocessing steps now the problem which i m facing was abave that i mentioned i know Kmeans algo but using that i m only able to make clusters like connected components but how can i seprate big and small clusters without any thershold or fix value?
darova
darova 2020 年 4 月 2 日
have no idea :(

サインインしてコメントする。


Image Analyst
Image Analyst 2020 年 6 月 18 日
Try bwareafilt().

カテゴリ

Help Center および File ExchangeCall Python from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by