필터 지우기
필터 지우기

Filling in cell area and counting cells

조회 수: 8 (최근 30일)
Kate Heinzman
Kate Heinzman 2020년 2월 12일
답변: Image Analyst 2020년 2월 12일
binarycells.jpg
What code could be used to fill in these arbitrarily shaped cells that also gets ride of the smaller cells that look like noise and then count the number of cells?

답변 (1개)

Image Analyst
Image Analyst 2020년 2월 12일
You can use imfill() and bwareafilt() or bwareaopen():
mask = imfill(mask, 'holes'); % Fill holes.
mask = bwareafilt(mask, [30, inf]); % Extract only blobs 30 pixels or larger.
[labeledImage, numberOfCells] = bwlabel(mask); % Count blobs.

Community Treasure Hunt

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

Start Hunting!

Translated by