LABELLARGEST keep the largest N isolated regions in the image;
Author: Sheng Yue (firstname.lastname@example.org, email@example.com)
Imperial College London
Image Processing Toolbox required.
[L CC] = LabelLargest(IM,pieces,conn);
IM is the input image.
pieces is the regions you want to keep. Default value is 1;
conn is the connectivity defined same as matlab.
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.