MATLAB: How to find the islands of a binary matrix

boundryislandmatrix

If you have a 2D binary matrix, how would you find the islands of ones?
Thanks

Best Answer

regionprops() and request whichever identification mode you prefer, such as BoundingBox or 'PixelIdxList' or 'PixelList' or 'SubarrayIdx'