SRHNUpdateGradient_PSF3x3, SRHNUpdateGradient_PSF2x2

Updates the likelihood part of the gradient.

Syntax

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);

Parameters

pGrad
Pointer to the gradient.
gradStep
Distance in bytes between starts of consecutive lines in the pGrad.
pOffset
Pointer to the array of offsets of 3x3 or 2x2 areas in the high-resolution image.
pCoeff
Pointer to the array of indexes of the coefficients in the input PSF table.
pDerivRes
Pointer to the array containing the calcuated derivatives of the robust error function.
pWeight
Pointer to the array of indexes of the values in the pWeightTab.
len
Number of elements in the arrays pOffset, pCoeff, pDerivRes, and pWeight.
pWeightTab
Pointer to the table of the confidence weights.
pPSF
Pointer to the initialized table for 3x3 or 2x2 PSF.

Description

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.

Caution iconCaution

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.

Return Values

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.


Submit feedback on this help topic

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