NVIDIA 2D Image And Signal Performance Primitives (NPP)  Version 11.2.0.*
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Modules

Primitives for computing the norms of an image, the norms of difference, and the relative errors of two images. More...

Modules

 Norm_Inf
 Primitives for computing the infinity norm of an image.
 
 Norm_L1
 Primitives for computing the L1 norm of an image.
 
 Norm_L2
 Primitives for computing the L2 norm of an image.
 
 NormDiff_Inf
 Primitives for computing the infinity norm of difference of pixels between two images.
 
 NormDiff_L1
 Primitives for computing the L1 norm of difference of pixels between two images.
 
 NormDiff_L2
 Primitives for computing the L2 norm of difference of pixels between two images.
 
 NormRel_Inf
 Primitives for computing the relative error of infinity norm between two images.
 
 NormRel_L1
 Primitives for computing the relative error of L1 norm between two images.
 
 NormRel_L2
 Primitives for computing the relative error of L2 norm between two images.
 

Detailed Description

Primitives for computing the norms of an image, the norms of difference, and the relative errors of two images.

Given an image $pSrc$ with width $W$ and height $H$,

  1. The infinity norm (Norm_Inf) is defined as the largest absolute pixel value of the image.
  2. The L1 norm (Norm_L1) is defined as the sum of the absolute pixel value of the image, i.e.,

    \[Norm\_L1 = \sum_{j=0}^{H-1}\sum_{i=0}^{W-1}\left| pSrc(j,i)\right|\]

    .
  3. The L2 norm (Norm_L2) is defined as the square root of the sum of the squared absolute pixel value of the image, i.e.,

    \[Norm\_L2 = \sqrt{\sum_{j=0}^{H-1}\sum_{i=0}^{W-1}\left| pSrc(j,i)\right| ^2}\]

    .

Given two images $pSrc1$ and $pSrc2$ both with width $W$ and height $H$,

  1. The infinity norm of differece (NormDiff_Inf) is defined as the largest absolute difference between pixels of two images.
  2. The L1 norm of differece (NormDiff_L1) is defined as the sum of the absolute difference between pixels of two images, i.e.,

    \[NormDiff\_L1 = \sum_{j=0}^{H-1}\sum_{i=0}^{W-1}\left| pSrc1(j,i)-pSrc2(j,i)\right|\]

    .
  3. The L2 norm of differece (NormDiff_L2) is defined as the squared root of the sum of the squared absolute difference between pixels of two images, i.e.,

    \[NormDiff\_L2 = \sqrt{\sum_{j=0}^{H-1}\sum_{i=0}^{W-1}\left| pSrc1(j,i)-pSrc2(j,i)\right| ^2}\]

    .

Given two images $pSrc1$ and $pSrc2$ both with width $W$ and height $H$,

  1. The relative error for the infinity norm of differece (NormRel_Inf) is defined as NormDiff_Inf divided by the infinity norm of the second image, i.e.,

    \[NormRel\_Inf = \frac{NormDiff\_Inf}{Norm\_Inf_{src2}}\]

  2. The relative error for the L1 norm of differece (NormRel_L1) is defined as NormDiff_L1 divided by the L1 norm of the second image, i.e.,

    \[NormRel\_L1 = \frac{NormDiff\_L1}{Norm\_L1_{src2}}\]

  3. The relative error for the L2 norm of differece (NormRel_L2) is defined as NormDiff_L2 divided by the L2 norm of the second image, i.e.,

    \[NormRel\_L2 = \frac{NormDiff\_L2}{Norm\_L2_{src2}}\]

The norm functions require the addition device scratch buffer for the computations.

Common parameters for nppiNorm functions include:

Parameters
pSrc1Source-Image Pointer.
nSrc1StepSource-Image Line Step.
pSrc2Source-Image Pointer.
nSrc2StepSource-Image Line Step.
oSizeROIRegion-of-Interest (ROI).
pMaskMask-Image Pointer.
nMaskStepMask-Image Line Step.
nCOIChannel_of_Interest Number.
pNormPointer to the norm value.
pNormDiffPointer to the computed norm of differences.
pNormRelPointer to the computed relative error for the infinity norm of two images.
pDeviceBufferPointer to the required device memory allocation, Scratch Buffer and Host Pointer. Use nppiNormInfGetBufferHostSize_XX_XXX to compute the required size (in bytes).
nppStreamCtxApplication Managed Stream Context.
Returns
Image Data Related Error Codes, ROI Related Error Codes, or NPP_COI_ERROR if an invalid channel of interest is specified, or NPP_NOT_EVEN_STEP_ERROR if an invalid floating-point image is specified.

Copyright © 2009-2020 NVIDIA Corporation