What’s the most efficient way to isolate a connected

Technical Source
2 min readFeb 24, 2022

What’s the most efficient way to isolate a connected region in a binary image given a point contained within that region?

I have a series of binary images with various numbers of 8-connected regions within them. Given a single coordinate lying within one of those regions, what is the most efficient way to generate a binary image that isolates only the connected region containing that point?

For example, given the top image and a single coordinate somewhere in the central region, how can I most efficiently produce the bottom image?

I’m currently doing this using progressive imdilate operations with a 3x3 square SE until I find a stable image. This method seems very inefficient, though, and since I’m doing this kind of operation millions of times within my program, I want to know if I can be doing much better. Any advice from the image processing experts out there?

NOTE:-

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

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.

SEE COMPLETE ANSWER CLICK THE LINK

--

--

Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.