Computes residuals for the likelihood part of the target function or its gradient.
IppStatus ippiSRHNCalcResidual_PSF3x3_8u32f_C1R(const Ipp32f* pHighRes, int highResStep, const Ipp8u* pLowRes, const Ipp32s* pOffset, const Ipp16u* pCoeff, Ipp32f* pRes, int len, const IppiSRHNSpec_PSF3x3* pPSF);
IppStatus ippiSRHNCalcResidual_PSF3x3_16u32f_C1R(const Ipp32f* pHighRes, int highResStep, const Ipp16u* pLowRes, const Ipp32s* pOffset, const Ipp16u* pCoeff, Ipp32f* pRes, int len, const IppiSRHNSpec_PSF3x3* pPSF);
IppStatus ippiSRHNCalcResidual_PSF2x2_16u32f_C1R(const Ipp32f* pHighRes, int highResStep, const Ipp16u* pLowRes, const Ipp32s* pOffset, const Ipp16u* pCoeff, Ipp32f* pRes, int len, const IppiSRHNSpec_PSF2x2* pPSF);
IppStatus ippiSRHNCalcResidual_PSF2x2_8u32f_C1R(const Ipp32f* pHighRes, int highResStep, const Ipp8u* pLowRes, const Ipp32s* pOffset, const Ipp16u* pCoeff, Ipp32f* pRes, int len, const IppiSRHNSpec_PSF2x2* pPSF);
The functions ippiSRHNCalcResidual_PSF3x3 and ippiSRHNCalcResidual_PSF2x2 are declared in the ippcv.h file.
These functions computes residuals pRes for the likelihood part of the target function C (g) or its gradient ∇C(g). The calculated values are used as the arguments of the robust error functions or their derivatives. The following pseudocode shows how the calculation is performed.
for( int i = 0; i < len; i++ ) { const Ipp32f* ptr = hiRes + ofs[i]; const Ipp32f* c = psf->cTab[coeff[i]]; Ipp32f sum = 0; for( int dy = 0; dy < K; dy++ ) for( int dx = 0; dx < K; dx++ ) sum += c[dy*K+dx]*ptr[dy*hiResStep + dx]; residual[i] = sum - lowRes[i]; }
Here K=3 for the 3x3 PSF, and K=2 for the 2x2 PSF.
The results stored in the pRes then can be passed to the robust error functions: ippsCauchy, ippsCauchyD, and ippsCauchyDD2 (see section "Arithmetic Functions" in the “Intel IPP Reference Manual” vol.1).
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.