Updates the likelihood part of the gradient.
IppStatus ippiSRHNUpdateGradient_PSF3x3_32f_C1R(Ipp32f* pGrad, int gradStep, const Ipp32s* pOffset, const Ipp16u* pCoeff, const Ipp32f* pDerivRes, const Ipp8u* pWeight, int len, const Ipp32f* pWeightTab, const IppiSRHNSpec_PSF3x3* pPSF);
IppStatus ippiSRHNUpdateGradient_PSF2x2_32f_C1R(Ipp32f* pGrad, int gradStep, const Ipp32s* pOffset, const Ipp16u* pCoeff, const Ipp32f* pDerivRes, const Ipp8u* pWeight, int len, const Ipp32f* pWeightTab, const IppiSRHNSpec_PSF2x2* pPSF);
The functions ippiSRHNUpdateGradient_PSF3x3 and ippiSRHNUpdateGradient_PSF2x2 are declared in the ippcv.h file. They operate with ROI (see Regions of Interest in Intel IPP).
Theses functions update gradient of the target function ∇C(g) using the calculated derivatives of the robust error function. The following pseudocode shows how the calculation is performed.
for( int i = 0; i < len; i++ ) { const Ipp32f* ptr = grad + ofs[i]; const Ipp32f* c = psf->cTab[coeff[i]]; Ipp32f w = wTab[weight[i]]*dRes[i]; for( int dy = 0; dy < K; dy++ ) for( int dx = 0; dx < K; dx++ ) ptr[dy*gradStep+dx] += c[dy*K+dx]*w; }
Here K=3 for the 3x3 PSF, and K=2 for the 2x2 PSF.
When the gradient is calculated, the functions ippiSRHNCalcResidual and ippiSRHNUpdateGradient are called sequentially (and the function ippsCauchyD between them, see section "Arithmetic Functions" in the “Intel IPP Reference Manual” vol.1). The same array pOffset can be passed to both these functions (with the same PSF type) but only when the parameters highResStep an gradStep are equal.
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error if one of the specified pointer is NULL. |
ippStsSizeErr |
Indicates an error if len is less than 0. |
ippStsStepErr |
Indicates an error if highResStep is less than 2*sizeof(Ipp32f) for 3x3 PSF, and less than 3*sizeof(Ipp32f) for the 2x2 PSF. |
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.