필터 지우기
필터 지우기

Hi. Anyone has an idea how to find the area at red region area?

조회 수: 2 (최근 30일)

채택된 답변

Image Analyst
Image Analyst 2022년 1월 6일
% Take the 3 largest blobs
mask = bwareafilt(mask, 3);
% Assume we want the middle one. Label the blobs 1, 2, and 3.
[labeledImage, numBlobs] = bwlabel(mask);
% Extract the middle one, which has label 2:
middleBlob = ismember(labeledImage, 2);
imshow(middleBlob); % Display it.
  댓글 수: 3
Image Analyst
Image Analyst 2022년 1월 6일
Thanks for adding that @DGM - I forgot that.
There is also a function bwarea() you can use. It weights the area according to the shape of the boundary locally so it gives a different area than summing the pixels or using nnz(). I don't usually use bwarea() though. I use nnz(). I've been told it's slightly faster than using sum().
Thanks for accepting the answer @Iszuzuldin amirull bin mohd janudin 🙂

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by