Look at a satellite photograph, a handwritten digit, or an X-ray: underneath all the color lies a binary decision â foreground or background. Threshold the image and you get a grid of 1s (object pixels) and 0s (empty space).
Now the natural question is: how many separate objects are there? The blob of pixels in the top-left corner is clearly different from the one in the bottom-right â but a computer sees only a flat array of bits. Connected-components labeling (CCL) is the classical answer: scan the grid and stamp every distinct group of foreground pixels with a unique integer label.
Two pixels belong to the same component if you can walk from one to the other through a chain of touching foreground pixels. "Touching" most commonly means the 4 orthogonal neighbors (up, down, left, right), though 8-connectivity (diagonals included) is also used. The task is solved â and solved in time, where is the number of pixels â by algorithms invented in the 1960s and still at the heart of modern computer vision pipelines.
Comments
Loading comments...