My Project
Public Member Functions | List of all members
IntegralImage Class Reference

IntegralImage is used for calculating rectangular image sums and averages rapidly More...

#include <IntegralImage.h>

Public Member Functions

void Update (cv::Mat &gray)
 Update integral image for the given image. More...
 
double GetSum (cv::Rect &rect, int *count=0)
 Calculate the sum for the given rectangular area in the image. More...
 
double GetAve (cv::Rect &rect)
 Calculate the average for the given rectangular area in the image.
 
void GetSubimage (const cv::Rect &rect, cv::Mat &sub)
 Get a sub-image using integral image representation. More...
 

Detailed Description

IntegralImage is used for calculating rectangular image sums and averages rapidly

The integral images are based on making intermediate representation of the image. Using this approach the sum/average of rectangular area can be calculated using only four references for the integral image. The integral images are commonly used with HAAR-like features.

The IntegralImage should be used when we need to a lot of sum/average calculations for the same image.

References

Definition at line 102 of file IntegralImage.h.

Member Function Documentation

◆ GetSubimage()

void GetSubimage ( const cv::Rect &  rect,
cv::Mat &  sub 
)

Get a sub-image using integral image representation.

Parameters
rectThe rectangle we want to get the sub-image from
subThe image where the sub-image is generated. Note, the desired resolution is defined by sub.

Get an image sub with a predefined resolution from the given rectangular area rect . In practice the sub is filled by getting the average with GetAve() for every pixel area.

◆ GetSum()

double GetSum ( cv::Rect &  rect,
int *  count = 0 
)

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

Parameters
rectThe rectancle
countIf this parameter is not 0 it is filled with number of pixels in the rectangle.

◆ Update()

void Update ( cv::Mat &  gray)

Update integral image for the given image.

Parameters
grayThe original grayscale image we want analyze

The documentation for this class was generated from the following file: