how to find the length and width of connected components

조회 수: 1 (최근 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 CenterFile Exchange에서 3-D Volumetric Image Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by