Public Member Functions

BoxFeature2 Class Reference
[Auxilliary Tools]

Auxilliary Tool: A linear feature that uses the "Integral Image" trick to efficiently evaluate convolution kernels on an image, where the kernel can be expressed as a sum of boxes. More...

#include <BoxFeature2.h>

Inheritance diagram for BoxFeature2:
Inheritance graph
[legend]
Collaboration diagram for BoxFeature2:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BoxFeature2 (cv::Size expectedPatchSize, int nBoxes=2)
 Constructor.
 BoxFeature2 ()
 Default constructor.
 BoxFeature2 (const BoxFeature2 &copy)
 Copy constructor.
BoxFeature2operator= (const BoxFeature2 &rhs)
 Assignment operator.
virtual ~BoxFeature2 ()
 Destructor.
virtual void setFeatureParameters (const cv::Mat &paramVec)
 Set the parameters that describe the position of the boxes. See detailed description of the parameters below.
virtual double evaluateImagePatch (const ImagePatch2 &patch) const
 Turn an ImagePatch into a scalar value by applying the box filter.
virtual void filterPatchList (PatchList2 *patches) const
 Apply the feature to a PatchList data structure.

Detailed Description

Auxilliary Tool: A linear feature that uses the "Integral Image" trick to efficiently evaluate convolution kernels on an image, where the kernel can be expressed as a sum of boxes.

The derived HaarFeature class is a subset of these box features that are like wavelets composed of blocks.

Author:
Nicholas Butko
Date:
2010
Version:
0.4

Constructor & Destructor Documentation

BoxFeature2::BoxFeature2 ( cv::Size  expectedPatchSize,
int  nBoxes = 2 
)

Constructor.

Parameters:
expectedPatchSizeSpecifies the size of the filter, which specifies the possible ranges for the box positions.
nBoxesThe number of boxes. The filtering time decreases linearly with the number of boxes.

Member Function Documentation

double BoxFeature2::evaluateImagePatch ( const ImagePatch2 patch ) const [virtual]

Turn an ImagePatch into a scalar value by applying the box filter.

Parameters:
patchThe image patch to evaluate.
Returns:
The value of the Image Patch according to the feature.

Implements Feature2.

void BoxFeature2::filterPatchList ( PatchList2 patches ) const [virtual]

Apply the feature to a PatchList data structure.

The PatchList is constructed in such a way that this filtering can be done as efficiently as possible.

Parameters:
patchesRemaining patches in a large image to be filtered.

Implements Feature2.

void BoxFeature2::setFeatureParameters ( const cv::Mat &  paramVec ) [virtual]

Set the parameters that describe the position of the boxes. See detailed description of the parameters below.

The BoxFeature parameter vector has 5N+4 elements, where N is the number of boxes. The first 5N elements describe the sign of the box (addition or subtraction), x,y position of the box's top-left corner, and its width and height respectively. The parameters for each box are together, so the first 5 elements describe the first box, etc. The sign parameter can be -1 or +1, and the position parameters are bounded below by 0 and above by patchSize.[width or height]-1, as appropriate.

The last 4 parameters describe global behavior of the filtering process. They are: horizontal symmetry, vertical symmetry, mean subtraction, brightness normalization respectively.

The first two each effectively double the number of boxes, by reflecting them around the horizontal and vertical axes respectively. Values for these can be -1,0,+1. 0 means no symmetry, -1 means the symmetric box has the opposite sign, and +1 means the symmetric box has the same sign.

Mean Subtraction means the mean pixel value of the image patch is subtracted before filtering. This normalizes for contrast but not brightness. Brightness Normalization divides the image patch by its L1 norm before filtering. If both options are set, brightness is normalized and then the mean is subtracted. Both of these operations incur a time penalty, which is relatively small.

Implements Feature2.

Reimplemented in HaarFeature2.


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