Connected Component Algorithms
Rosenfeld 0
Search and Propagate
- Scan the image until a 1 is found and change it to the first unused label v.
- Repeatedly propagate v's into neighboring 1's until there are no more neighbors.
- Resume the scan for another 1 and then repeat using the next unused label.
Rosenfeld 1
Run Equivalencing
- On the first row give each run a distinct label.
- 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.
- Determine the equivalence classes when all runs are labeled.
- Relabel the runs with their equivalence class labels.
Rosenfeld 2
Pixel Equivalencing, Rosenfeld and Pfalz (JACM (13), 1966, 471-494)
- Scan the image until a 1 is found.
- If the 1 pixel is not adjacent to any labeled pixels in the current or
preceding row, give it the next available label.
- If the 1 pixel is adjacent to pixels with a single label, give it that label.
- If the 1 pixel is adjacent to several previously labeled pixels with different
labels, give it the smallest label and record the label equivalences.
- Determine the equivalence classes when all pixels are labeled.
- Relabel the pixels with their equivalence class labels.
Haralick A
Iterative (Haralick and Shapiro Section 2.3)
- Label all elements of S with a unique label in scan order.
- Alternate top-down L-R scans with bottom-up R-L scans. Replace each pixel
label by the minimum of its neighbor labels.
- Repeat above until no more pixel labels change.
Haralick B
Local Equivalence Table
- Scan the rows from top to bottom, left to right.
- 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.
- For the current row, determine the equivalence classes after the row is scanned
and assign each equivalence class the lowest label it contains.
- Relabel the labeled pixels on the current row with their equivalence class labels,
and then repeat for the next row.
- Scan the rows from bottom to top, left to right.
- For the current row, if a pixel has a label that differs from any of its neighbors,
record the label equivalences.
- For the current row, determine the equivalence classes afer the row is scanned
and assign each equivalence class the lowest label it contains.
- Relabel the labeled pixels on the current row with their equivalence class labels,
and then repeat for the next row.