Integral image.

Namespace:  AForge.Imaging
Assembly:  AForge.Imaging (in AForge.Imaging.dll) Version: 2.2.5.0 (2.2.5.0)

Syntax

C#
public class IntegralImage

Remarks

The class implements integral image concept, which is described by Viola and Jones in: P. Viola and M. J. Jones, "Robust real-time face detection", Int. Journal of Computer Vision 57(2), pp. 137–154, 2004.

"An integral image I of an input image G is defined as the image in which the intensity at a pixel position is equal to the sum of the intensities of all the pixels above and to the left of that position in the original image."

The intensity at position (x, y) can be written as:

CopyC#
          x    y
I(x,y) = SUM( SUM( G(i,j) ) )
         i=0  j=0

Note:The class uses 32-bit integers to represent integral image.

Note:The class processes only grayscale (8 bpp indexed) images.

Note:This class contains two versions of each method: safe and unsafe. Safe methods do checks of provided coordinates and ensure that these coordinates belong to the image, what makes these methods slower. Unsafe methods do not do coordinates' checks and rely that these coordinates belong to the image, what makes these methods faster.

Sample usage:

CopyC#
// create integral image
IntegralImage im = IntegralImage.FromBitmap( image );
// get pixels' mean value in the specified rectangle
float mean = im.GetRectangleMean( 10, 10, 20, 30 )

Inheritance Hierarchy

System..::.Object
  AForge.Imaging..::.IntegralImage

See Also