Intel® Integrated Performance Primitives (Intel® IPP) Developer Guide and Reference

ID 790148
Date 3/22/2024
Public
Document Table of Contents

HaarClassifierInit

Initializes the structure for standard Haar classifiers.

Syntax

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

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

Include Files

ippcv.h

Domain Dependencies

Headers: ippcore.h, ippvm.h, ipps.h, ippi.h

Libraries: ippcore.lib, ippvm.lib, ipps.lib, ippi.lib

Parameters

ppState
Double 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 Haar classifier lengths.
length
Number of classifiers in the stage.

Description

This function initializes the state structure that is required to calculate the sequence of Haar classifiers - classification stage. The i-th classifier in the stage has pNum[i] rectangular features. Each feature is defined by a certain rectangle with horizontal and vertical sides. The length of the pThreshold, pVal1, and pVal2 vectors is equal to length. The length of pFeature and pWeight is equal to:

Result of applying classifiers to the image is computed using the formula in "Object Detection Using Haar-like Features".

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

Return Values

ippStsNoErr

Indicates no error. Any other value indicates an error or a warning.

ippStsNullPtrErr

Indicates an error when any of the specified pointers is NULL.

ippStsSizeErr

Indicates an error when length or one of the pNum[i] values is less than, or equal to zero.

ippStsBadArgErr

Indicates an error when one of the features is defined incorrectly.

See Also