Public Member Functions

BoxFeature 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 <BoxFeature.h>

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

List of all members.

Public Member Functions

 BoxFeature (cv::Size expectedPatchSize=cv::Size(0, 0), int nBoxes=2)
 Constructor.
virtual ~BoxFeature ()
 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 ImagePatch *patch)
 Turn an ImagePatch into a scalar value by applying the box filter.
virtual void filterPatchList (PatchList *patches)
 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

BoxFeature::BoxFeature ( cv::Size  expectedPatchSize = cv::Size(0,0),
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 BoxFeature::evaluateImagePatch ( const ImagePatch patch ) [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 Feature.

void BoxFeature::filterPatchList ( PatchList patches ) [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 Feature.

void BoxFeature::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 Feature.

Reimplemented in HaarFeature.


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