MATLAB: Less connected pixels from gray scale image

connected pixelsImage Processing Toolbox

i have a gray scale image that contains a box of white and a text. i need to convert only text because those pixels are less connected than box pixels. if i find an of the command for connected pixels such as bwareaopen (bw, 8) or 4 pixel connection i can even get box pixels as well but i only want to label those pixels that has less connection. need help please.

Best Answer

Label the more connected pixels. The pixels that did not get labeled are then the less-connected pixels.
Related Question