how to crop bigger size of blob in binary image and count its pixel .
4 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/200615/image.jpeg)
采纳的回答
Image Analyst
2019-1-12
Not sure what you mean. You can use imcrop() if you want. You can also find the bounding boxes if you want:
props = regionprops(binaryImage, 'BoundingBox');
To crop out each one individually, do this
for k = 1 : length(props)
thisBB = props(k).BoundingBox;
subImage = imcrop(binaryImage, thisBB);
figure;
imshow(subImage);
end
This is done in my Image Processing Tutorial
![screenshot.jpg](https://www.mathworks.com/matlabcentral/mlc-downloads/downloads/submissions/25157/versions/7/screenshot.jpg)
3 个评论
Image Analyst
2019-1-13
Use bwareafilt()
biggestBlob = bwareafilt(binaryImage, 1); % Extract largest blob ONLY
areaOfBiggestBlob = nnz(biggestBlob) % Get its area
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!