integralimage
An integral image, also known as a summed-area table, is a data structure used in image processing to efficiently calculate the sum of pixel values within a rectangular region of an image. It is constructed by pre-calculating a table where each entry at a given coordinate (x, y) stores the sum of all pixel values in the rectangular region from the origin (0,0) up to and including (x, y).
The integral image is built with a single pass over the original image. For a pixel at
Once the integral image is computed, the sum of pixel values within any arbitrary rectangular region defined
This constant-time query capability makes integral images highly beneficial for algorithms that require repeated summation of