from BW Noise Reduction by Javad Razjouyan
Reduce noise in Binary Image by counting number of conected pixels

All files for BW Noise Reduction
/bwNoiseReduction.m

Contact us at files@mathworks.com