![]() |
My Project
|
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... | |
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.
Definition at line 102 of file IntegralImage.h.
void GetSubimage | ( | const cv::Rect & | rect, |
cv::Mat & | sub | ||
) |
Get a sub-image using integral image representation.
rect | The rectangle we want to get the sub-image from |
sub | The 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.
double GetSum | ( | cv::Rect & | rect, |
int * | count = 0 |
||
) |
Calculate the sum for the given rectangular area in the image.
rect | The rectancle |
count | If this parameter is not 0 it is filled with number of pixels in the rectangle. |
void Update | ( | cv::Mat & | gray | ) |
Update integral image for the given image.
gray | The original grayscale image we want analyze |