Census Transform

Figure 7.4: Computing the Census transform in the neighborhood of a point: the neighborhood is binarized relative to the point's value, and the resulting thresholding is used to construct a binary string.
Image fig_census

The Census transform (Census-Transformation) (ZW94) represents an image region around a point as a bit string. For each image pixel, the surrounding region, whose shape and size are fixed, is scanned in a prescribed order, and each pixel in the region is compared with the center pixel. If a pixel has a higher gray-level intensity, it is assigned a 1; otherwise, it is assigned a 0:

\begin{displaymath}
\tau(\mathbf{x}) = \left\{ \begin{array}{ll}
1 & I(\mathbf{x}) < I(0) \\
0 & \text{otherwise} \\
\end{array}\right.
\end{displaymath} (7.3)

Scanning the region in order produces a binary string. Figure 7.4 shows an example of the Census transform applied to a $5 \times 5$ region: it produces a binary string of 25-1 bits (the central pixel does not affect the result).

The Census transform is useful for comparisons: rather than comparing two arbitrary points using SAD over their surrounding regions, the points are compared using the Hamming distance between their respective Census-transformed binary strings.

Because it constructs a binary string using differences in gray level, the Census transform is fairly invariant to brightness.

Paolo medici
2026-10-06