A summed-area table is a
data structure
In computer science, a data structure is a data organization, management, and storage format that is usually chosen for efficient access to data. More precisely, a data structure is a collection of data values, the relationships among them, a ...
and
algorithm
In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific Computational problem, problems or to perform a computation. Algorithms are used as specificat ...
for quickly and efficiently generating the sum of values in a rectangular subset of a grid. In the
image processing
An image is a visual representation of something. It can be two-dimensional, three-dimensional, or somehow otherwise feed into the visual system to convey information. An image can be an artifact, such as a photograph or other two-dimensiona ...
domain, it is also known as an integral image. It was introduced to
computer graphics
Computer graphics deals with generating images with the aid of computers. Today, computer graphics is a core technology in digital photography, film, video games, cell phone and computer displays, and many specialized applications. A great de ...
in 1984 by
Frank Crow for use with
mipmap
In computer graphics, mipmaps (also MIP maps) or pyramids are pre-calculated, optimized sequences of images, each of which is a progressively lower resolution representation of the previous. The height and width of each image, or level, in the m ...
s. In
computer vision
Computer vision is an interdisciplinary scientific field that deals with how computers can gain high-level understanding from digital images or videos. From the perspective of engineering, it seeks to understand and automate tasks that the hum ...
it was popularized by Lewis and then given the name "integral image" and prominently used within the
Viola–Jones object detection framework
The Viola–Jones object detection framework is a machine learning object detection framework proposed in 2001 by Paul Viola and Michael Jones. It was motivated primarily by the problem of face detection, although it can be adapted to the detectio ...
in 2001. Historically, this principle is very well known in the study of multi-dimensional probability distribution functions, namely in computing 2D (or ND) probabilities (area under the probability distribution) from the respective
cumulative distribution function
In probability theory and statistics, the cumulative distribution function (CDF) of a real-valued random variable X, or just distribution function of X, evaluated at x, is the probability that X will take a value less than or equal to x.
Ev ...
s.
[
]
The algorithm
As the name suggests, the value at any point (''x'', ''y'') in the summed-area table is the sum of all the pixels above and to the left of (''x'', ''y''), inclusive:
where
is the value of the pixel at (''x'',''y'').
The summed-area table can be computed efficiently in a single pass over the image, as the value in the summed-area table at (''x'', ''y'') is just:
(Noted that the summed matrix is calculated from top left corner)
Once the summed-area table has been computed, evaluating the sum of intensities over any rectangular area requires exactly four array references regardless of the area size. That is, the notation in the figure at right, having , , and , the sum of over the rectangle spanned by ''A'', ''B'', ''C,'' and ''D'' is:
Extensions
This method is naturally extended to continuous domains.
The method can be also extended to high-dimensional images. If the corners of the rectangle are
with
in
, then the sum of image values contained in the rectangle are computed with the formula
where
is the integral image at
and
the image dimension. The notation
correspond in the example to
,
,
,
and
. In
neuroimaging
Neuroimaging is the use of quantitative (computational) techniques to study the structure and function of the central nervous system, developed as an objective way of scientifically studying the healthy human brain in a non-invasive manner. Incre ...
, for example, the images have dimension
or
, when using
voxel
In 3D computer graphics, a voxel represents a value on a regular grid in three-dimensional space. As with pixels in a 2D bitmap, voxels themselves do not typically have their position (i.e. coordinates) explicitly encoded with their values. Ins ...
s or voxels with a time-stamp.
This method has been extended to high-order integral image as in the work of Phan et al.
who provided two, three, or four integral images for quickly and efficiently calculating the standard deviation (variance), skewness, and kurtosis of local block in the image. This is detailed below:
To compute
variance
In probability theory and statistics, variance is the expectation of the squared deviation of a random variable from its population mean or sample mean. Variance is a measure of dispersion, meaning it is a measure of how far a set of numbers ...
or
standard deviation
In statistics, the standard deviation is a measure of the amount of variation or dispersion of a set of values. A low standard deviation indicates that the values tend to be close to the mean (also called the expected value) of the set, while ...
of a block, we need two integral images:
The variance is given by:
Let
and
denote the summations of block
of
and
, respectively.
and
are computed quickly by integral image. Now, we manipulate the variance equation as:
Where
and
.
Similar to the estimation of the mean (
) and variance (
), which requires the integral images of the first and second power of the image respectively (i.e.
); manipulations similar to the ones mentioned above can be made to the third and fourth powers of the images (i.e.
.) for obtaining the skewness and kurtosis.
But one important implementation detail that must be kept in mind for the above methods, as mentioned by F Shafait et al.
[{{cite journal, last1=Shafait, first1=Faisal, last2=Keysers, first2=Daniel, last3=M. Breuel, first3=Thomas, title=Efficient implementation of local adaptive thresholding techniques using integral images, journal=Electronic Imaging, volume=6815, pages=681510–681510–6, date=January 2008, doi=10.1117/12.767755, url=http://www.csse.uwa.edu.au/~shafait/papers/Shafait-efficient-binarization-SPIE08.pdf, series=Document Recognition and Retrieval XV , citeseerx=10.1.1.109.2748] is that of integer overflow occurring for the higher order integral images in case 32-bit integers are used.
See also
*
Prefix sum In computer science, the prefix sum, cumulative sum, inclusive scan, or simply scan of a sequence of numbers is a second sequence of numbers , the sums of prefixes ( running totals) of the input sequence:
:
:
:
:...
For instance, the prefix sums ...
References
External links
Summed table implementation in object detectionh2>
Lecture videos
An introduction to the theory behind the integral image algorithmA demonstration to a continuous version of the integral image algorithm, from the Wolfram Demonstrations Project
Digital geometry
Computer graphics data structures