Summed-area table explained
A summed-area table is a data structure and algorithm for quickly and efficiently generating the sum of values in a rectangular subset of a grid. In the image processing domain, it is also known as an integral image. It was introduced to computer graphics in 1984 by Frank Crow for use with mipmaps. In computer vision it was popularized by Lewis[1] and then given the name "integral image" and prominently used within the Viola–Jones object detection framework 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 functions.[2]
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:[3] [4] 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:[5] (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.[6] 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, for example, the images have dimension
or
, when using
voxels or voxels with a time-stamp.
This method has been extended to high-order integral image as in the work of Phan et al.[7] 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 or standard deviation 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.
[8] is that of integer overflow occurring for the higher order integral images in case 32-bit integers are used.
Implementation considerations
The data type for the sums may need to be different and larger than the data type used for the original values, in order to accommodate the largest expected sum without overflow. For floating-point data, error can be reduced using compensated summation.
See also
References
- Lewis. J.P.. Fast template matching . Proc. Vision Interface. 1995. 120–123.
- Amir . Finkelstein . neeratsharma . Double Integrals By Summing Values Of Cumulative Distribution Function . Wolfram Demonstration Project . 2010 .
- Franklin . Crow . Summed-area tables for texture mapping . SIGGRAPH '84: Proceedings of the 11th annual conference on Computer graphics and interactive techniques . 207–212 . 1984 . 10.1145/800031.808600 .
- Paul . Viola . Jones, Michael . Robust Real-time Object Detection . International Journal of Computer Vision . 2002 .
- Web site: BADGERATI . Computer Vision – The Integral Image . computersciencesource.wordpress.com . 2017-02-13. 2010-09-03.
- Tapia. Ernesto . A note on the computation of high-dimensional integral images . Pattern Recognition Letters . January 2011 . 32 . 2 . 197–201 . 10.1016/j.patrec.2010.10.007. 2011PaReL..32..197T .
- Book: Phan. Thien. Sohoni. Sohum. Larson. Eric C.. Chandler. Damon M.. 2012 IEEE Southwest Symposium on Image Analysis and Interpretation . Performance-analysis-based acceleration of image quality assessment . 22 April 2012. 81–84. 10.1109/SSIAI.2012.6202458. 11244/25701 . 978-1-4673-1830-3. 10.1.1.666.4791. 12472935 .
- Shafait. Faisal. Keysers. Daniel. M. Breuel. Thomas. Berrin A. . Kathrin . Yanikoglu . Berkner . Efficient implementation of local adaptive thresholding techniques using integral images. Electronic Imaging. 6815. 681510–681510–6. January 2008. 10.1117/12.767755. Document Recognition and Retrieval XV . 2008SPIE.6815E..10S . 10.1.1.109.2748. 9284084 .
External links
Lecture videos