![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176939/image.jpeg)
Obtaining the largest object in an image
4 次查看(过去 30 天)
显示 更早的评论
Say that I have an image with a big object, and then small objects spread apart.
How can I retrieve only that big object?
I think we can use "bwconncomp"?
But, how exactly can we do that here?
Thanks.
0 个评论
采纳的回答
Image Analyst
2014-11-28
I thought I've given this to you before. Oh well, maybe it was someone else. I've posted it lots and lots of times. Here it is again. The function inside the attached demo will let you extract the N largest or smallest blobs in a binary image.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176939/image.jpeg)
2 个评论
Image Analyst
2014-12-1
Yes. But you might want to multiply it by 255 first so you can see it without scaling, like if you want a nice thumbnail image in your operating system
imwrite(uint8(255*binaryImage), filename);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!