Labeling of a binary image is the operation that assigns a unique value to pixels belonging to the same connected region. Depending on the definition of the connectivity, different results can be obtained. Two widely used connectivities definitions are:
In this experiment a small binary image is used. Shown below is our binary image zoomed by a factor of 5.
Binary image zoomed by a factor of 5
Labeling using a 8 neighborhood results in 10 connected regions plus the background. Using a 4 neighborhood results in 86 connected regions plus the background. Colors are used to better visualize the different connected regions.
In this other example, we show a binary image of a muscle tissue. The most important applications of this operator are counting the connected components of an image and being a pre-process operator for individual cell analysis.
--->