CMVision
Purpose: Realtime color segmentation (C++, Linux)
Home: http://www-2.cs.cmu.edu/~jbruce/cmvision/
Library for realtime (autor reached 320×240 @ 30fps on a 350MHz machine)
color classification and segmentation.
Consists of several steps:
- The image is transformed to the YUV (Brightness, Chromacity) color space where object color can be described as a cone with a wide span in the brightness dimension.
- The specified color thresholds are applied resulting to a 32-bit image where each bit denotes color class membership:
- The cone is described as an intersection of three subspaces described by three binary tables.
- If 32 such binary tables are stored in different bits of one
int
table, one can track at most 32 different colors at a time using just 2 binary and
operators on every pixel.
- Pixels of one class are RLE encoded and joined to segments using a union find with path compression algorithm.
- Segments may be joined using a density-based merging (close segments of the same color become one).
- Some statistics may be performed on the resulting segments (area, centroid, average color etc.).
The algorithm is described in this paper.