skimage2.transform.integral_image#

skimage2.transform.integral_image(image, *, dtype=None)[source]#

Integral image / summed area table.

The integral image contains the sum of all elements above and to the left of it, i.e.:

\[S[m, n] = \sum_{i \leq m} \sum_{j \leq n} X[i, j]\]
Parameters:
imagendarray

Input image.

dtypedtype-like, optional

Data type (NumPy dtype) to be used for calculation, and for output array S. If None, defaults to the more precise of either float64 or image’s dtype.

Returns:
Sndarray

Integral image/summed area table of same shape as input image.

Notes

For better accuracy and to avoid potential overflow, the data type of the output may differ from the input’s when the default dtype of None is used. For inputs with integer dtype, the behavior matches that for numpy.cumsum(). Floating point inputs will be promoted to at least double precision. The user can set dtype to override this behavior.

References

[1]

F.C. Crow, “Summed-area tables for texture mapping,” ACM SIGGRAPH Computer Graphics, vol. 18, 1984, pp. 207-212.