Keywords: front-page

# Labeling

[Laboratory]

Labeling of a binary image is the operation of assigning a unique value to pixels belonging to the same connected region. Depending on the definition of a "connected region", different results can be obtained. Two widely used square grid topologies are shown below.

Rectangular grids for connectivity study of pixel P

Recommended use of these grids are:

- 4 neighborhood for foreground pixels and 8 neighborhood for background pixels
- 8 neighborhood for foreground pixels and 4 neighborhood for background pixels

In this experiment a small binary image is used. Shown below is our binary image zoomed by a factor of 4.

Binary image zoomed by a factor of 4

Labeling using the 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.

a)8-neighborhood; b)4-neighborhood
a) | b)

- Lab: Labeling