Let be a generic grayscale image. The value of pixel
of the integral image
represents the sum of the values of every pixel of the source image contained within the rectangle
:
| (1.99) |
The computational trick of using the integral image allows optimization of various algorithms presented in this book, particularly SURF (section 5.4) and the extraction of Haar features (section 6.1).
Thanks to the integral image, it is possible, at a constant computational cost of 4 sums, to obtain the summation of any rectangular sub-region of the image :
| (1.100) |
The value obtained in this way represents the sum of the elements of the original image within the rectangle (extremes included).
In addition to being able to quickly calculate the summation of any subset of the image, it is also possible to easily obtain convolutions with kernels of a particular shape in a very straightforward manner, while maintaining performance that is invariant with respect to the size of the filter. Examples of convolution masks can be seen in section 6.1.
Paolo medici