Filling in cell area and counting cells

3 次查看(过去 30 天)
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.

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by