how to find the largest region in binary image and replace all other region with black?

11 views (last 30 days)
I have a binary image (attached as 'randomm.jpg') that consists of several shapes.
How to extract the shape with most pixels (white) and replace other figures with black?
Thank you!

Accepted Answer

Walter Roberson
Walter Roberson on 6 May 2017

More Answers (0)

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!