MATLAB: Remove the white object using filter2

filter2

how to remove the white object of grayscale image using filter2

Best Answer

Define "remove." Do you want to extract the bounding box into its own image? If so, see my BlobsDemo http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862 Or do you want to set all pixels values of 255 to 0 or nan?