IntegralGradient is used for calculating rectangular image gradients rapidly More...

`#include <IntegralImage.h>`

## Public Member Functions

void GetAveGradient (CvRect &rect, double *dirx, double *diry)
Calculate the average gradient for the given rectangular area in the image. More...

void GetGradient (CvRect &rect, double *dirx, double *diry, int *count=0)
Calculate the gradient for the given rectangular area in the image. More...

void Update (IplImage *gray)
Update intermediate images for calculating the gradients to the given image. More...

## Protected Member Functions

void CalculatePointNormals (IplImage *gray)

## Protected Attributes

IntegralImage integx

IntegralImage integy

IplImage * normalx

IplImage * normaly

## Detailed Description

IntegralGradient is used for calculating rectangular image gradients rapidly

We calculate IntegralImage:s based on point normals for 4-pixel intersections (see Donahue1992). Using the integral images it is possible to make fast gradient calculations to any image rectangle. This approach is useful when we need to calculate many gradient rectangles for the same image.

Examples:
SampleIntegralImage.cpp.

Definition at line 136 of file IntegralImage.h.

## Constructor & Destructor Documentation

Definition at line 168 of file IntegralImage.cpp.

Definition at line 172 of file IntegralImage.cpp.

## Member Function Documentation

 void alvar::IntegralGradient::CalculatePointNormals ( IplImage * gray )
protected

Definition at line 128 of file IntegralImage.cpp.

 void alvar::IntegralGradient::GetAveGradient ( CvRect & rect, double * dirx, double * diry )

Calculate the average gradient for the given rectangular area in the image.

Parameters
 dirx Method fills in the x-component of the gradient here diry Method fills in the y-component of the gradient here
Examples:
SampleIntegralImage.cpp.

Definition at line 187 of file IntegralImage.cpp.

 void alvar::IntegralGradient::GetGradient ( CvRect & rect, double * dirx, double * diry, int * count = `0` )

Calculate the gradient for the given rectangular area in the image.

Parameters
 dirx Method fills in the x-component of the gradient here diry Method fills in the y-component of the gradient here count If this parameter is not 0 it is filled with number of pixels in the rectangle.

Definition at line 181 of file IntegralImage.cpp.

 void alvar::IntegralGradient::Update ( IplImage * gray )

Update intermediate images for calculating the gradients to the given image.

Parameters
 gray The original grayscale image we want analyze
Examples:
SampleIntegralImage.cpp.

Definition at line 176 of file IntegralImage.cpp.

## Member Data Documentation

protected

Definition at line 140 of file IntegralImage.h.

protected

Definition at line 141 of file IntegralImage.h.

protected

Definition at line 138 of file IntegralImage.h.