Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Attributes
icl::filter::IntegralImgOp Class Reference

class for creating integral images More...

#include <IntegralImgOp.h>

Inheritance diagram for icl::filter::IntegralImgOp:
icl::filter::UnaryOp icl::utils::Configurable

List of all members.

Public Member Functions

 IntegralImgOp (core::depth integralImageDepth=core::depth32s)
 Constructor.
 ~IntegralImgOp ()
 Destructor.
void setIntegralImageDepth (core::depth integralImageDepth)
 sets the depth of the integralImage (depth8u etc)
core::depth getIntegralImageDepth () const
 returns the depth of the integralImage
void apply (const core::ImgBase *src, core::ImgBase **dst)
 applies the integralimage Operaor

Private Attributes

core::depth m_integralImageDepth
 destination depth
core::ImgBasem_buf
 used only if IPP is available

Detailed Description

class for creating integral images

The integral image A of an image a (introduced by Viola & Jones (2001) in the paper : "Rapid Object Detection using a Boosted Cascade of Simple Features" ) defined as follows:

\[ A(i,j) = \sum\limits_{x=0}^i \sum\limits_{y=0}^j a(i,j) \]

It can be calculated incrementally using the following equation:

\[ A(i,j) = a(i,j)+A(i-1,j)+A(i,j-1)-A(i-1,j-1) \]

illustration:

      +++++..
      +++CA..
      +++BX..
      .......
      X = src(x) + A + B - C
    

Implementation

Other definitions

There are alternative definitions (like the ipp):

\[ A(i,j) = \sum\limits_{x=0}^{i-1} \sum\limits_{y=0}^{j-1} a(i,j) \]

From this it follows, that the first integral image row and colum is filled with zeros and the internal image grows by one pixel in each dimension, with the benefit of some better usability of the result image. We use the above definition, which is a bit more convenient for the most common applications in our sight.

IPP Optimization

IPP optimization is not used, as IPP uses a different formulation of the integral image which leads to an integral image that is one row and one column larger as the source image. IPPs integral image formulation is

\[ A(i,j) = \sum\limits_{x=0}^{i-1} \sum\limits_{y=0}^{j-1} a(i,j) \]

. As our implementation comes really close to the IPP-version in terms of performance, we dont use the IPP for this UnaryOp.

Supported Type-Combinations

We support all source image depth, the integral image always needs a large value domain, so here, only icl32s, icl32f and icl64f are supported.

Performance

The calculation is very fast and we come close to the IPP performace.


Constructor & Destructor Documentation

Constructor.

Parameters:
integralImageDepththe depth of the integralImage (depth8u etc)

Destructor.


Member Function Documentation

void icl::filter::IntegralImgOp::apply ( const core::ImgBase src,
core::ImgBase **  dst 
) [virtual]

applies the integralimage Operaor

Parameters:
srcThe source image
dstPointer to the destination image

Implements icl::filter::UnaryOp.

returns the depth of the integralImage

Returns:
the depth of the integralImage

sets the depth of the integralImage (depth8u etc)

Parameters:
integralImageDepththe depth of the integralImage (depth8u etc)

Member Data Documentation

used only if IPP is available

Reimplemented from icl::filter::UnaryOp.

destination depth


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines