Connected Component Algorithms

Rosenfeld 0

Search and Propagate

  1. Scan the image until a 1 is found and change it to the first unused label v.
  2. Repeatedly propagate v's into neighboring 1's until there are no more neighbors.
  3. Resume the scan for another 1 and then repeat using the next unused label.

Rosenfeld 1

Run Equivalencing
  1. On the first row give each run a distinct label.
  2. On subsequent rows, compare the relative positions of runs with those in the previous row. If a run is not adjacent to a run in the previous row, it gets a new label. If a run is adjacent to just one run in the previous row, the run gets its label. If a run is adjacent to two or more runs with different labels, give the run the label of the lowest adjacent run and record the label equivalences.
  3. Determine the equivalence classes when all runs are labeled.
  4. Relabel the runs with their equivalence class labels.

Rosenfeld 2

Pixel Equivalencing, Rosenfeld and Pfalz (JACM (13), 1966, 471-494)
  1. Scan the image until a 1 is found.
  2. If the 1 pixel is not adjacent to any labeled pixels in the current or preceding row, give it the next available label.
  3. If the 1 pixel is adjacent to pixels with a single label, give it that label.
  4. If the 1 pixel is adjacent to several previously labeled pixels with different labels, give it the smallest label and record the label equivalences.
  5. Determine the equivalence classes when all pixels are labeled.
  6. Relabel the pixels with their equivalence class labels.

Haralick A

Iterative (Haralick and Shapiro Section 2.3)
  1. Label all elements of S with a unique label in scan order.
  2. Alternate top-down L-R scans with bottom-up R-L scans. Replace each pixel label by the minimum of its neighbor labels.
  3. Repeat above until no more pixel labels change.

Haralick B

Local Equivalence Table
  1. Scan the rows from top to bottom, left to right.
  2. For the current row, if an element of S is found that has no labeled neighbors, give it the next available label. If a pixel has labeled neighbors, assign it the minimum label of adjacent pixels and record the label equivalences.
  3. For the current row, determine the equivalence classes after the row is scanned and assign each equivalence class the lowest label it contains.
  4. Relabel the labeled pixels on the current row with their equivalence class labels, and then repeat for the next row.
  5. Scan the rows from bottom to top, left to right.
  6. For the current row, if a pixel has a label that differs from any of its neighbors, record the label equivalences.
  7. For the current row, determine the equivalence classes afer the row is scanned and assign each equivalence class the lowest label it contains.
  8. Relabel the labeled pixels on the current row with their equivalence class labels, and then repeat for the next row.