0% found this document useful (0 votes)
20 views

Connected Components: P S Q S P Q S

Connected components in image analysis refers to sets of pixels that are connected to each other, where two pixels are connected if there is a path between them consisting only of pixels in the set. Component labeling algorithms identify all connected components in an image and assign a unique label to pixels within each component, using either a recursive or sequential approach. The boundary of a connected component is the set of pixels on the edge that are adjacent to background pixels, and algorithms can track these boundary pixels in a specified order like clockwise.

Uploaded by

phanduy1310
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Connected Components: P S Q S P Q S

Connected components in image analysis refers to sets of pixels that are connected to each other, where two pixels are connected if there is a path between them consisting only of pixels in the set. Component labeling algorithms identify all connected components in an image and assign a unique label to pixels within each component, using either a recursive or sequential approach. The boundary of a connected component is the set of pixels on the edge that are adjacent to background pixels, and algorithms can track these boundary pixels in a specified order like clockwise.

Uploaded by

phanduy1310
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Connected Components

(R. Jain et al., section 2.5)

- A set of pixels in which each pixel is connected to all other pixels is called a connected component.
Definition: A pixel p S is said to be connected to q S if there is a path from p
to q consisting entirely of pixels of S .
- A component labeling algorithm finds all connected components in an image and
assigns a unique label to all points in the same component.

Recursive algorithm
- Let is assume that region pixels have the value 0 (black) and that background pixels have the value 255 (white).
(1) Scan the image to find an unlabeled 0 (pixel and assign it a new label L.
(2) Recursively assign a label L to all of its 0 neighbors.
(3) Stop if there are no more unlabeled 0 pixels.
(4) Go to step 1.

-2-

Sequential algorithm
- The sequential algorithm usually requires two passes over the image.
- It works with only two rows of an image at a time.
(1) Scan the image left to right, top to bottom.
(2) If the pixel is 0, then:
(2.1) If only one of its upper and left neighbors has a label, then copy the label.
(2.2) If both have the same label, then copy the label.
(2.3) If both have different labels, then copy the uppers label and enter the
labels in the equivalence table as equivalent labels.
(2.4) Otherwise assign a new label to this pixel and enter this label in the equivalence table.
(3) If there are no more pixels to consider, then go to step 2.
(4) Find the lowest label for each equivalent set in the equivalence table.
(5) Scan the image. Replace each label by the lowest label in its equivalent set.

-3-

Region boundary
- The boundary of a connected component S is the set of pixels of S that are adjacent to background.
- In most applications, one wants to track pixels on the boundary of a region in a
particular order (e.g., clockwise).
(2.1) Set c = s
(2.2) Let b be the west 4-neighbor of s (background pixel)
(3) Consider the eight 8-neighbors of c , starting with b in clockwise order:
n1 , ..., n8
(4) Choose the first ni such that ni S
(4.1) Set c = ni
(4.2) Set b= ni1
(5) Repeat steps 3 and 4 until c = s

You might also like