There is a morphological function specially made for this . It's call imreconstruct(). You pass in a binary image, and a marker image. The marker image has at least one pixel for all the blobs you want to extract/keep out of your binary image. For example the marker image could be all false/0 except true/1 at the one single dot that you mentioned. Any blob in yoru binary image that has a pixel in it from the marker image will be kept (extracted). See this example:
markerImage = false(size(binaryImage)); % Initialize to all false. markerImage(row, column) = true; % Set one pixel to be true. % Now extract only the blob that has the dot in it. keeperBlobs = imreconstruct(binaryImage, markerImage);
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Explore similar technical troubleshooting questions and verified MATLAB solutions: