Filling in cell area and counting cells
8 ビュー (過去 30 日間)
古いコメントを表示
![binarycells.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/271277/binarycells.jpeg)
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?
0 件のコメント
回答 (1 件)
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.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!