The census transform (CT) is an image operator that associates to each
pixel
In digital imaging, a pixel (abbreviated px), pel, or picture element is the smallest addressable element in a Raster graphics, raster image, or the smallest addressable element in a dot matrix display device. In most digital display devices, p ...
of a
grayscale
In digital photography, computer-generated imagery, and colorimetry, a greyscale (more common in Commonwealth English) or grayscale (more common in American English) image is one in which the value of each pixel is a single sample (signal), s ...
image a binary string, encoding whether the pixel has smaller intensity than each of its neighbours, one for each bit. It is a non-parametric transform that depends only on relative ordering of intensities, and not on the actual values of intensity, making it invariant with respect to
monotonic
In mathematics, a monotonic function (or monotone function) is a function between ordered sets that preserves or reverses the given order. This concept first arose in calculus, and was later generalized to the more abstract setting of ord ...
variations of
illumination, and it behaves well in presence of multimodal distributions of intensity, e.g. along object boundaries. It has applications in
computer vision
Computer vision tasks include methods for image sensor, acquiring, Image processing, processing, Image analysis, analyzing, and understanding digital images, and extraction of high-dimensional data from the real world in order to produce numerical ...
, and it is commonly used in visual
correspondence problem
The correspondence problem refers to the problem of ascertaining which parts of one image correspond to which parts of another image, where differences are due to movement of the camera, the elapse of time, and/or movement of objects in the photo ...
s such as
optical flow
Optical flow or optic flow is the pattern of apparent motion of objects, surfaces, and edges in a visual scene caused by the relative motion between an observer and a scene. Optical flow can also be defined as the distribution of apparent velocit ...
calculation and
disparity
Disparity and disparities may refer to:
in healthcare:
* Health disparities
in finance:
* Income disparity between females and males.
** Male–female income disparity in the United States
** Income gender gap
* Economic inequality
* Income in ...
estimation.
The census transform is related to the rank transform, that associates to each pixel the number of neighbouring pixels with higher intensity than the pixel itself, and was introduced in the same paper.
[Zabih and Woodfill (1994), p. 153.]
Algorithm
The most common version of the census transform uses a 3x3 window, comparing each pixel
with all its 8-connected neighbours with a function
defined as
:
The results of these comparisons are concatenated and the value of the transform is an 8-bit value, that can be easily encoded in a
byte
The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable un ...
.
:
Similarity between images is determined by comparing the values of the census transform for corresponding pixels, using the
Hamming distance
In information theory, the Hamming distance between two String (computer science), strings or vectors of equal length is the number of positions at which the corresponding symbols are different. In other words, it measures the minimum number ...
.
Several variations of the algorithm exist, using different size of the window, order of the neighbours in the pattern (row-wise, clockwise, counterclockwise), comparison operator (greater, greater or equal, lesser, lesser or equal).
An extension of the algorithm uses a three-way comparison that allows to represent similar pixels, whose intensity difference is smaller than a tolerance parameter
, defined as
[Stein (2004).]
:
whose result can be encoded with two bits for each neighbour, thus doubling the size of the pattern for each pixel.
:
See also
*
Local binary patterns
References
*
*
* {{cite conference, title=Non-parametric local transforms for computing visual correspondence, book-title=European conference on computer vision, year=1994, last1=Zabih, first1=Ramin, last2=Woodfill, first2=John, pages=151–158, url=http://www.cs.duke.edu/courses/spring06/cps296.1/handouts/Zabih%20Woodfill%201994.pdf
Feature detection (computer vision)