HaarClassifierInitAlloc

Allocates memory and initializes the structure for standard Haar classifiers.

Syntax

IppStatus ippiHaarClassifierInitAlloc_32f(IppiHaarClassifier_32f** pState, const IppiRect* pFeature, const Ipp32f* pWeight, const Ipp32f* pThreshold, const Ipp32f* pVal1, const Ipp32f* pVal2, const int* pNum, int length);

IppStatus ippiHaarClassifierInitAlloc_32s(IppiHaarClassifier_32s** pState, const IppiRect* pFeature, const Ipp32s* pWeight, const Ipp32s* pThreshold, const Ipp32s* pVal1, const Ipp32s* pVal2, const int* pNum, int length);

Parameters

ppState
Pointer to the pointer to the Haar classifier structure.
pFeature
Pointer to the array of features.
pWeight
Pointer to the array of feature weights.
pThreshold
Pointer to the array of classifier threshold values.
pVal1, pVal2
Pointers to the arrays of classifier result values.
pNum
Pointer to the array of classifier lengths.
length
Number of classifiers in the stage.

Description

The function ippiHaarClassifierInitAlloc is declared in the ippcv.h file. This function allocates memory and initializes the structure for the sequence of Haar classifiers - classification stage. i-th classifier in the stage has pNum[i] rectangular features. Each feature is defined by the certain rectangle with horizontal and vertical sides. The length of vectors pThreshold, pVal1, and pVal2 is equal to length, the length of vectors pFeature, pWeight is equal to:

Result of applying classifiers to the image is computed using the formula.

All features of the classifier initialized by the function ippiHaarClassifierInitAlloc have vertical and horizontal sides (left part of Figure “Representing Haar Features”). Some of these features later can be tilted using the function ippiTiltHaarFeatures.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error if one of the specified pointer is NULL.

ippStsSizeErr

Indicates an error condition if length or one of pNum[i] is less than or equal to 0.

ippStsBadArgErr

Indicates an error condition if one of features is defined incorrectly.

ippStsMemAllocErr

Memory allocation error

Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.