Obtaining the largest object in an image

4 ビュー (過去 30 日間)
med-sweng
med-sweng 2014 年 11 月 28 日
コメント済み: Image Analyst 2014 年 12 月 1 日
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.

採用された回答

Image Analyst
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.
  2 件のコメント
med-sweng
med-sweng 2014 年 12 月 1 日
編集済み: med-sweng 2014 年 12 月 1 日
Thanks for the nice answer. For the final result, if I want to imwrite it, would it be doing the following?
imwrite(binaryImage, 'FinalResult.png');
after:
binaryImage = biggestBlob > 0;
Image Analyst
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 ExchangeComputer Vision with Simulink についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by