how to find the length and width of connected components

3 visualizaciones (últimos 30 días)
QuestionsAccount
QuestionsAccount el 25 de Mzo. de 2020
Respondida: Image Analyst el 18 de Jun. de 2020
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 comentarios
darova
darova el 25 de Mzo. de 2020
Can you show something? Hard to suggest something without a picture
QuestionsAccount
QuestionsAccount el 26 de Mzo. de 2020
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).

Iniciar sesión para comentar.

Respuestas (2)

darova
darova el 26 de Mzo. de 2020
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 comentarios
QuestionsAccount
QuestionsAccount el 2 de Abr. de 2020
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 el 2 de Abr. de 2020
have no idea :(

Iniciar sesión para comentar.


Image Analyst
Image Analyst el 18 de Jun. de 2020
Try bwareafilt().

Categorías

Más información sobre Call Python from MATLAB en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by