Applies a Haar classifier to an image.
IppStatus ippiApplyHaarClassifier_32f_C1R(const Ipp32f* pSrc, int srcStep, const Ipp32f* pNorm, int normStep, Ipp8u* pMask, int maskStep, IppiSize roiSize, int* pPositive, Ipp32f threshold, IppiHaarClassifier_32f* pState);
IppStatus ippiApplyHaarClassifier_32s32f_C1R(const Ipp32s* pSrc, int srcStep, const Ipp32f* pNorm, int normStep, Ipp8u* pMask, int maskStep, IppiSize roiSize, int* pPositive, Ipp32f threshold, IppiHaarClassifier_32f* pState);
IppStatus ippiApplyHaarClassifier_32s_C1RSfs(const Ipp32s* pSrc, int srcStep, const Ipp32s* pNorm, int normStep, Ipp8u* pMask, int maskStep, IppiSize roiSize, int* pPositive, Ipp32s threshold, IppiHaarClassifier_32s* pState, int scaleFactor);
The function ippiApplyHaarClassifier is declared in the ippcv.h file. It operates with ROI (see Regions of Interest in Intel IPP).
This function applies the Haar classifier pState previously
initialized by the function ippiHaarClassifierInitAlloc
or ippiTiltedHaarClassifierInitAlloc to pixels of the source image ROI pSrc.
The source image should be in the integral representation, it can
be obtained by calling one of the
integral functions
beforehand. The sum of pixels on feature rectangles is computed
as:
Here (yl, xl) and (Yl, Xl) are coordinates of top left and right bottom pixels of l-th rectangle of the feature, and wl is the feature weight. For i = 0. roiSize.height - 1, j = 0. roiSize.width - 1 all pixels referred in the above formula should be allocated in memory.
The input value of pPositive [0] is used as a hint to choose the calculation algorithm. If it is greater than or equal to roiSize.width*roiSize.height, the value of the classifier is calculated in accordance with the above formula for all pixels of the input image. Otherwise the value of the classifier is calculated for all non-zero pixels of pMask image. If the sum is less than threshold than the negative decision is made and the value of the corresponding pixel of the pMask image is set to zero. The number of positive decisions is assigned to the pPositive[0].
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error if one of the specified pointer is NULL. |
ippStsSizeErr |
Indicates an error condition if roiSize has a field with zero or negative value. |
ippStsStepErr |
Indicates an error condition if one of the image step values is less than roiSize.width*< pixelSize>. |
ippStsNorEvenStepErr |
Indicates an error condition if one of the image step values is not divisible by 4 for 32-bit images. |
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.