Image Statistics Functions

Primitives for computing the statistical properties of an image.

Some statistical primitives also require scratch buffer during the computation. For details, please refer to Scratch Buffer and Host Pointer.

These functions can be found in the nppist library. Linking to only the sub-libraries that you use can significantly save link time, application load time, and CUDA runtime startup time when using dynamic libraries.

CommonGetBufferHostSizeParameters

Common parameters for nppiGetBufferHostSize functions include:

param oSizeROI

Region-of-Interest (ROI).

param hpBufferSize

Required buffer size. Important: hpBufferSize is a host pointer. Scratch Buffer and Host Pointer.

param nppStreamCtx

Application Managed Stream Context.

return

NPP_NULL_POINTER_ERROR if hpBufferSize is 0 (NULL), ROI Related Error Codes.

Image Sum

Sum

Primitives for computing the sum of all the pixel values in an image.

Sum

Given an image \(pSrc\) with width \(W\) and height \(H\), the sum will be computed as

\[Sum = \sum_{j=0}^{H-1}\sum_{i=0}^{W-1}pSrc(j,i)\]
All the results are stored in a 64-bit double precision format, except for two primitives nppiSum_8u64s_C1R_Ctx and nppiSum_8u64s_C4R_Ctx. The sum functions require additional scratch buffer for computations.

Common parameters for nppiSum functions include:

Supported source data types include NPP_8U, NPP_16U, NPP_16S, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

param eSrcType

source image_data_type.

param eSrcChannels

image_channels, alpha channel is ignored for NPP_CH_A4.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pDeviceBuffer

Pointer to the required device memory allocation, Scratch Buffer and Host Pointer. Use nppiSumGetBufferHostSize_XX_XXX to determine the minium number of bytes required.

param pSum

Pointer to the computed sum result.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

NppStatus nppiSum_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc, int nSrcStep, NppiSize oSizeROI, Npp64f *pSum, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image sum.

For common parameter descriptions, see Common parameters for nppiSum functions include:.

NppStatus nppiSum_8u64s_C1R_Ctx(const Npp8u *pSrc, int nSrcStep, NppiSize oSizeROI, Npp64s *pSum, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

One-channel 8-bit unsigned image sum.

The result is 64-bit long long integer.

For common parameter descriptions, see Common parameters for nppiSum functions include:.

NppStatus nppiSum_8u64s_C4R_Ctx(const Npp8u *pSrc, int nSrcStep, NppiSize oSizeROI, Npp64s aSum[4], Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Four-channel 8-bit unsigned image sum.

The result is 64-bit long long integer.

For common parameter descriptions, see Common parameters for nppiSum functions include:.

SumGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the sum primitives.

NppStatus nppiSumGetBufferHostSize_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiSum.

Supported data types include NPP_8U, NPP_16U, NPP_16S, NPP_64S, NPP_32F, NPP_64F.

For common parameter descriptions, see

CommonGetBufferHostSizeParameters.
Parameters
  • eSrcType – source image_data_type.

  • eDstType – destination image_data_type.

  • eSrcDstChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

  • oSizeROIRegion-of-Interest (ROI).

  • hpBufferSize – Host memory pointer to required byte count value.

  • nppStreamCtxApplication Managed Stream Context.

Image Min

Min

Primitives for computing the minimal pixel value of an image.

Min

The scratch buffer is required by the min functions.

Common parameters for nppiMin functions include:

Supported source data types include NPP_8U, NPP_16U, NPP_16S, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

param eSrcDstType

source image_data_type.

param eSrcChannels

image_channels, alpha channel is ignored for NPP_CH_A4.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pDeviceBuffer

Pointer to the required device memory allocation, Scratch Buffer and Host Pointer. Use nppiMinGetBufferHostSize_XX_XXX to determine the minium number of bytes required.

param pMin

Pointer to the computed min of the same data type and channels as the source.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

NppStatus nppiMin_Ctx(NppDataType eSrcDstType, NppiChannels eSrcChannels, const void *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, void *pMin, NppStreamContext nppStreamCtx)

Image min.

For common parameter descriptions, see Common parameters for nppiMin functions include:.

MinGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the min primitives.

NppStatus nppiMinGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiMin.

For common parameter descriptions, see CommonGetBufferHostSizeParameters. Supported data types include NPP_8U, NPP_16U, NPP_16S, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

Parameters

Image Min Index

MinIndx

Primitives for computing the minimal value and its indices (X and Y coordinates) of an image.

MinIndx

If there are several minima in the selected ROI, the function returns one on the top leftmost position.

The scratch buffer is required by the functions.

Common parameters for nppiMinIndx functions include:

Supported source data types include NPP_8U, NPP_16U, NPP_16S, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

param eSrcType

source image_data_type.

param eSrcChannels

image_channels, alpha channel is ignored for NPP_CH_A4.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pMin

Pointer to the computed min result of the same data type and channels as the source.

param pIndexX

Pointer to the X coordinate of the image min value.

param pIndexY

Ppointer to the Y coordinate of the image min value.

param pDeviceBuffer

Pointer to the required device memory allocation, Scratch Buffer and Host Pointer Use nppiMinIndxGetBufferHostSize_XX_XXX to determine the minium number of bytes required.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

NppStatus nppiMinIndx_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc, int nSrcStep, NppiSize oSizeROI, void *pMin, int *pIndexX, int *pIndexY, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image MinIndx.

For common parameter descriptions, see Common parameters for nppiMinIndx functions include:.

MinIndxGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the MinIndx primitives.

NppStatus nppiMinIndxGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Computes the dvice scratch buffer size (in bytes) for nppiMinIndx.

Supported data types include NPP_8U, NPP_16U, NPP_16S, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

For common parameter descriptions, see

CommonGetBufferHostSizeParameters.
Parameters

Image Max

Max

Primitives for computing the maximal pixel value of an image.

Common parameters for nppiMax functions include:

Supported source data types include NPP_8U, NPP_16U, NPP_16S, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

param eSrcType

source image_data_type.

param eSrcChannels

image_channels, alpha channel is ignored for NPP_CH_A4.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pMax

Pointer to the computed max of the same data type and channels as the source.

param pDeviceBuffer

Pointer to the required device memory allocation, Scratch Buffer and Host Pointer. Use nppiMaxGetBufferHostSize_XX_XXX to determine the minium number of bytes required.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Max

The scratch buffer is required by the functions.

NppStatus nppiMax_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc, int nSrcStep, NppiSize oSizeROI, void *pMax, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image Max.

For common parameter descriptions, see Common parameters for nppiMax functions include:.

MaxGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the Max primitives.

NppStatus nppiMaxGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiMax.

Supported data types include NPP_8U, NPP_16U, NPP_16S, NPP_32F.

For common parameter descriptions, see

CommonGetBufferHostSizeParameters.
Parameters

Image Max Index

MaxIndx

Primitives for computing the maximal value and its indices (X and Y coordinates) of an image.

MaxIndx

If there are several maxima in the selected region of interest, the function returns one on the top leftmost position.

The scratch buffer is required by the functions.

Common parameters for nppiMaxIndx functions include:

Supported source data types include NPP_8U, NPP_16U, NPP_16S, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

param eSrcType

source image_data_type.

param eSrcChannels

image_channels, alpha channel is ignored for NPP_CH_A4.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pMax

Pointer to the computed max result of the same data type and channels as the source.

param pIndexX

Pointer to the X coordinate of the image max value.

param pIndexY

Ppointer to the Y coordinate of the image max value.

param pDeviceBuffer

Pointer to the required device memory allocation, Scratch Buffer and Host Pointer Use nppiMaxIndxGetBufferHostSize_XX_XXX to determine the minium number of bytes required.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

NppStatus nppiMaxIndx_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc, int nSrcStep, NppiSize oSizeROI, void *pMax, int *pIndexX, int *pIndexY, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image MaxIndx.

For common parameter descriptions, see Common parameters for nppiMaxIndx functions include:.

MaxIndxGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the MaxIndx primitives.

NppStatus nppiMaxIndxGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Computes the dvice scratch buffer size (in bytes) for nppiMaxIndx.

Supported data types include NPP_8U, NPP_16U, NPP_16S, NPP_32F.

For common parameter descriptions, see

CommonGetBufferHostSizeParameters.
Parameters

Image MinMax

MinMax

Primitives for computing both the minimal and the maximal values of an image.

MinMax

The functions require the device scratch buffer.

Common parameters for nppiMinMax functions include:

Supported source data types include NPP_8U, NPP_16U, NPP_16S, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

param eSrcType

source image_data_type.

param eSrcChannels

source number of channels, alpha is ignored for A4.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param nCOI

Channel_of_Interest Number for multichannel C3 source.

param pMin

Pointer to the computed minimal result of the same data type and channels as the source.

param pMax

Pointer to the computed maximal result of the same data type and channels as the source.

param pDeviceBuffer

Buffer to a scratch memory. Use nppiMinMax_XX_XXX to determine the minium number of bytes required.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

NppStatus nppiMinMax_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc, int nSrcStep, NppiSize oSizeROI, void *pMin, void *pMax, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image MinMax.

NppStatus nppiMinMax_C3_Ctx(NppDataType eSrcType, const void *pSrc, int nSrcStep, NppiSize oSizeROI, int nCOI, void *pMin, void *pMax, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image MinMax_C3.

MinMaxGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the MinMax primitives.

NppStatus nppiMinMaxGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiMinMax.

Supported data types include NPP_8U, NPP_16U, NPP_16S, NPP_32F.

For common parameter descriptions, see

CommonGetBufferHostSizeParameters.
Parameters

Image Mean

Mean

Primitives for computing the arithmetic mean of all the pixel values in an image.

Mean

Given an image \(pSrc\) with width \(W\) and height \(H\), the arithmetic mean will be computed as

\[Mean = \frac{1}{W\cdot H}\sum_{j=0}^{H-1}\sum_{i=0}^{W-1}pSrc(j,i)\]
The mean functions require additional scratch buffer for computations.

Common parameters for nppiMean functions include:

Supported source data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

param eSrcType

source image_data_type.

param eSrcChannels

image_channels, alpha channel is ignored for NPP_CH_A4.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pMask

Mask-Image Pointer.

param nMaskStep

Mask-Image Line Step.

param nCOI

Channel_of_Interest Number.

param pDeviceBuffer

Pointer to the required device memory allocation, Scratch Buffer and Host Pointer Use nppiMeanGetBufferHostSize_XX_XXX to determine the minium number of bytes required.

param pMean

Pointer to the computed mean result.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes, or NPP_COI_ERROR if an invalid channel of interest is specified.s

NppStatus nppiMean_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64f *pMean, NppStreamContext nppStreamCtx)

Image Mean.

For common parameter descriptions, see Common parameters for nppiMean functions include:.

NppStatus nppiMean_C1M_Ctx(NppDataType eSrcType, const void *pSrc, int nSrcStep, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64f *pMean, NppStreamContext nppStreamCtx)

Masked image Mean.

For common parameter descriptions, see Common parameters for nppiMean functions include:.

NppStatus nppiMean_C3M_Ctx(NppDataType eSrcType, const void *pSrc, int nSrcStep, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, int nCOI, Npp8u *pDeviceBuffer, Npp64f *pMean, NppStreamContext nppStreamCtx)

Masked three-channel image Mean affecting only single channel.

For common parameter descriptions, see Common parameters for nppiMean functions include:.

MeanGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the Mean primitives.

Common parameters for nppiMeanGetBufferHostSize functions include:

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32F.

param eSrcType

source image_data_type.

param eSrcDstChannels

image_channels, alpha channel is ignored for NPP_CH_A4.

param oSizeROI

Region-of-Interest (ROI).

param hpBufferSize

Required buffer size. Important: hpBufferSize is a host pointer. Scratch Buffer and Host Pointer.

param nppStreamCtx

Application Managed Stream Context.

return

NPP_NULL_POINTER_ERROR if hpBufferSize is 0 (NULL), ROI Related Error Codes.

NppStatus nppiMeanGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcDstChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiMean.

For common parameter descriptions, see Common parameters for nppiMeanGetBufferHostSize functions include:.

NppStatus nppiMaskedMeanGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcDstChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiMean with mask.

For common parameter descriptions, see Common parameters for nppiMeanGetBufferHostSize functions include:.

Image Mean StdDev

Mean_StdDev

Primitives for computing both the arithmetic mean and the standard deviation of an image.

Mean_StdDev

Given an image \(pSrc\) with width \(W\) and height \(H\), the mean and the standard deviation will be computed as

\[Mean = \frac{1}{W\cdot H}\sum_{j=0}^{H-1}\sum_{i=0}^{W-1}pSrc(j,i)\]
\[StdDev = \sqrt{\frac{1}{W\cdot H}\sum_{j=0}^{H-1}\sum_{i=0}^{W-1}(pSrc(j,i)-Mean)^2}\]
The Mean_StdDev primitives require additional scratch buffer for computations.

Common parameters for nppiMean_StdDev functions include:

Supported source data types include NPP_8U, NPP_8S, NPP_16U, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

param eSrcType

source image_data_type.

param eSrcChannels

image_channels, alpha channel is ignored for NPP_CH_A4.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pMask

Mask-Image Pointer.

param nMaskStep

Mask-Image Line Step.

param nCOI

Channel_of_Interest Number.

param pDeviceBuffer

Pointer to the required device memory allocation, Scratch Buffer and Host Pointer Use nppiMeanStdDevGetBufferHostSize_8u_C1R to determine the minium number of bytes required.

param pMean

Pointer to the computed mean.

param pStdDev

Pointer to the computed standard deviation.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes, or NPP_COI_ERROR if an invalid channel of interest is specified.

NppStatus nppiMean_StdDev_C1_Ctx(NppDataType eSrcType, const void *pSrc, int nSrcStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64f *pMean, Npp64f *pStdDev, NppStreamContext nppStreamCtx)

Image Mean_StdDev.

For common parameter descriptions, see Common parameters for nppiMean_StdDev functions include:.

NppStatus nppiMean_StdDev_C1M_Ctx(NppDataType eSrcType, const void *pSrc, int nSrcStep, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, Npp8u *pDeviceBuffer, Npp64f *pMean, Npp64f *pStdDev, NppStreamContext nppStreamCtx)

Single channel masked image Mean_StdDev.

For common parameter descriptions, see Common parameters for nppiMean_StdDev functions include:.

Channel Mean_StdDev

See Channel-of-Interest API.

NppStatus nppiMean_StdDev_C3_Ctx(NppDataType eSrcType, const void *pSrc, int nSrcStep, NppiSize oSizeROI, int nCOI, Npp8u *pDeviceBuffer, Npp64f *pMean, Npp64f *pStdDev, NppStreamContext nppStreamCtx)

Three-channel Mean_StdDev affecting only single channel.

For common parameter descriptions, see Common parameters for nppiMean_StdDev functions include:.

NppStatus nppiMean_StdDev_C3M_Ctx(NppDataType eSrcType, const void *pSrc, int nSrcStep, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, int nCOI, Npp8u *pDeviceBuffer, Npp64f *pMean, Npp64f *pStdDev, NppStreamContext nppStreamCtx)

Masked three-channel 8-bit unsigned image Mean_StdDev.

For common parameter descriptions, see Common parameters for nppiMean_StdDev functions include:.

MeanStdDevGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the Mean_StdDev primitives.

Common parameters for nppiMeanStdDevGetBufferHostSize functions include:

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_32F.

param eSrcType

source image_data_type.

param eSrcChannels

image_channels, alpha channel is ignored for NPP_CH_A4.

param oSizeROI

Region-of-Interest (ROI).

param hpBufferSize

Host memory pointer to required byte count value.

param nppStreamCtx

Application Managed Stream Context.

NppStatus nppiMeanStdDevGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiMean_StdDev.

For common parameter descriptions, see Common parameters for nppiMeanStdDevGetBufferHostSize functions include:.

NppStatus nppiMaskedMeanStdDevGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiMaskedMean_StdDev.

For common parameter descriptions, see Common parameters for nppiMeanStdDevGetBufferHostSize functions include:.

Image Norms

Image Norms

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:

Supported source data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32S, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

param eSrcType

source image_data_type.

param eSrcChannels

image_channels, alpha channel is ignored for NPP_CH_A4.

param pSrc1

Source-Image Pointer.

param nSrc1Step

Source-Image Line Step.

param pSrc2

Source-Image Pointer.

param nSrc2Step

Source-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pMask

Mask-Image Pointer.

param nMaskStep

Mask-Image Line Step.

param nCOI

Channel_of_Interest Number.

param pNorm

Pointer to the norm value of same data type and channels as source.

param pNormDiff

Pointer to the computed norm of differences of same number of channels.

param pNormRel

Pointer to the computed relative error for the infinity norm of two images.

param pDeviceBuffer

Pointer to the required device memory allocation, Scratch Buffer and Host Pointer. Use nppiNormInfGetBufferHostSize to compute the required size (in bytes).

param nppStreamCtx

Application Managed Stream Context.

return

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.

Image Norm Inf

Norm_Inf

Primitives for computing the infinity norm of an image.

Basic Norm_Inf

NppStatus nppiNorm_Inf_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc, int nSrcStep, NppiSize oSizeROI, Npp64f *pNorm, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image Norm_Inf.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NppStatus nppiNorm_Inf_C1M_Ctx(NppDataType eSrcType, const void *pSrc, int nSrcStep, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, Npp64f *pNorm, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Masked single channel image Norm_Inf.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NppStatus nppiNorm_Inf_C3M_Ctx(NppDataType eSrcType, const void *pSrc, int nSrcStep, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, int nCOI, Npp64f *pNorm, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Masked three-channel image Norm_Inf affecting only single channel.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NormInfGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the Norm_Inf primitives.

NppStatus nppiNormInfGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiNorm_Inf.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32S, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

For common parameter descriptions, see

CommonGetBufferHostSizeParameters.
Parameters

Image Norm L1

Norm_L1

Primitives for computing the L1 norm of an image.

Basic Norm_L1

NppStatus nppiNorm_L1_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc, int nSrcStep, NppiSize oSizeROI, Npp64f *pNorm, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image Norm_L1.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NppStatus nppiNorm_L1_C1M_Ctx(NppDataType eSrcType, const void *pSrc, int nSrcStep, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, Npp64f *pNorm, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Masked one channel image Norm_L1.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NppStatus nppiNorm_L1_C3M_Ctx(NppDataType eSrcType, const void *pSrc, int nSrcStep, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, int nCOI, Npp64f *pNorm, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Masked three-channel Norm_L1 affecting only single channel.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NormL1GetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the Norm_L1 primitives.

NppStatus nppiNormL1GetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiNorm_L1.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32S, NPP_32F.

For common parameter descriptions, see

CommonGetBufferHostSizeParameters.
Parameters

Image Norm L2

Norm_L2

Primitives for computing the L2 norm of an image.

Basic Norm_L2

Computes the L2 norm of an image.

NppStatus nppiNorm_L2_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc, int nSrcStep, NppiSize oSizeROI, Npp64f *pNorm, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image Norm_L2.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NppStatus nppiNorm_L2_C1M_Ctx(NppDataType eSrcType, const void *pSrc, int nSrcStep, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, Npp64f *pNorm, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Masked one-channel image Norm_L2.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NppStatus nppiNorm_L2_C3M_Ctx(NppDataType eSrcType, const void *pSrc, int nSrcStep, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, int nCOI, Npp64f *pNorm, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Masked three-channel image Norm_L2 affecting only a single channel.

NormL2GetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the Norm_L2 primitives.

NppStatus nppiNormL2GetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiNorm_L2.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32S, NPP_32F.

Parameters
  • eSrcType – source image_data_type.

  • eSrcChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

  • oSizeROIRegion-of-Interest (ROI).

  • hpBufferSize – Host memory pointer to required byte count value.

  • nppStreamCtxApplication Managed Stream Context. For common parameter descriptions, see CommonGetBufferHostSizeParameters.

Image NormDiff Inf

NormDiff_Inf

Primitives for computing the infinity norm of difference of pixels between two images.

Basic NormDiff_Inf

NppStatus nppiNormDiff_Inf_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, NppiSize oSizeROI, Npp64f *pNormDiff, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image NormDiff_Inf.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NppStatus nppiNormDiff_Inf_C1M_Ctx(NppDataType eSrcType, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, Npp64f *pNormDiff, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Masked one-channel image NormDiff_Inf.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NppStatus nppiNormDiff_Inf_C3M_Ctx(NppDataType eSrcType, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, int nCOI, Npp64f *pNorm, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Masked three-channel image NormDiff_Inf affecting only single channel.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NormDiffInfGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the NormDiff_Inf primitives.

NppStatus nppiNormDiffInfGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiNormDiff_Inf.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32S, NPP_32F.

Parameters
  • eSrcType – source image_data_type.

  • eSrcChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

  • oSizeROIRegion-of-Interest (ROI).

  • hpBufferSize – Host memory pointer to required byte count value.

  • nppStreamCtxApplication Managed Stream Context. For common parameter descriptions, see CommonGetBufferHostSizeParameters.

Image NormDiff L1

NormDiff_L1

Primitives for computing the L1 norm of difference of pixels between two images.

Basic NormDiff_L1

NppStatus nppiNormDiff_L1_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, NppiSize oSizeROI, Npp64f *pNormDiff, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image NormDiff_L1.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NppStatus nppiNormDiff_L1_C1M_Ctx(NppDataType eSrcType, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, Npp64f *pNormDiff, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Masked one-channel image NormDiff_L1.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NppStatus nppiNormDiff_L1_C3M_Ctx(NppDataType eSrcType, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, int nCOI, Npp64f *pNormDiff, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Masked three-channel image NormDiff_L1 affecting only single channel.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NormDiffL1GetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the NormDiff_L1 primitives.

NppStatus nppiNormDiffL1GetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Computes the device scratch buffer size (in bytes) for nppiNormDiff_L1.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32S, NPP_32F.

Parameters
  • eSrcType – source image_data_type.

  • eSrcChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

  • oSizeROIRegion-of-Interest (ROI).

  • hpBufferSize – Host memory pointer to required byte count value.

  • nppStreamCtxApplication Managed Stream Context. For common parameter descriptions, see CommonGetBufferHostSizeParameters.

Image NormDiff L2

NormDiff_L2

Primitives for computing the L2 norm of difference of pixels between two images.

Basic NormDiff_L2

NppStatus nppiNormDiff_L2_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, NppiSize oSizeROI, Npp64f *pNormDiff, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image NormDiff_L2.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NppStatus nppiNormDiff_L2_C1M_Ctx(NppDataType eSrcType, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, Npp64f *pNormDiff, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Masked one-channel image NormDiff_L2.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NppStatus nppiNormDiff_L2_C3M_Ctx(NppDataType eSrcType, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, int nCOI, Npp64f *pNormDiff, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Masked three-channel image NormDiff_L2 affecting only single channel.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NormDiffL2GetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the NormDiff_L2 primitives.

NppStatus nppiNormDiffL2GetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Computes the device scratch buffer size (in bytes) for nppiNormDiff_L2.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32S, NPP_32F.

Parameters
  • eSrcType – source image_data_type.

  • eSrcChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

  • oSizeROIRegion-of-Interest (ROI).

  • hpBufferSize – Host memory pointer to required byte count value.

  • nppStreamCtxApplication Managed Stream Context. For common parameter descriptions, see CommonGetBufferHostSizeParameters.

Image NormRel Inf

NormRel_Inf

Primitives for computing the relative error of infinity norm between two images.

Basic NormRel_Inf

NppStatus nppiNormRel_Inf_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, NppiSize oSizeROI, Npp64f *pNormRel, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image NormRel_Inf.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NppStatus nppiNormRel_Inf_C1M_Ctx(NppDataType eSrcType, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, Npp64f *pNormRel, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Masked one-channel image NormRel_Inf.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NppStatus nppiNormRel_Inf_C3M_Ctx(NppDataType eSrcType, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, int nCOI, Npp64f *pNormRel, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Masked three-channel image NormRel_Inf affecting only signle channel.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NormRelInfGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the NormRel_Inf primitives.

NppStatus nppiNormRelInfGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Computes the device scratch buffer size (in bytes) for nppiNormRel_Inf.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32S, NPP_32F.

Parameters
  • eSrcType – source image_data_type.

  • eSrcChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

  • oSizeROIRegion-of-Interest (ROI).

  • hpBufferSize – Host memory pointer to required byte count value.

  • nppStreamCtxApplication Managed Stream Context. For common parameter descriptions, see CommonGetBufferHostSizeParameters.

Image NormRel L1

NormRel_L1

Primitives for computing the relative error of L1 norm between two images.

Basic NormRel_L1

NppStatus nppiNormRel_L1_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, NppiSize oSizeROI, Npp64f *pNormRel, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image NormRel_L1.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NppStatus nppiNormRel_L1_C1M_Ctx(NppDataType eSrcType, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, Npp64f *pNormRel, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Masked one-channel image NormRel_L1.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NppStatus nppiNormRel_L1_C3M_Ctx(NppDataType eSrcType, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, int nCOI, Npp64f *pNormRel, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Masked three-channel image NormRel_L1 affecting only signle channel.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NormRelL1GetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the NormRel_L1 primitives.

NppStatus nppiNormRelL1GetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Computes the device scratch buffer size (in bytes) for nppiNormRel_L1.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32S, NPP_32F.

Parameters
  • eSrcType – source image_data_type.

  • eSrcChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

  • oSizeROIRegion-of-Interest (ROI).

  • hpBufferSize – Host memory pointer to required byte count value.

  • nppStreamCtxApplication Managed Stream Context. For common parameter descriptions, see CommonGetBufferHostSizeParameters.

Image NormRel L2

NormRel_L2

Primitives for computing the relative error of L2 norm between two images.

Basic NormRel_L2

NppStatus nppiNormRel_L2_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, NppiSize oSizeROI, Npp64f *pNormRel, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

image NormRel_L2.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NppStatus nppiNormRel_L2_C1M_Ctx(NppDataType eSrcType, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, Npp64f *pNormRel, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Masked one-channel image NormRel_L2.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NppStatus nppiNormRel_L2_C3M_Ctx(NppDataType eSrcType, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, const Npp8u *pMask, int nMaskStep, NppiSize oSizeROI, int nCOI, Npp64f *pNormRel, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Masked three-channel image NormRel_L2 affecting only signle channel.

For common parameter descriptions, see Common parameters for nppiNorm functions include:.

NormRelL2GetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the NormRel_L2 primitives.

NppStatus nppiNormRelL2GetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Computes the device scratch buffer size (in bytes) for nppiNormRel_L2.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32S, NPP_32F.

Parameters
  • eSrcType – source image_data_type.

  • eSrcChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

  • oSizeROIRegion-of-Interest (ROI).

  • hpBufferSize – Host memory pointer to required byte count value.

  • nppStreamCtxApplication Managed Stream Context. For common parameter descriptions, see CommonGetBufferHostSizeParameters.

Image DotProd

DotProd

Primitives for computing the dot product of two images.

DotProd

Given two images \(pSrc1\) and \(pSrc2\) both with width \(W\) and height \(H\), the dot product will be computed as

\[DotProd = \sum_{j=0}^{H-1}\sum_{i=0}^{W-1}[pSrc1(j,i)\cdot pSrc2(j,i)]\]
The functions require additional scratch buffer for computations.

Common parameters for nppiDotProd functions include:

Supported source data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32U, NPP_32S, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

param eSrcType

source image_data_type.

param eSrcChannels

image_channels, alpha channel is ignored for NPP_CH_A4.

param pSrc1

Source-Image Pointer.

param nSrc1Step

Source-Image Line Step.

param pSrc2

Source-Image Pointer.

param nSrc2Step

Source-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pDotProd

Pointer to the computed dot product of the two images of the same number of channels.

param pDeviceBuffer

Pointer to the required device memory allocation, Scratch Buffer and Host Pointer.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes.

NppStatus nppiDotProd_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, NppiSize oSrc1SizeROI, Npp64f *pDotProd, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image DotProd.

For common parameter descriptions, see Common parameters for nppiDotProd functions include:.

DotProdGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the Mean_StdDev primitives.

NppStatus nppiDotProdGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Device scratch buffer size (in bytes) for nppiDotProd.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32S, NPP_32F.

Parameters
  • eSrcType – source image_data_type.

  • eSrcChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

  • oSizeROIRegion-of-Interest (ROI).

  • hpBufferSize – Host memory pointer to required byte count value.

  • nppStreamCtxApplication Managed Stream Context. For common parameter descriptions, see CommonGetBufferHostSizeParameters.

Image Count In Range

CountInRange.

Primitives for computing the amount of pixels that fall into the specified intensity range.

CountInRange

The lower bound and the upper bound are inclusive.

The functions require additional scratch buffer for computations.

Common parameters for nppiCountInRange functions include:

Supported source data types include NPP_8U, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_A4.

param eSrcType

source image_data_type.

param eSrcChannels

image_channels, alpha channel is ignored for NPP_CH_A4.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pCounts

Pointer to the number of pixels that fall into the specified range of the same number of channels as the source.

param pLowerBound

Pointer to the lower bound of the specified range of the same data type and number of channels as the source.

param pUpperBound

Pointer to the upper bound of the specified range of the same data type and number of channels as the source.

param pDeviceBuffer

Pointer to the required device memory allocation, Scratch Buffer and Host Pointer.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes, or NPP_RANGE_ERROR if the lower bound is larger than the upper bound.

NppStatus nppiCountInRange_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc, int nSrcStep, NppiSize oSizeROI, int *pCounts, void *pLowerBound, void *pUpperBound, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image CountInRange.

For common parameter descriptions, see Common parameters for nppiCountInRange functions include:.

CountInRangeGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the CountInRange primitives.

NppStatus nppiCountInRangeGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Device scratch buffer size (in bytes) for nppiCountInRange.

Supported data types include NPP_8U, NPP_32F.

Parameters
  • eSrcType – source image_data_type.

  • eSrcChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

  • oSizeROIRegion-of-Interest (ROI).

  • hpBufferSize – Host memory pointer to required byte count value.

  • nppStreamCtxApplication Managed Stream Context. For common parameter descriptions, see CommonGetBufferHostSizeParameters.

Image MaxEvery

MaxEvery

Primitives for computing the maximal value of the pixel pair from two images.

MaxEvery

The maximum is stored into the second image.

Common parameters for nppiMaxEvery functions include:

Supported data types include NPP_8U, NPP_16U, NPP_16S, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

param eSrcDstType

source image_data_type.

param eSrcDstChannels

image_channels, alpha channel is ignored for NPP_CH_A4.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pSrcDst

In-Place Image Pointer.

param nSrcDstStep

Source-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes.

NppStatus nppiMaxEvery_I_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, void *pSrcDst, int nSrcDstStep, NppiSize oSizeROI, NppStreamContext nppStreamCtx)

In place image MaxEvery.

For common parameter descriptions, see Common parameters for nppiMaxEvery functions include:.

Image MinEvery

MinEvery

Primitives for computing the minimal value of the pixel pair from two images.

MinEvery

The minimum is stored into the second image.

Common parameters for nppiMinEvery functions include:

Supported data types include NPP_8U, NPP_16U, NPP_16S, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

param eSrcDstType

source image_data_type.

param eSrcDstChannels

image_channels, alpha channel is ignored for NPP_CH_A4.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pSrcDst

In-Place Image Pointer.

param nSrcDstStep

Source-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes.

NppStatus nppiMinEvery_I_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, void *pSrcDst, int nSrcDstStep, NppiSize oSizeROI, NppStreamContext nppStreamCtx)

In place image MinEvery.

For common parameter descriptions, see Common parameters for nppiMinEvery functions include:.

Image Integral

Integral

Primitives for computing the integral image of a given image.

Integral

Given an input image \(pSrc\) and the specified value \(nVal\), the pixel value of the integral image \(pDst\) at coordinate (i, j) will be computed as

\[pDst(j,i) = nVal + \sum_{l=0}^{j-1}\sum_{k=0}^{i-1}pSrc(l,k)\]
If the size of the input image is \(W \times H\), the size of the integral image will be \((W+1) \times (H+1)\).
NppStatus nppiIntegral_8u32s_C1R_Ctx(const Npp8u *pSrc, int nSrcStep, Npp32s *pDst, int nDstStep, NppiSize oROI, Npp32s nVal, NppStreamContext nppStreamCtx)

One-channel 8-bit unsigned image Integral with 32-bit signed output.

Parameters
Returns

Image Data Related Error Codes, ROI Related Error Codes.

NppStatus nppiIntegral_8u32f_C1R_Ctx(const Npp8u *pSrc, int nSrcStep, Npp32f *pDst, int nDstStep, NppiSize oROI, Npp32f nVal, NppStreamContext nppStreamCtx)

One-channel 8-bit unsigned image Integral with 32-bit floating point output.

Parameters
Returns

Image Data Related Error Codes, ROI Related Error Codes.

Image Square Integral

SqrIntegral

Primitives for computing both the integral and the squared integral images of a given image.

SqrIntegral

Given an input image \(pSrc\) and the specified value \(nVal\), the pixel value of the integral image \(pDst\) at coordinate (i, j) will be computed as

\[pDst(j,i) = nVal + \sum_{l=0}^{j-1}\sum_{k=0}^{i-1}pSrc(l,k)\]
Given an input image \(pSrc\) and the specified value \(nValSqr\), the pixel value of the squared integral image \(pSqr\) at coordinate (i, j) will be computed as
\[pSqr(j,i) = nValSqr + \sum_{l=0}^{j-1}\sum_{k=0}^{i-1}{pSrc(l,k)}^2\]
If the size of the input image is \(W \times H\), the size of the squared integral image will be \((W+1) \times (H+1)\).
NppStatus nppiSqrIntegral_8u32s_C1R_Ctx(const Npp8u *pSrc, int nSrcStep, Npp32s *pDst, int nDstStep, Npp32s *pSqr, int nSqrStep, NppiSize oSrcROI, Npp32s nVal, Npp32s nValSqr, NppStreamContext nppStreamCtx)

One-channel 8-bit unsigned image SqrIntegral.

Destination integral image and square integral image are 32-bit signed int.

Parameters
  • pSrc – Source-Image Pointer.

  • nSrcStep – Source-Image Line Step.

  • pDst – Destination-Image Pointer.

  • nDstStep – Destination-Image Line Step.

  • pSqr – Destination-Image Pointer.

  • nSqrStep – Destination-Image Line Step.

  • oSrcROIRegion-of-Interest (ROI).

  • nVal – The value to add to pDst image pixels

  • nValSqr – The value to add to pSqr image pixels

  • nppStreamCtxApplication Managed Stream Context.

Returns

Image Data Related Error Codes, ROI Related Error Codes

NppStatus nppiSqrIntegral_8u32s64f_C1R_Ctx(const Npp8u *pSrc, int nSrcStep, Npp32s *pDst, int nDstStep, Npp64f *pSqr, int nSqrStep, NppiSize oSrcROI, Npp32s nVal, Npp64f nValSqr, NppStreamContext nppStreamCtx)

One-channel 8-bit unsigned image SqrIntegral.

Destination integral image is 32-bit signed int. Destination square integral image is 64-bit double floating point.

Parameters
  • pSrc – Source-Image Pointer.

  • nSrcStep – Source-Image Line Step.

  • pDst – Destination-Image Pointer.

  • nDstStep – Destination-Image Line Step.

  • pSqr – Destination-Image Pointer.

  • nSqrStep – Destination-Image Line Step.

  • oSrcROIRegion-of-Interest (ROI).

  • nVal – The value to add to pDst image pixels

  • nValSqr – The value to add to pSqr image pixels

  • nppStreamCtxApplication Managed Stream Context.

Returns

Image Data Related Error Codes, ROI Related Error Codes

NppStatus nppiSqrIntegral_8u32f64f_C1R_Ctx(const Npp8u *pSrc, int nSrcStep, Npp32f *pDst, int nDstStep, Npp64f *pSqr, int nSqrStep, NppiSize oSrcROI, Npp32f nVal, Npp64f nValSqr, NppStreamContext nppStreamCtx)

One-channel 8-bit unsigned image SqrIntegral.

Destination integral image is 32-bit floating point. Destination square integral image is 64-bit double floating point.

Parameters
  • pSrc – Source-Image Pointer.

  • nSrcStep – Source-Image Line Step.

  • pDst – Destination-Image Pointer.

  • nDstStep – Destination-Image Line Step.

  • pSqr – Destination-Image Pointer.

  • nSqrStep – Destination-Image Line Step.

  • oSrcROIRegion-of-Interest (ROI).

  • nVal – The value to add to pDst image pixels

  • nValSqr – The value to add to pSqr image pixels

  • nppStreamCtxApplication Managed Stream Context.

Returns

Image Data Related Error Codes, ROI Related Error Codes

Image RectStdDev

RectStdDev

Primitives for computing the stansdard deviation of the integral images. The function computes the standard deviation of the pixel in the rectangular window with the integral image \(pSrc\) and the squared integral image \(pSqr\), which can be obtained by calling Integral and SqrIntegral.

The standard deviation of the pixel \((j, i)\) can be computed using the formula:

\[pDst(j, i) = \sqrt{max(0, \frac{\sum(SqrIntegral)\cdot N - (\sum(Integral))^2}{N^2})}\]
where \(\sum(SqrIntegral) = pSqr[j+oRect.y+oRect.height, i+oRect.x+oRect.width] - pSqr[j+oRect.y,i+oRect.x+oRect.width] - pSqr[j+oRect.y+oRect.height, i+oRect.x] + pSqr[j+oRect.y, i+oRect.x]\), \(\sum(Integral) = pSrc[j+oRect.y+oRect.height, i+oRect.x+oRect.width] - pSrc[j+oRect.y,i+oRect.x+oRect.width] - pSrc[j+oRect.y+oRect.height, i+oRect.x] + pSrc[j+oRect.y, i+oRect.x]\), \(N = oRect.width \cdot oRect.height\).

The size of the \(pSrc\) and \(pSqr\) should be \((oSizeROI.width + oRect.x + oRect.width, oSizeROI.height + oRect.y + oRect.height).\)

RectStdDev

NppStatus nppiRectStdDev_32f_C1R_Ctx(const Npp32f *pSrc, int nSrcStep, const Npp64f *pSqr, int nSqrStep, Npp32f *pDst, int nDstStep, NppiSize oSizeROI, NppiRect oRect, NppStreamContext nppStreamCtx)

One-channel 32-bit floating point image RectStdDev.

Parameters
  • pSrc – Source-Image Pointer.

  • nSrcStep – Source-Image Line Step.

  • pSqr – Destination-Image Pointer.

  • nSqrStep – Destination-Image Line Step.

  • pDst – Destination-Image Pointer.

  • nDstStep – Destination-Image Line Step.

  • oSizeROIRegion-of-Interest (ROI).

  • oRect – rectangular window

  • nppStreamCtxApplication Managed Stream Context.

Returns

Image Data Related Error Codes, ROI Related Error Codes

NppStatus nppiRectStdDev_32s_C1RSfs_Ctx(const Npp32s *pSrc, int nSrcStep, const Npp32s *pSqr, int nSqrStep, Npp32s *pDst, int nDstStep, NppiSize oSizeROI, NppiRect oRect, int nScaleFactor, NppStreamContext nppStreamCtx)

One-channel 32-bit signed image RectStdDev, scaled by \(2^(-nScaleFactor)\).

Parameters
Returns

Image Data Related Error Codes, ROI Related Error Codes

NppStatus nppiRectStdDev_32s32f_C1R_Ctx(const Npp32s *pSrc, int nSrcStep, const Npp64f *pSqr, int nSqrStep, Npp32f *pDst, int nDstStep, NppiSize oSizeROI, NppiRect oRect, NppStreamContext nppStreamCtx)

One-channel 32-bit signed image RectStdDev.

Parameters
  • pSrc – Source-Image Pointer.

  • nSrcStep – Source-Image Line Step.

  • pSqr – Destination-Image Pointer.

  • nSqrStep – Destination-Image Line Step.

  • pDst – Destination-Image Pointer.

  • nDstStep – Destination-Image Line Step.

  • oSizeROIRegion-of-Interest (ROI).

  • oRect – rectangular window

  • nppStreamCtxApplication Managed Stream Context.

Returns

Image Data Related Error Codes, ROI Related Error Codes

Image Histogram Even

HistogramEven

Primitives for computing the histogram of an image with evenly distributed bins.

HistogramEven

The \(nLowerLevel\) (inclusive) and \(nUpperLevel\) (exclusive) define the boundaries of the range, which are evenly segmented into \(nLevel - 1\) bins.

The computed histogram is stored in \(pHist\). The levels are calculated by another primitive nppiEvenLevelsHost_32s and are stored in a host pointer \(hpLevels\). The number of levels is also \(nLevel - 1\). The histogram \(pHist[k]\) is defined as the total number of pixels that fall into the range: \(hpLevels[k] <= pSrc(j, i) < hpLevels[k+1]\). The functions require additional scratch buffer for computations.

Common parameters for nppiHistogramEven functions include:

Supported source data types include NPP_8U, NPP_16U, NPP_16S. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

param eSrcType

source image_data_type.

param eSrcChannels

image_channels, alpha channel is ignored for NPP_CH_A4.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pHist

Pointer to array of at least pLevels-1 of eSrcDstChannels per level that receives the computed histogram.

param pLevels

Pointer to array of nLevelCounts of eSrcDstChannels.

param pLowerLevel

Pointer to lower boundary of lowest level bin of eSrcDstChannels.

param pUpperLevel

Pointer to upper boundary of highest level bin of eSrcDstChannels.

param pBuffer

Pointer to appropriately sized scratch buffer.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes.

NppStatus nppiEvenLevelsHost_32s(Npp32s *hpLevels, int nLevels, Npp32s nLowerLevel, Npp32s nUpperLevel)

Compute levels with even distribution.

Parameters
  • hpLevels – A host pointer to array which receives the levels being computed. The array needs to be of size nLevels.

  • nLevels – The number of levels being computed. nLevels must be at least 2.

  • nLowerLevel – Lower boundary value of the lowest level.

  • nUpperLevel – Upper boundary value of the greatest level.

Returns

image_data_error_codes, or NPP_HISTO_NUMBER_OF_LEVELS_ERROR if an invalid nLevels is specified.

NppStatus nppiHistogramEven_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc, int nSrcStep, NppiSize oSizeROI, Npp32s **pHist, int *pLevels, Npp32s *pLowerLevels, Npp32s *pUpperLevels, Npp8u *pBuffer, NppStreamContext nppStreamCtx)

Image HistogramEven.

For common parameter descriptions, see Common parameters for nppiHistogramEven functions include:.

HistogramEvenGetBufferSize

Companion primitives for computing the device buffer size (in bytes) required by the HistogramEven primitives.

Common parameters for nppiHistogramEvenGetBufferSize functions include:

param eSrcType

source image_data_type.

param eSrcChannels

source image number of channels.

param oSizeROI

Region-of-Interest (ROI).

param pLevels

Pointer to array of number of levels in the histogram for each eSrcChannels.

param hpBufferSize

Required buffer size. Important: hpBufferSize is a host pointer. Scratch Buffer and Host Pointer.

param nppStreamCtx

Application Managed Stream Context.

return

NPP_NULL_POINTER_ERROR if hpBufferSize is 0 (NULL), ROI Related Error Codes..

NppStatus nppiHistogramEvenGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *pLevels, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiHistogramEven.

For common parameter descriptions, see Common parameters for nppiHistogramEvenGetBufferSize functions include:.

Image Histogram Range

HistogramRange

Primitives for computing the histogram of an image within specified ranges.

HistogramRange

The histogram is computed according to the ranges provided in \(pLevels\).

The histogram \(pHist[k]\) is defined as the total number of pixels that fall into the range: \(pLevels[k] <= pSrc(j, i) < pLevels[k+1]\). The number of the histogram bins is \(nLevel - 1\). The functions require additional scratch buffer for computations.

NppStatus nppiHistogramRange_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc, int nSrcStep, NppiSize oSizeROI, Npp32s **pHist, Npp32s **pLevels, int *pLevelsCount, Npp8u *pBuffer, NppStreamContext nppStreamCtx)

Image HistogramRange.

For common parameter descriptions, see Common parameters for nppiHistogramEven functions include:.

NppStatus nppiHistogramRange_32f_Ctx(NppiChannels eSrcChannels, const Npp32f *pSrc, int nSrcStep, NppiSize oSizeROI, Npp32s **pHist, Npp32f **pLevels, int *pLevelsCount, Npp8u *pBuffer, NppStreamContext nppStreamCtx)

32-bit floating point HistogramRange_32f.

For common parameter descriptions, see Common parameters for nppiHistogramEven functions include:.

HistogramRangeGetBufferSize

Companion primitives for computing the device buffer size (in bytes) required by the HistogramRange primitives.

NppStatus nppiHistogramRangeGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *pLevels, int *hpBufferSize, NppStreamContext nppStreamCtx)

Scratch-buffer size for nppiHistogramRange.

Supported data types include NPP_8U, NPP_16U, NPP_16S, NPP_32F.

Parameters
  • eSrcType – source image_data_type.

  • eSrcChannels – source image number of channels.

  • oSizeROIRegion-of-Interest (ROI).

  • pLevels – Pointer to array of number of levels in the histogram for each eSrcDstChannels.

  • hpBufferSize – Host memory pointer to required byte count value.

  • nppStreamCtxApplication Managed Stream Context.

Returns

NPP_NULL_POINTER_ERROR if hpBufferSize is 0 (NULL), ROI Related Error Codes.. For common parameter descriptions, see Common parameters for nppiHistogramEvenGetBufferSize functions include:.

Image Proximity

Image Proximity

Primitives for computing the proximity measure between a source image and a template image.

General Introduction

There are basically two approaches to compute the proximity measure for template matching, Euclidean distance and the cross correlation.

  1. Euclidean distance computes the sum of the squared distance (SSD) between the corresponding pixels of the source image and the template image. The smaller the distance is, the more similar the source image and the template image is around the pixel. The anchor of the template

    image is used during the computations, which always lies in the gemotric center of the image. Given a source image

    \(pSrc\) ( \(W_s \times H_s\)) and a template image \(pTpl\) ( \(W_t \times H_t\)), the Euclidean distance \(D_{st}(c,r)\) between two images at pixel in row \(r\) and column \(c\) is computed as ( \(s\) stands for source image and \(t\) for template image for short):
    \[D_{st}(c,r)=\sum_{j=0}^{H_t-1}\sum_{i=0}^{W_t-1}[pTpl(j,i)-pSrc(j+c-\frac{H_t}{2}, i+r-\frac{W_t}{2})]^2 \]
  2. Cross correlation computes the sum of the product between the corresponding pixels of the source image and the template image. The cross correlation \(R_{st}(c,r)\) is calculated as:

    \[R_{st}(c,r)=\sum_{j=0}^{H_t-1}\sum_{i=0}^{W_t-1}[pTpl(j,i)\cdot pSrc(j+c-\frac{H_t}{2}, i+r-\frac{W_t}{2})] \]
    The larger the cross correlation value is, the more similar the source image and the template image is around the pixel.
  3. The cross correlation \(R_{st}(c,r)\) is affected by the brightness of the images which may vary due to the lighting and exposure conditions. Therefore, NPP computes the cross correlation coefficient to circumvent this dependence. This is typically done at every step by subtracting the mean from every pixel value, i.e.,

    \[\tilde{R}_{st}(c,r)=\sum_{j=0}^{H_t-1}\sum_{i=0}^{W_t-1}[pTpl(j,i)-Mean_t]\cdot [pSrc(j+c-\frac{H_t}{2}, i+r-\frac{W_t}{2})-Mean_s] \]

NPP computes the normalized values of Euclidean distance, cross correlation and the cross correlation coefficient.

  1. The normalized Euclidean distance \(\sigma_{st}(c,r)\) is defined as:

    \[\sigma_{st}(c,r) = \frac{D_{st}(c,r)}{\sqrt{R_{ss}(c,r)\cdot R_{tt}(\frac{H_t}{2},\frac{W_t}{2})}} \]
  2. The normalized cross correlation \(\rho_{st}(c,r)\) is defined as:

    \[\rho_{st}(c,r) = \frac{R_{st}(c,r)}{\sqrt{R_{ss}(c,r)\cdot R_{tt}(\frac{H_t}{2},\frac{W_t}{2})}} \]
    The \(R_{ss}(c,r)\) and \(R_{tt}(\frac{H_t}{2}, \frac{W_t}{2}\) denote the auto correlation of the source image and the template image individually. They are defined as:
    \[R_{ss}(c,r)=\sum_{j=c-\frac{H_t}{2}}^{c+\frac{H_t}{2}}\sum_{i=r-\frac{W_t}{2}}^{r+\frac{W_t}{2}}pSrc(j, i) \]
    \[R_{tt}(\frac{H_t}{2},\frac{W_t}{2})=\sum_{j=0}^{H_t-1}\sum_{i=0}^{W_t-1}pTpl(j,i) \]
  3. Similarly, the normalized cross correlation coefficient \(\gamma_{st}(c,r)\) is calculated as:

    \[\gamma_{st}(c,r) = \frac{\tilde{R}_{st}(c,r)}{\sqrt{\tilde{R}_{ss}(c,r)\cdot \tilde{R}_{tt}(\frac{H_t}{2},\frac{W_t}{2})}} \]
    The \(\tilde{R}_{ss}(c,r)\) and \(\tilde{R}_{tt}(\frac{H_t}{2}, \frac{W_t}{2}\) are defined as:
    \[\tilde{R}_{ss}(c,r)=\sum_{j=c-\frac{H_t}{2}}^{c+\frac{H_t}{2}}\sum_{i=r-\frac{W_t}{2}}^{r+\frac{W_t}{2}}[pSrc(j, i)-Mean_s] \]
    \[\tilde{R}_{tt}(\frac{H_t}{2},\frac{W_t}{2})=\sum_{j=0}^{H_t-1}\sum_{i=0}^{W_t-1}[pTpl(j,i)-Mean_t] \]
    where \(Mean_t\) is the template mean minus the mean of the image in the region just under the template.

Categorizations

The Euclidean distance and the cross correlation are categorized into three types, full, same, and valid.

  1. Full mode indicates that the anchor of the template image starts from the outside of the source image, assuming the out-of-boundary pixels are zeor-padded. The size of the destination image is \((W_s + W_t - 1) \times (H_s + H_t - 1)\).

  2. Same mode means that the anchor of the template image starts from the top left pixel of the source image. All the out-of-boundary pixels are also zero-padded. The size of the destination image is the same as the source one, i.e., \(W_s \times H_s\).

  3. Valid mode indicates that there are no out-of-boudnary readings from the source image. The anchor of the template image starts from the inside of the source image. The size of the destination image is \((W_s - W_t + 1) \times (H_s - H_t + 1)\).

Image Square Distance Full Norm

SqrDistanceFull_Norm

Primitives for computing the normalized Euclidean distance between two images with full mode.

SqrDistanceFull_Norm

The functions compute the \(\sigma_{st}(c,r)\) in General Introduction with full mode (see Categorizations).

Common parameters for nppiSqrDistanceFull functions include:

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

param eSrcType

source and template image_data_type.

param eDstType

destination image_data_type.

param eSrcDstChannels

image_channels, alpha channel is ignored for NPP_CH_A4.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcRoiSize

Region-of-Interest (ROI).

param pTpl

Pointer to the template image.

param nTplStep

Number of bytes between successive rows in the template image.

param oTplRoiSize

Region-of-Interest (ROI).

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param nScaleFactor

Integer Result Scaling.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

NppStatus nppiSqrDistanceFull_Norm_8u_Sfs_Ctx(NppiChannels eSrcDstChannels, const Npp8u *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const Npp8u *pTpl, int nTplStep, NppiSize oTplRoiSize, Npp8u *pDst, int nDstStep, int nScaleFactor, NppStreamContext nppStreamCtx)

Image SqrDistanceFull_Norm, scaled by \(2^(-nScaleFactor)\).

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:.

NppStatus nppiSqrDistanceFull_Norm_Ctx(NppDataType eSrcType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const void *pTpl, int nTplStep, NppiSize oTplRoiSize, Npp32f *pDst, int nDstStep, NppStreamContext nppStreamCtx)

Image SqrDistanceFull_Norm.

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:.

Image Square Distance Same Norm

SqrDistanceSame_Norm

Primitives for computing the normalized Euclidean distance between two images with same mode.

SqrDistanceSame_Norm

The functions compute the \(\sigma_{st}(c,r)\) in General Introduction with same mode (see Categorizations).

NppStatus nppiSqrDistanceSame_Norm_8u_Sfs_Ctx(NppiChannels eSrcDstChannels, const Npp8u *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const Npp8u *pTpl, int nTplStep, NppiSize oTplRoiSize, Npp8u *pDst, int nDstStep, int nScaleFactor, NppStreamContext nppStreamCtx)

Image SqrDistanceSame_Norm, scaled by \(2^(-nScaleFactor)\).

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:.

NppStatus nppiSqrDistanceSame_Norm_Ctx(NppDataType eSrcType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const void *pTpl, int nTplStep, NppiSize oTplRoiSize, Npp32f *pDst, int nDstStep, NppStreamContext nppStreamCtx)

Image SqrDistanceSame_Norm.

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:.

Image Square Distance Valid Norm

SqrDistanceValid_Norm

Primitives for computing the normalized Euclidean distance between two images with valid mode.

SqrDistanceValid_Norm

The functions compute the \(\sigma_{st}(c,r)\) in General Introduction with valid mode (see Categorizations).

NppStatus nppiSqrDistanceValid_Norm_8u_Sfs_Ctx(NppiChannels eSrcDstChannels, const Npp8u *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const Npp8u *pTpl, int nTplStep, NppiSize oTplRoiSize, Npp8u *pDst, int nDstStep, int nScaleFactor, NppStreamContext nppStreamCtx)

Image SqrDistanceValid_Norm, scaled by \(2^(-nScaleFactor)\).

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:.

NppStatus nppiSqrDistanceValid_Norm_Ctx(NppDataType eSrcType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const void *pTpl, int nTplStep, NppiSize oTplRoiSize, Npp32f *pDst, int nDstStep, NppStreamContext nppStreamCtx)

Image SqrDistanceValid_Norm.

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:.

Image Cross Correlation Full Norm

CrossCorrFull_Norm

Primitives for computing the normalized cross correlation between two images with full mode.

CrossCorrFull_Norm

The functions compute the \(\rho_{st}(c,r)\) in General Introduction with full mode (see Categorizations).

NppStatus nppiCrossCorrFull_Norm_8u_Sfs_Ctx(NppiChannels eSrcDstChannels, const Npp8u *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const Npp8u *pTpl, int nTplStep, NppiSize oTplRoiSize, Npp8u *pDst, int nDstStep, int nScaleFactor, NppStreamContext nppStreamCtx)

Image CrossCorrFull_Norm, scaled by \(2^(-nScaleFactor)\).

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:. Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

Parameters

eSrcDstChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

NppStatus nppiCrossCorrFull_Norm_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const void *pTpl, int nTplStep, NppiSize oTplRoiSize, void *pDst, int nDstStep, NppStreamContext nppStreamCtx)

Image CrossCorrFull_Norm with NPP_32F and NPP_64F output supported.

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:. Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

Parameters
  • eSrcType – source and template image_data_type.

  • eDstType – destination image_data_type.

  • eSrcDstChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

Image Cross Correlation Same Norm

CrossCorrSame_Norm

Primitives for computing the normalized cross correlation between two images with same mode.

CrossCorrSame_Norm

The functions compute the \(\rho_{st}(c,r)\) in General Introduction with same mode (see Categorizations).

NppStatus nppiCrossCorrSame_Norm_8u_Sfs_Ctx(NppiChannels eSrcDstChannels, const Npp8u *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const Npp8u *pTpl, int nTplStep, NppiSize oTplRoiSize, Npp8u *pDst, int nDstStep, int nScaleFactor, NppStreamContext nppStreamCtx)

Image CrossCorrSame_Norm, scaled by \(2^(-nScaleFactor)\).

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

Parameters

eSrcDstChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

NppStatus nppiCrossCorrSame_Norm_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const void *pTpl, int nTplStep, NppiSize oTplRoiSize, void *pDst, int nDstStep, NppStreamContext nppStreamCtx)

Image CrossCorrSame_Norm with NPP_32F and NPP_64F support.

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:. Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_32F.

Parameters
  • eSrcType – source and template image_data_type.

  • eDstType – destination image_data_type.

  • eSrcDstChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

Image Cross Correlation Valid Norm

CrossCorrValid_Norm

Primitives for computing the normalized cross correlation between two images with valid mode.

CrossCorrValid_Norm

The functions compute the \(\rho_{st}(c,r)\) in General Introduction with valid mode (see Categorizations).

NppStatus nppiCrossCorrValid_Norm_8u_Sfs_Ctx(NppiChannels eSrcDstChannels, const Npp8u *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const Npp8u *pTpl, int nTplStep, NppiSize oTplRoiSize, Npp8u *pDst, int nDstStep, int nScaleFactor, NppStreamContext nppStreamCtx)

Image CrossCorrValid_Norm, scaled by \(2^(-nScaleFactor)\).

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

Parameters

eSrcDstChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

NppStatus nppiCrossCorrValid_Norm_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const void *pTpl, int nTplStep, NppiSize oTplRoiSize, void *pDst, int nDstStep, NppStreamContext nppStreamCtx)

Image CrossCorrValid_Norm with NPP_32F and NPP_64F support.

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:. Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_32F.

Parameters
  • eSrcType – source and template image_data_type.

  • eDstType – destination image_data_type.

  • eSrcDstChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

Image Cross Correlation Valid

CrossCorrValid

Primitives for computing the cross correlation between two images with valid mode.

CrossCorrValid

The functions compute the \(R_{st}(c,r)\) in General Introduction with valid mode (see Categorizations).

NppStatus nppiCrossCorrValid_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const void *pTpl, int nTplStep, NppiSize oTplRoiSize, void *pDst, int nDstStep, NppStreamContext nppStreamCtx)

Image CrossCorrValid with NPP_32F and NPP_64F output support (not normalized).

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:.

Image Cross Correlation Full Norm Level

CrossCorrFull_NormLevel

Primitives for computing the normalized cross correlation coefficient between two images with full mode.

CrossCorrFull_NormLevel

The functions compute the \(\gamma_{st}(c,r)\) in General Introduction with full mode (see Categorizations).

The functions require additional scratch buffer for computations.

Note: For maximum performance oSrcRoiSize.width + oTplRoiSize.width - 1 MUST be an integer multiple of 4.

NppStatus nppiCrossCorrFull_NormLevel_8u_Sfs_Ctx(NppiChannels eSrcDstChannels, const Npp8u *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const Npp8u *pTpl, int nTplStep, NppiSize oTplRoiSize, Npp8u *pDst, int nDstStep, int nScaleFactor, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image CrossCorrFull_NormLevel, scaled by \(2^(-nScaleFactor)\).

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

Parameters

eSrcDstChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

NppStatus nppiCrossCorrFull_NormLevel_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const void *pTpl, int nTplStep, NppiSize oTplRoiSize, void *pDst, int nDstStep, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image CrossCorrFull_NormLevel with NPP_32F and NPP_64F output.

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:. Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_32F.

Parameters
  • eSrcType – source and template image_data_type.

  • eDstType – destination image_data_type.

  • eSrcDstChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

FullNormLevelGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the CrossCorrFull_NormLevel primitives.

NppStatus nppiFullNormLevelGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcDstChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size (in bytes) for nppiCrossCorrFull_NormLevel.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_32F, NPP_64F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

Parameters
  • eSrcType – source and template image_data_type.

  • eSrcDstChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

  • oSizeROIRegion-of-Interest (ROI).

  • hpBufferSize – Host memory pointer to required byte count value.

  • nppStreamCtxApplication Managed Stream Context. For common parameter descriptions, see CommonGetBufferHostSizeParameters.

Image Cross Correlation Same Norm Level

CrossCorrSame_NormLevel

Primitives for computing the normalized cross correlation coefficient between two images with same mode.

CrossCorrSame_NormLevel

The functions compute the \(\gamma_{st}(c,r)\) in General Introduction with same mode (see Categorizations).

The functions require additional scratch buffer for computations.

Note: For maximum performance oSrcRoiSize.width MUST be an integer multiple of 4.

NppStatus nppiCrossCorrSame_NormLevel_8u_Sfs_Ctx(NppiChannels eSrcDstChannels, const Npp8u *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const Npp8u *pTpl, int nTplStep, NppiSize oTplRoiSize, Npp8u *pDst, int nDstStep, int nScaleFactor, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image CrossCorrSame_NormLevel, scaled by \(2^(-nScaleFactor)\).

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

NppStatus nppiCrossCorrSame_NormLevel_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const void *pTpl, int nTplStep, NppiSize oTplRoiSize, void *pDst, int nDstStep, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image CrossCorrSame_NormLevel with NPP_32F and NPP_64F output.

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:. Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_32F.

Parameters
  • eSrcType – source and template image_data_type.

  • eDstType – destination image_data_type.

  • eSrcDstChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

SameNormLevelGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the CrossCorrSame_NormLevel primitives.

NppStatus nppiSameNormLevelGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcDstChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size (in bytes) for nppiCrossCorrSame_NormLevel.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_32F, NPP_64F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

Parameters
  • eSrcType – source and template image_data_type.

  • eSrcDstChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

  • oSizeROIRegion-of-Interest (ROI).

  • hpBufferSize – Host memory pointer to required byte count value.

  • nppStreamCtxApplication Managed Stream Context. For common parameter descriptions, see CommonGetBufferHostSizeParameters.

Image Cross Correlation Valid Norm Level

CrossCorrValid_NormLevel

Primitives for computing the normalized cross correlation coefficient between two images with valid mode.

CrossCorrValid_NormLevel

The functions compute the \(\gamma_{st}(c,r)\) in General Introduction with valid mode (see Categorizations).

The functions require additional scratch buffer for computations.

Note: For maximum performance oSrcRoiSize.width - oTplRoiSize + 1 MUST be an integer multiple of 4.

NppStatus nppiCrossCorrValid_NormLevel_8u_Sfs_Ctx(NppiChannels eSrcDstChannels, const Npp8u *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const Npp8u *pTpl, int nTplStep, NppiSize oTplRoiSize, Npp8u *pDst, int nDstStep, int nScaleFactor, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image CrossCorrValid_NormLevel, scaled by \(2^(-nScaleFactor)\).

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

NppStatus nppiCrossCorrValid_NormLevel_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const void *pTpl, int nTplStep, NppiSize oTplRoiSize, void *pDst, int nDstStep, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image CrossCorrValid_NormLevel with NPP_32F and NPP_64F output.

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:. Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_32F, NPP_64F.

Parameters
  • eSrcType – source and template image_data_type.

  • eDstType – destination image_data_type.

  • eSrcDstChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

ValidNormLevelGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the CrossCorrValid_NormLevel primitives.

NppStatus nppiValidNormLevelGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcDstChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size (in bytes) for nppiCrossCorrValid_NormLevel.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_32F, NPP_64F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4, NPP_CH_A4.

Parameters
  • eSrcType – source and template image_data_type.

  • eSrcDstChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

  • oSizeROIRegion-of-Interest (ROI).

  • hpBufferSize – Host memory pointer to required byte count value.

  • nppStreamCtxApplication Managed Stream Context. For common parameter descriptions, see CommonGetBufferHostSizeParameters.

Image Cross Correlation Full Norm Level Advanced

CrossCorrFull_NormLevelAdvanced

Primitives for computing the normalized cross correlation coefficient between two images with full mode with large image template sizes.

CrossCorrFull_NormLevelAdvanced

The functions compute the \(\gamma_{st}(c,r)\) in General Introduction with full mode (see Categorizations).

The functions require an additional scratch buffer and advanced scratch buffer for computations.

Note: For maximum performance oSrcRoiSize.width + oTplRoiSize.width - 1 MUST be an integer multiple of 4.

NppStatus nppiCrossCorrFull_NormLevelAdvanced_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const void *pTpl, int nTplStep, NppiSize oTplRoiSize, void *pDst, int nDstStep, Npp8u *pDeviceBuffer, Npp8u *pAdvancedScratchBuffer, NppStreamContext nppStreamCtx)

Image CrossCorrFull_NormLevelAdvanced with NPP_32F and NPP_64F output.

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:. Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_32F, NPP_64F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4.

Parameters
  • eSrcType – source and template image_data_type.

  • eDstType – destination image_data_type.

  • eSrcDstChannels – number of channels.

FullNormLevelGetAdvancedScratchBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the CrossCorrFull_NormLevelAdvanced primitives.

NppStatus nppiCrossCorrFull_NormLevel_GetAdvancedScratchBufferSize(NppiSize oSrcRoiSize, NppiSize oTplRoiSize, int nSizeofDstData, int nSrcChannels, int *hpBufferSize)

Buffer size (in bytes) for nppiCrossCorrFull_NormLevelAdvanced functions.

Parameters
Returns

Image Data Related Error Codes, ROI Related Error Codes

Image Cross Correlation Same Norm Level Advanced

CrossCorrSame_NormLevelAdvanced

Primitives for computing the normalized cross correlation coefficient between two images with same mode with large image template sizes.

CrossCorrSame_NormLevelAdvanced

The functions compute the \(\gamma_{st}(c,r)\) in General Introduction with same mode (see Categorizations).

The functions require and additional scratch buffer and advanced scratch buffer for computations.

Note: For maximum performance oSrcRoiSize.width MUST be an integer multiple of 4.

NppStatus nppiCrossCorrSame_NormLevelAdvanced_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const void *pTpl, int nTplStep, NppiSize oTplRoiSize, void *pDst, int nDstStep, Npp8u *pDeviceBuffer, Npp8u *pAdvancedScratchBuffer, NppStreamContext nppStreamCtx)

Image CrossCorrSame_NormLevelAdvanced with NPP_32F and NPP_64F output.

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:. Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_32F, NPP_64F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4.

Parameters
  • eSrcType – source and template image_data_type.

  • eDstType – destination image_data_type.

  • eSrcDstChannels – number of channels.

SameNormLevelGetAdvancedScratchBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the CrossCorrSame_NormLevelAdvanced primitives.

NppStatus nppiCrossCorrSame_NormLevel_GetAdvancedScratchBufferSize(NppiSize oSrcRoiSize, NppiSize oTplRoiSize, int nSizeofDstData, int nSrcChannels, int *hpBufferSize)

Buffer size (in bytes) for nppiCrossCorrSame_NormLevelAdvanced functions.

Parameters
Returns

Image Data Related Error Codes, ROI Related Error Codes

Image Cross Correlation Valid Norm Level Advanced

CrossCorrValid_NormLevelAdvanced

Primitives for computing the normalized cross correlation coefficient between two images with valid mode with large template sizes.

CrossCorrValid_NormLevelAdvanced

The functions compute the \(\gamma_{st}(c,r)\) in General Introduction with valid mode (see Categorizations).

The functions require an additional scratch buffer and advanced scratch buffer for computations.

Note: For maximum performance oSrcRoiSize.width - oTplRoiSize + 1 MUST be an integer multiple of 4.

NppStatus nppiCrossCorrValid_NormLevelAdvanced_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcRoiSize, const void *pTpl, int nTplStep, NppiSize oTplRoiSize, void *pDst, int nDstStep, Npp8u *pDeviceBuffer, Npp8u *pAdvancedScratchBuffer, NppStreamContext nppStreamCtx)

Image CrossCorrValid_NormLevelAdvanced with NPP_32F and NPP_64F output.

For common parameter descriptions, see Common parameters for nppiSqrDistanceFull functions include:. Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_32F, NPP_64F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_4.

Parameters
  • eSrcType – source and template image_data_type.

  • eDstType – destination image_data_type.

  • eSrcDstChannels – number of channels.

ValidNormLevelGetAdvancedScratchBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the CrossCorrValid_NormLevelAdvanced primitives.

NppStatus nppiCrossCorrValid_NormLevel_GetAdvancedScratchBufferSize(NppiSize oSrcRoiSize, NppiSize oTplRoiSize, int nSizeofDstData, int nSrcChannels, int *hpBufferSize)

Buffer size (in bytes) for nppiCrossCorrValid_NormLevelAdvanced functions.

Parameters
Returns

Image Data Related Error Codes, ROI Related Error Codes

Image Quality Index

Image Quality Index

Primitives for computing the image quality index of two images.

QualityIndex

Given two images \(M\) and \(N\) (both \(W \times H\)), the mathematical formula to calculate the image quality index \(Q\) between them is expressed as:

\[Q = \frac{4\sigma_{MN}\tilde{M}\tilde{N}}{[(\tilde{M}^2)+(\tilde{N}^2)][(\sigma_M)^2+(\sigma_N)^2]} \]
where
\[\tilde{M} = \frac{1}{W\cdot H}\sum_{j=0}^{H-1}\sum_{i=0}^{W-1}M(j,i)\]
\[\tilde{N} = \frac{1}{W\cdot H}\sum_{j=0}^{H-1}\sum_{i=0}^{W-1}N(j,i)\]
\[\sigma_{M} = \sqrt{\frac{1}{W\cdot H-1}\sum_{j=0}^{H-1}\sum_{i=0}^{W-1}[M(j,i)-\tilde{M}]^2}\]
\[\sigma_{N} = \sqrt{\frac{1}{W\cdot H-1}\sum_{j=0}^{H-1}\sum_{i=0}^{W-1}[N(j,i)-\tilde{N}]^2}\]
\[\sigma_{MN} = \frac{1}{W\cdot H-1}\sum_{j=0}^{H-1}\sum_{i=0}^{W-1}[M(j,i)-\tilde{M}][N(j,i)-\tilde{N}]\]
The functions require additional scratch buffer for computations.

Common parameters for nppiQualityIndex functions include:

Supported data types include NPP_8U, NPP_16U, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_A4.

param eSrcType

source image_data_type.

param eSrcDstChannels

image_channels, alpha channel is ignored for NPP_CH_A4.

param pSrc1

Source-Image Pointer.

param nSrc1Step

Source-Image Line Step.

param pSrc2

Source-Image Pointer.

param nSrc2Step

Source-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pDst

Pointer to the quality index.

param pDeviceBuffer

Pointer to the required device memory allocation, Scratch Buffer and Host Pointer.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes, or NPP_QUALITY_INDEX_ERROR if pixels of either image are constant numberse.

NppStatus nppiQualityIndex_Ctx(NppDataType eSrcType, NppiChannels eSrcDstChannels, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, NppiSize oSizeROI, Npp32f *pDst, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image QualityIndex.

For common parameter descriptions, see Common parameters for nppiQualityIndex functions include:.

QualityIndexGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the QualityIndex primitives.

NppStatus nppiQualityIndexGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size (in bytes) for nppiQualityIndex.

Supported data types include NPP_8U, NPP_16U, NPP_32F. Supported channel counts include NPP_CH_1, NPP_CH_3, NPP_CH_A4.

Parameters
  • eSrcType – source image_data_type.

  • eSrcChannels – image_channels, alpha channel is ignored for NPP_CH_A4.

  • oSizeROIRegion-of-Interest (ROI).

  • hpBufferSize – Host memory pointer to required byte count value.

  • nppStreamCtxApplication Managed Stream Context. For common parameter descriptions, see CommonGetBufferHostSizeParameters.

Image Maximum Error

MaximumError

Primitives for computing the maximum error between two images. Given two images \(pSrc1\) and \(pSrc2\) both with width \(W\) and height \(H\), the maximum error is defined as the largest absolute difference between pixels of two images. If the image is in complex format, the absolute value of the complex number is provided.

Common parameters for nppiMaximumError functions include:

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32U, NPP_32S, NPP_32F, NPP_64F. Supported channel counts include NPP_CH_1, NPP_CH_2, NPP_CH_3, NPP_CH_4.

param eSrcType

source image_data_type.

param eSrcChannels

image_channels.

param pSrc1

Source-Image Pointer.

param nSrc1Step

Source-Image Line Step.

param pSrc2

Source-Image Pointer.

param nSrc2Step

Source-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pError

Pointer to the computed error.

param pDeviceBuffer

Pointer to the required device memory allocation, Scratch Buffer and Host Pointer.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes.

MaximumError

NppStatus nppiMaximumError_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, NppiSize oSizeROI, Npp64f *pError, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image Maximum_Error.

For common parameter descriptions, see Common parameters for nppiMaximumError functions include:.

MaximumErrorGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the MaximumError primitives.

NppStatus nppiMaximumErrorGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiMaximumError.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32U, NPP_32S, NPP_32F, NPP_64F. Supported channel counts include NPP_CH_1, NPP_CH_2, NPP_CH_3, NPP_CH_4.

Parameters
  • eSrcType – source image_data_type.

  • eSrcChannels – image_channels.

  • oSizeROIRegion-of-Interest (ROI).

  • hpBufferSize – Host memory pointer to required byte count value.

  • nppStreamCtxApplication Managed Stream Context. For common parameter descriptions, see CommonGetBufferHostSizeParameters.

Image Average Error

AverageError

Primitives for computing the average error between two images. Given two images \(pSrc1\) and \(pSrc2\) both with width \(W\) and height \(H\), the average error is defined as:

\[Average Error = \frac{1}{W\cdot H\cdot N}\sum_{n=0}^{N-1}\sum_{j=0}^{H-1}\sum_{i=0}^{W-1}\left|pSrc1(j,i) - pSrc2(j,i)\right|\]
where N stands for the number of channels. If the image is in complex format, the absolute value is used for computation.

AverageError

NppStatus nppiAverageError_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, NppiSize oSizeROI, Npp64f *pError, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image Average_Error.

For common parameter descriptions, see Common parameters for nppiMaximumError functions include:. Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32U, NPP_32S, NPP_32F, NPP_64F. Supported channel counts include NPP_CH_1, NPP_CH_2, NPP_CH_3, NPP_CH_4.

Parameters
  • eSrcType – source image_data_type.

  • eSrcChannels – image_channels.

  • pSrc1 – Source-Image Pointer.

  • nSrc1Step – Source-Image Line Step.

  • pSrc2 – Source-Image Pointer.

  • nSrc2Step – Source-Image Line Step.

  • oSizeROIRegion-of-Interest (ROI).

  • pError – Pointer to the computed error.

  • pDeviceBuffer – Pointer to the required device memory allocation, Scratch Buffer and Host Pointer.

  • nppStreamCtxApplication Managed Stream Context.

AverageErrorGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the NormDiff_Inf primitives.

NppStatus nppiAverageErrorGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiAverageError.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32U, NPP_32S, NPP_32F, NPP_64F. Supported channel counts include NPP_CH_1, NPP_CH_2, NPP_CH_3, NPP_CH_4.

Parameters
  • eSrcType – source image_data_type.

  • eSrcChannels – image_channels.

  • oSizeROIRegion-of-Interest (ROI).

  • hpBufferSize – Host memory pointer to required byte count value.

  • nppStreamCtxApplication Managed Stream Context. For common parameter descriptions, see CommonGetBufferHostSizeParameters.

Image Maximum Relative Error

MaximumRelativeError

Primitives for computing the maximum relative error between two images. Given two images \(pSrc1\) and \(pSrc2\) both with width \(W\) and height \(H\), the maximum relative error is defined as:

\[MaximumRelativeError = max{\frac{\left|pSrc1(j,i) - pSrc2(j,i)\right|}{max(\left|pSrc1(j,i)\right|, \left|pSrc2(j,i)\right|)}}\]
If the image is in complex format, the absolute value is used for computation. For multiple channles, the maximum relative error of all the channles is returned.

MaximumRelativeError

NppStatus nppiMaximumRelativeError_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, NppiSize oSizeROI, Npp64f *pError, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image MaximumRelative_Error.

For common parameter descriptions, see Common parameters for nppiMaximumError functions include:. Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32U, NPP_32S, NPP_32F, NPP_64F. Supported channel counts include NPP_CH_1, NPP_CH_2, NPP_CH_3, NPP_CH_4.

Parameters
  • eSrcType – source image_data_type.

  • eSrcChannels – image_channels.

  • pSrc1 – Source-Image Pointer.

  • nSrc1Step – Source-Image Line Step.

  • pSrc2 – Source-Image Pointer.

  • nSrc2Step – Source-Image Line Step.

  • oSizeROIRegion-of-Interest (ROI).

  • pError – Pointer to the computed error.

  • pDeviceBuffer – Pointer to the required device memory allocation, Scratch Buffer and Host Pointer.

  • nppStreamCtxApplication Managed Stream Context.

MaximumRelativeErrorGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the NormDiff_Inf primitives.

NppStatus nppiMaximumRelativeErrorGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiMaximumRelativeError.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32U, NPP_32S, NPP_32F, NPP_64F. Supported channel counts include NPP_CH_1, NPP_CH_2, NPP_CH_3, NPP_CH_4.

Parameters
  • eSrcType – source image_data_type.

  • eSrcChannels – image_channels.

  • oSizeROIRegion-of-Interest (ROI).

  • hpBufferSize – Host memory pointer to required byte count value.

  • nppStreamCtxApplication Managed Stream Context. For common parameter descriptions, see CommonGetBufferHostSizeParameters.

Image Average Relative Error

AverageRelativeError

Primitives for computing the average relative error between two images. Given two images \(pSrc1\) and \(pSrc2\) both with width \(W\) and height \(H\), the maximum relative error is defined as:

\[AverageRelativeError = \frac{1}{W\cdot H\cdot N}\sum_{n=0}^{N-1}\sum_{j=0}^{H-1}\sum_{i=0}^{W-1}\frac{\left|pSrc1(j,i) - pSrc2(j,i)\right|}{max(\left|pSrc1(j,i)\right|, \left|pSrc2(j,i)\right|)}\]
where N is the number of channels. If the image is in complex format, the absolute value is used for computation.

AverageRelativeError

NppStatus nppiAverageRelativeError_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, const void *pSrc1, int nSrc1Step, const void *pSrc2, int nSrc2Step, NppiSize oSizeROI, Npp64f *pError, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image MaximumRelative_Error.

For common parameter descriptions, see Common parameters for nppiMaximumError functions include:. Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32U, NPP_32S, NPP_32F, NPP_64F. Supported channel counts include NPP_CH_1, NPP_CH_2, NPP_CH_3, NPP_CH_4.

Parameters
  • eSrcType – source image_data_type.

  • eSrcChannels – image_channels.

  • pSrc1 – Source-Image Pointer.

  • nSrc1Step – Source-Image Line Step.

  • pSrc2 – Source-Image Pointer.

  • nSrc2Step – Source-Image Line Step.

  • oSizeROIRegion-of-Interest (ROI).

  • pError – Pointer to the computed error.

  • pDeviceBuffer – Pointer to the required device memory allocation, Scratch Buffer and Host Pointer.

  • nppStreamCtxApplication Managed Stream Context.

AverageRelativeErrorGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the NormDiff_Inf primitives.

NppStatus nppiAverageRelativeErrorGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiAverageRelativeError.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32U, NPP_32S, NPP_32F, NPP_64F. Supported channel counts include NPP_CH_1, NPP_CH_2, NPP_CH_3, NPP_CH_4.

Parameters
  • eSrcType – source image_data_type.

  • eSrcChannels – image_channels.

  • oSizeROIRegion-of-Interest (ROI).

  • hpBufferSize – Host memory pointer to required byte count value.

  • nppStreamCtxApplication Managed Stream Context. For common parameter descriptions, see CommonGetBufferHostSizeParameters.

Image Quality Assessment IQA

IQA

Primitives for computing the image quality between two images, such as MSE, PSNR, SSIM, and MS-SSIM.

MSE

NppStatus nppiMSE_8u_C1R_Ctx(const Npp8u *pSrc1, int nSrc1Step, const Npp8u *pSrc2, int nSrc2Step, NppiSize oSizeROI, Npp32f *pMSE, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

One channel 8-bit unsigned image MSE.

Parameters
Returns

Image Data Related Error Codes, ROI Related Error Codes.

NppStatus nppiMSE_8u_C3R_Ctx(const Npp8u *pSrc1, int nSrc1Step, const Npp8u *pSrc2, int nSrc2Step, NppiSize oSizeROI, Npp32f *pMSE, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Three-channel 8-bit unsigned image MSE.

Parameters
Returns

Image Data Related Error Codes, ROI Related Error Codes.

PSNR

NppStatus nppiPSNR_8u_C1R_Ctx(const Npp8u *pSrc1, int nSrc1Step, const Npp8u *pSrc2, int nSrc2Step, NppiSize oSizeROI, Npp32f *pPSNR, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

One channel 8-bit unsigned image PSNR.

Parameters
Returns

Image Data Related Error Codes, ROI Related Error Codes.

NppStatus nppiPSNR_8u_C3R_Ctx(const Npp8u *pSrc1, int nSrc1Step, const Npp8u *pSrc2, int nSrc2Step, NppiSize oSizeROI, Npp32f *pPSNR, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Three-channel 8-bit unsigned image PSNR.

Parameters
Returns

Image Data Related Error Codes, ROI Related Error Codes.

MSEAndPSNRGetBufferHostSize

Companion primitives for computing the device buffer size (in bytes) required by the MSE and PSNR primitives.

NppStatus nppiMSEAndPSNRGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiMSE, and nppiPSNR.

Supported data types include NPP_8U. Supported channel counts include NPP_CH_1, NPP_CH_3.

Parameters
  • eSrcType – source image_data_type.

  • eSrcChannels – image_channels.

  • oSizeROIRegion-of-Interest (ROI).

  • hpBufferSize – Host memory pointer to required byte count value.

  • nppStreamCtxApplication Managed Stream Context. For common parameter descriptions, see CommonGetBufferHostSizeParameters.

SSIM

NppStatus nppiSSIM_8u_C1R_Ctx(const Npp8u *pSrc1, int nSrc1Step, const Npp8u *pSrc2, int nSrc2Step, NppiSize oSizeROI, Npp32f *pSSIM, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

One channel 8-bit unsigned image SSIM.

Parameters
Returns

Image Data Related Error Codes, ROI Related Error Codes.

NppStatus nppiSSIM_8u_C3R_Ctx(const Npp8u *pSrc1, int nSrc1Step, const Npp8u *pSrc2, int nSrc2Step, NppiSize oSizeROI, Npp32f *pSSIM, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Three-channel 8-bit unsigned image SSIM*.

Parameters
Returns

Image Data Related Error Codes, ROI Related Error Codes.

MSSSIM

NppStatus nppiMSSSIM_8u_C1R_Ctx(const Npp8u *pSrc1, int nSrc1Step, const Npp8u *pSrc2, int nSrc2Step, NppiSize oSizeROI, Npp32f *pMSSSIM, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

One channel 8-bit unsigned image MS-SSIM*.

This function will be deprecated in a future release use the nppiWMSSSIM functions instead.

Parameters
Returns

Image Data Related Error Codes, ROI Related Error Codes.

WMSSSIM

NppStatus nppiWMSSSIM_8u_C1R_Ctx(const Npp8u *pSrc1, int nSrc1Step, const Npp8u *pSrc2, int nSrc2Step, NppiSize oSizeROI, Npp32f *pMSSSIM, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

One channel 8-bit unsigned image MS-SSIM*.

This function uses the algorithm described in the paper by Wang et. al. Wang, Z., Simoncelli, E.P., Bovik, A.C. Multiscale Structural Similarity for Image Quality Assessment. In: The Thirty-Seventh Asilomar Conference on Signals, Systems & Computers, 2003, 13981402. Pacific Grove, CA, USA: IEEE,

  1. https://doi.org/10.1109/ACSSC.2003.1292216. NOTE: this API call can only process oSizeROI dimensions 16px by 16px and above. Any oSizeROI dimensions less than 16px by 16px will result in undefined behaviour.

Parameters
Returns

Image Data Related Error Codes, ROI Related Error Codes.

NppStatus nppiWMSSSIM_8u_C3R_Ctx(const Npp8u *pSrc1, int nSrc1Step, const Npp8u *pSrc2, int nSrc2Step, NppiSize oSizeROI, Npp32f *pMSSSIM, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Three-channel 8-bit unsigned image MS-SSIM*.

This function uses the algorithm described in the paper by Wang et. al. Wang, Z., Simoncelli, E.P., Bovik, A.C. Multiscale Structural Similarity for Image Quality Assessment. In: The Thirty-Seventh Asilomar Conference on Signals, Systems & Computers, 2003, 13981402. Pacific Grove, CA, USA: IEEE,

  1. https://doi.org/10.1109/ACSSC.2003.1292216. NOTE: this API call can only process oSizeROI dimensions 16px by 16px and above. Any oSizeROI dimensions less than 16px by 16px will result in undefined behaviour.

Parameters
Returns

Image Data Related Error Codes, ROI Related Error Codes.

MSEGetBufferHostSize

NppStatus nppiSSIMGetBufferHostSize_8u_C1R_Ctx(NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiSSIM_8u_C1R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiSSIMGetBufferHostSize_8u_C3R_Ctx(NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiSSIM_8u_C3R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiMSSSIMGetBufferHostSize_8u_C1R_Ctx(NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiMSSSIM_8u_C1R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiWMSSSIMGetBufferHostSize_8u_C1R_Ctx(NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiWMSSSIM_8u_C1R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiWMSSSIMGetBufferHostSize_8u_C3R_Ctx(NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for nppiWMSSSIM_8u_C3R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

Image Batch Quality Assessment

IQABatch

Primitives for computing the image quality for a batch of image pairs, such as MSE, PSNR, SSIM, MS-SSIM, and WMMS-SSIM with a single Region-of-Interest (ROI) for all pairs of input images

MSEBatch

NppStatus nppiMSEBatch_8u_C1R_Ctx(const NppiImageDescriptor *pSrc1BatchList, const NppiImageDescriptor *pSrc2BatchList, int nBatchSize, NppiSize oSizeROI, Npp32f *pMSE, NppiBufferDescriptor *pDeviceBufferList, NppStreamContext nppStreamCtx)

One channel 8-bit unsigned MSE for a batch of image pairs for a single ROI.

Provided oSizeROI will be used for all images passed in pSrc1BatchList and pSrc2BatchList arguments. API user must ensure that provided ROI (oSizeROI) does not go beyond the borders of any of provided images.

Parameters
  • pSrc1BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors, per image oSize must be initialized.

  • pSrc2BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors, per image oSize must be initialized.

  • nBatchSize – Number of NppiImageDescriptor, NppiBufferDescriptor, and new max number structures/values processed in this call (must be > 1).

  • oSizeROIRegion-of-Interest (ROI) ROI width and height of ALL images in the batch, MUST match the ROI used when the label markers UF image was generated.

  • pMSE – Device memory pointer to output array of the computed MSE for nBatchSize * sizeof(Npp32f) * 1 image pairs.

  • pDeviceBufferList – Device memory pointer to the list of NppiBufferDescriptor buffer descriptors specifying per image device memory buffer pointers and size as returned by at least one nppiMSEBatchGetBufferHostSize call.

  • nppStreamCtxApplication Managed Stream Context.

Returns

Image Data Related Error Codes, ROI Related Error Codes

NppStatus nppiMSEBatch_8u_C3R_Ctx(const NppiImageDescriptor *pSrc1BatchList, const NppiImageDescriptor *pSrc2BatchList, int nBatchSize, NppiSize oSizeROI, Npp32f *pMSE, NppiBufferDescriptor *pDeviceBufferList, NppStreamContext nppStreamCtx)

3 channel 8-bit unsigned MSE for a batch of image pairs for a single ROI.

Provided oSizeROI will be used for all images passed in pSrc1BatchList and pSrc2BatchList arguments. API user must ensure that provided ROI (oSizeROI) does not go beyond the borders of any of provided images.

Parameters
  • pSrc1BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors, per image oSize must be initialized.

  • pSrc2BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors, per image oSize must be initialized.

  • nBatchSize – Number of NppiImageDescriptor, NppiBufferDescriptor, and new max number structures/values processed in this call (must be > 1).

  • oSizeROIRegion-of-Interest (ROI) ROI width and height of ALL images in the batch, MUST match the ROI used when the label markers UF image was generated.

  • pMSE – Device memory pointer to output array of the computed MSE for nBatchSize * sizeof(Npp32f) * 3 image pairs.

  • pDeviceBufferList – Device memory pointer to the list of NppiBufferDescriptor buffer descriptors specifying per image device memory buffer pointers and size as returned by at least one nppiMSEBatchGetBufferHostSize call.

  • nppStreamCtxApplication Managed Stream Context.

Returns

Image Data Related Error Codes, ROI Related Error Codes

PSNRBatch

NppStatus nppiPSNRBatch_8u_C1R_Ctx(const NppiImageDescriptor *pSrc1BatchList, const NppiImageDescriptor *pSrc2BatchList, int nBatchSize, NppiSize oSizeROI, Npp32f *pPSNR, NppiBufferDescriptor *pDeviceBufferList, NppStreamContext nppStreamCtx)

One channel 8-bit unsigned PSNR for a batch of image pairs for a single ROI.

Provided oSizeROI will be used for all images passed in pSrc1BatchList and pSrc2BatchList arguments. API user must ensure that provided ROI (oSizeROI) does not go beyond the borders of any of provided images.

Parameters
  • pSrc1BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors, per image oSize must be initialized.

  • pSrc2BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors, per image oSize must be initialized.

  • nBatchSize – Number of NppiImageDescriptor, NppiBufferDescriptor, and new max number structures/values processed in this call (must be > 1).

  • oSizeROIRegion-of-Interest (ROI) ROI width and height of ALL images in the batch, MUST match the ROI used when the label markers UF image was generated.

  • pPSNR – Device memory pointer to output array of the computed PSNR for nBatchSize * sizeof(Npp32f) * 1 image pairs.

  • pDeviceBufferList – Device memory pointer to the list of NppiBufferDescriptor buffer descriptors specifying per image device memory buffer pointers and size as returned by at least one nppiPSNRBatchGetBufferHostSize call.

  • nppStreamCtxApplication Managed Stream Context.

Returns

Image Data Related Error Codes, ROI Related Error Codes

NppStatus nppiPSNRBatch_8u_C3R_Ctx(const NppiImageDescriptor *pSrc1BatchList, const NppiImageDescriptor *pSrc2BatchList, int nBatchSize, NppiSize oSizeROI, Npp32f *pPSNR, NppiBufferDescriptor *pDeviceBufferList, NppStreamContext nppStreamCtx)

3 channel 8-bit unsigned PSNR for a batch of image pairs for a single ROI.

Provided oSizeROI will be used for all images passed in pSrc1BatchList and pSrc2BatchList arguments. API user must ensure that provided ROI (oSizeROI) does not go beyond the borders of any of provided images.

Parameters
  • pSrc1BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors, per image oSize must be initialized.

  • pSrc2BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors, per image oSize must be initialized.

  • nBatchSize – Number of NppiImageDescriptor, NppiBufferDescriptor, and new max number structures/values processed in this call (must be > 1).

  • oSizeROIRegion-of-Interest (ROI) ROI width and height of ALL images in the batch, MUST match the ROI used when the label markers UF image was generated.

  • pPSNR – Device memory pointer to output array of the computed PSNR for nBatchSize * sizeof(Npp32f) * 3 image pairs.

  • pDeviceBufferList – Device memory pointer to the list of NppiBufferDescriptor buffer descriptors specifying per image device memory buffer pointers and size as returned by at least one nppiPSNRBatchGetBufferHostSize call.

  • nppStreamCtxApplication Managed Stream Context.

Returns

Image Data Related Error Codes, ROI Related Error Codes

MSEAndPSNRBatchGetBufferHostSize

NppStatus nppiMSEAndPSNRBatchGetBufferHostSize_Ctx(NppDataType eSrcType, NppiChannels eSrcChannels, NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for a single image pair in the batch of image pairs for nppiMSEBatch and nppiPSNRBatch.

For common parameter descriptions, see CommonGetBufferHostSizeParameters. Supported data types include NPP_8U. Supported channel counts include NPP_CH_1, NPP_CH_3.

Parameters

SSIMBatch

NppStatus nppiSSIMBatch_8u_C1R_Ctx(const NppiImageDescriptor *pSrc1BatchList, const NppiImageDescriptor *pSrc2BatchList, int nBatchSize, NppiSize oSizeROI, Npp32f *pSSIM, NppiBufferDescriptor *pDeviceBufferList, NppStreamContext nppStreamCtx)

One channel 8-bit unsigned SSIM for a batch of image pairs for a single ROI.

Provided oSizeROI will be used for all images passed in pSrc1BatchList and pSrc2BatchList arguments. API user must ensure that provided ROI (oSizeROI) does not go beyond the borders of any of provided images.

Parameters
  • pSrc1BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors, per image oSize must be initialized.

  • pSrc2BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors, per image oSize must be initialized.

  • nBatchSize – Number of NppiImageDescriptor, NppiBufferDescriptor, and new max number structures/values processed in this call (must be > 1).

  • oSizeROIRegion-of-Interest (ROI) ROI width and height of ALL images in the batch, MUST match the ROI used when the label markers UF image was generated.

  • pSSIM – Device memory pointer to output array of the computed SSIM for nBatchSize * sizeof(Npp32f) * 1 image pairs.

  • pDeviceBufferList – Device memory pointer to the list of NppiBufferDescriptor buffer descriptors specifying per image device memory buffer pointers and size as returned by at least one nppiSSIMBatchGetBufferHostSize call.

  • nppStreamCtxApplication Managed Stream Context.

Returns

Image Data Related Error Codes, ROI Related Error Codes

NppStatus nppiSSIMBatch_8u_C3R_Ctx(const NppiImageDescriptor *pSrc1BatchList, const NppiImageDescriptor *pSrc2BatchList, int nBatchSize, NppiSize oSizeROI, Npp32f *pSSIM, NppiBufferDescriptor *pDeviceBufferList, NppStreamContext nppStreamCtx)

3 channel 8-bit unsigned SSIM for a batch of image pairs for a single ROI.

Provided oSizeROI will be used for all images passed in pSrc1BatchList and pSrc2BatchList arguments. API user must ensure that provided ROI (oSizeROI) does not go beyond the borders of any of provided images.

Parameters
  • pSrc1BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors, per image oSize must be initialized.

  • pSrc2BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors, per image oSize must be initialized.

  • nBatchSize – Number of NppiImageDescriptor, NppiBufferDescriptor, and new max number structures/values processed in this call (must be > 1).

  • oSizeROIRegion-of-Interest (ROI) ROI width and height of ALL images in the batch, MUST match the ROI used when the label markers UF image was generated.

  • pSSIM – Device memory pointer to output array of the computed SSIM for nBatchSize * sizeof(Npp32f) * 3 image pairs.

  • pDeviceBufferList – Device memory pointer to the list of NppiBufferDescriptor buffer descriptors specifying per image device memory buffer pointers and size as returned by at least one nppiSSIMBatchGetBufferHostSize call.

  • nppStreamCtxApplication Managed Stream Context.

Returns

Image Data Related Error Codes, ROI Related Error Codes

WMSSSIMBatch

NppStatus nppiWMSSSIMBatch_8u_C1R_Ctx(const NppiImageDescriptor *pSrc1BatchList, const NppiImageDescriptor *pSrc2BatchList, int nBatchSize, NppiSize oSizeROI, Npp32f *pWMSSSIM, NppiBufferDescriptor *pDeviceBufferList, NppStreamContext nppStreamCtx)

One channel 8-bit unsigned WMSSSIM for a batch of image pairs for a single ROI.

Provided oSizeROI will be used for all images passed in pSrc1BatchList and pSrc2BatchList arguments. API user must ensure that provided ROI (oSizeROI) does not go beyond the borders of any of provided images. NOTE: this API call can only process oSizeROI dimensions 16 pixels by 16 pixels and above. Any oSizeROI dimensions less than 16 pixels by 16 pixels will result in undefined behaviour.

Parameters
  • pSrc1BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors, per image oSize must be initialized.

  • pSrc2BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors, per image oSize must be initialized.

  • nBatchSize – Number of NppiImageDescriptor, NppiBufferDescriptor, and new max number structures/values processed in this call (must be > 1).

  • oSizeROIRegion-of-Interest (ROI) ROI width and height of ALL images in the batch, MUST match the ROI used when the label markers UF image was generated.

  • pWMSSSIM – Device memory pointer to output array of the computed WMSSSIM for nBatchSize * sizeof(Npp32f) * 1 image pairs.

  • pDeviceBufferList – Device memory pointer to the list of NppiBufferDescriptor buffer descriptors specifying per image device memory buffer pointers and size as returned by at least one nppiWMSSSIMBatchGetBufferHostSize call.

  • nppStreamCtxApplication Managed Stream Context.

Returns

Image Data Related Error Codes, ROI Related Error Codes

NppStatus nppiWMSSSIMBatch_8u_C3R_Ctx(const NppiImageDescriptor *pSrc1BatchList, const NppiImageDescriptor *pSrc2BatchList, int nBatchSize, NppiSize oSizeROI, Npp32f *pWMSSSIM, NppiBufferDescriptor *pDeviceBufferList, NppStreamContext nppStreamCtx)

3 channel 8-bit unsigned WMSSSIM for a batch of image pairs for a single ROI.

Provided oSizeROI will be used for all images passed in pSrc1BatchList and pSrc2BatchList arguments. API user must ensure that provided ROI (oSizeROI) does not go beyond the borders of any of provided images. NOTE: this API call can only process ROI dimensions 16 pixels by 16 pixels and above. Any ROI dimensions less than 16 pixels by 16 pixels will result in undefined behaviour.

Parameters
  • pSrc1BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors, per image oSize must be initialized.

  • pSrc2BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors, per image oSize must be initialized.

  • nBatchSize – Number of NppiImageDescriptor, NppiBufferDescriptor, and new max number structures/values processed in this call (must be > 1).

  • oSizeROIRegion-of-Interest (ROI) ROI width and height of ALL images in the batch, MUST match the ROI used when the label markers UF image was generated.

  • pWMSSSIM – Device memory pointer to output array of the computed WMSSSIM for nBatchSize * sizeof(Npp32f) * 3 image pairs.

  • pDeviceBufferList – Device memory pointer to the list of NppiBufferDescriptor buffer descriptors specifying per image device memory buffer pointers and size as returned by at least one nppiWMSSSIMBatchGetBufferHostSize call.

  • nppStreamCtxApplication Managed Stream Context.

Returns

Image Data Related Error Codes, ROI Related Error Codes

SSIMBatchGetBufferHostSize

NppStatus nppiSSIMBatchGetBufferHostSize_8u_C1R_Ctx(NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for a single image pair in the batch of image pairs for nppiSSIMBatch_8u_C1R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiSSIMBatchGetBufferHostSize_8u_C3R_Ctx(NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for a single image pair in the batch of image pairs for nppiSSIMBatch_8u_C3R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiWMSSSIMBatchGetBufferHostSize_8u_C1R_Ctx(NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for a single image pair in the batch of image pairs for nppiWMSSSIMBatch_8u_C1R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiWMSSSIMBatchGetBufferHostSize_8u_C3R_Ctx(NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)

Buffer size for a single image pair in the batch of image pairs for nppiWMSSSIMBatch_8u_C3R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

Image Advanced Batch Quality Assessment

IQABatchAdvanced

Primitives for computing the image quality for a batch of image pairs, such as MSE, PSNR, SSIM, MS-SSIM, and WMMS-SSIM with per-image Region-of-Interest (ROI)

MSEBatchAdvanced

NppStatus nppiMSEBatch_8u_C1R_Advanced_Ctx(const NppiImageDescriptor *pSrc1BatchList, const NppiImageDescriptor *pSrc2BatchList, int nBatchSize, NppiSize oMaxSizeROI, Npp32f *pMSE, NppiBufferDescriptor *pDeviceBufferList, NppStreamContext nppStreamCtx)

One channel 8-bit unsigned MSE for a batch of image pairs with per-image ROI.

Parameters
  • pSrc1BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors.

  • pSrc2BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors.

  • nBatchSize – Number of NppiImageDescriptor, NppiBufferDescriptor, and new max number structures/values processed in this call (must be > 1).

  • oMaxSizeROIRegion-of-Interest (ROI) maximum ROI width and height of ALL images in the batch.

  • pMSE – Device memory pointer to output array of the computed MSE for nBatchSize * sizeof(Npp32f * 1 image pairs.

  • pDeviceBufferList – Device memory pointer to the list of NppiBufferDescriptor buffer descriptors specifying per image device memory buffer pointers and size as returned by at least one nppiMSEBatchGetBufferHostSize call.

  • nppStreamCtxApplication Managed Stream Context.

Returns

Image Data Related Error Codes, ROI Related Error Codes

NppStatus nppiMSEBatch_8u_C3R_Advanced_Ctx(const NppiImageDescriptor *pSrc1BatchList, const NppiImageDescriptor *pSrc2BatchList, int nBatchSize, NppiSize oMaxSizeROI, Npp32f *pMSE, NppiBufferDescriptor *pDeviceBufferList, NppStreamContext nppStreamCtx)

3 channel 8-bit unsigned MSE for a batch of image pairs with per-image ROI

Parameters
  • pSrc1BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors.

  • pSrc2BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors.

  • nBatchSize – Number of NppiImageDescriptor, NppiBufferDescriptor, and new max number structures/values processed in this call (must be > 1).

  • oMaxSizeROIRegion-of-Interest (ROI) maximum ROI width and height of ALL images in the batch.

  • pMSE – Device memory pointer to output array of the computed MSE for nBatchSize * sizeof(Npp32f) * 3 image pairs.

  • pDeviceBufferList – Device memory pointer to the list of NppiBufferDescriptor buffer descriptors specifying per image device memory buffer pointers and size as returned by at least one nppiMSEBatchGetBufferHostSize call.

  • nppStreamCtxApplication Managed Stream Context.

Returns

Image Data Related Error Codes, ROI Related Error Codes

PSNRBatchAdvanced

NppStatus nppiPSNRBatch_8u_C1R_Advanced_Ctx(const NppiImageDescriptor *pSrc1BatchList, const NppiImageDescriptor *pSrc2BatchList, int nBatchSize, NppiSize oMaxSizeROI, Npp32f *pPSNR, NppiBufferDescriptor *pDeviceBufferList, NppStreamContext nppStreamCtx)

One channel 8-bit unsigned PSNR for a batch of image pairs with per-image ROI.

Parameters
  • pSrc1BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors.

  • pSrc2BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors.

  • nBatchSize – Number of NppiImageDescriptor, NppiBufferDescriptor, and new max number structures/values processed in this call (must be > 1).

  • oMaxSizeROIRegion-of-Interest (ROI) maximum ROI width and height of ALL images in the batch.

  • pPSNR – Device memory pointer to output array of the computed PSNR for nBatchSize * sizeof(Npp32f) * 1 image pairs.

  • pDeviceBufferList – Device memory pointer to the list of NppiBufferDescriptor buffer descriptors specifying per image device memory buffer pointers and size as returned by at least one nppiPSNRBatchGetBufferHostSize call.

  • nppStreamCtxApplication Managed Stream Context.

Returns

Image Data Related Error Codes, ROI Related Error Codes

NppStatus nppiPSNRBatch_8u_C3R_Advanced_Ctx(const NppiImageDescriptor *pSrc1BatchList, const NppiImageDescriptor *pSrc2BatchList, int nBatchSize, NppiSize oMaxSizeROI, Npp32f *pPSNR, NppiBufferDescriptor *pDeviceBufferList, NppStreamContext nppStreamCtx)

3 channel 8-bit unsigned PSNR for a batch of image pairs with per-image ROI

Parameters
  • pSrc1BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors.

  • pSrc2BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors.

  • nBatchSize – Number of NppiImageDescriptor, NppiBufferDescriptor, and new max number structures/values processed in this call (must be > 1).

  • oMaxSizeROIRegion-of-Interest (ROI) maximum ROI width and height of ALL images in the batch.

  • pPSNR – Device memory pointer to output array of the computed PSNR for nBatchSize * sizeof(Npp32f) * 3 image pairs.

  • pDeviceBufferList – Device memory pointer to the list of NppiBufferDescriptor buffer descriptors specifying per image device memory buffer pointers and size as returned by at least one nppiPSNRBatchGetBufferHostSize call.

  • nppStreamCtxApplication Managed Stream Context.

Returns

Image Data Related Error Codes, ROI Related Error Codes

WMSSSIMBatchAdvanced

NppStatus nppiWMSSSIMBatch_8u_C1R_Advanced_Ctx(const NppiImageDescriptor *pSrc1BatchList, const NppiImageDescriptor *pSrc2BatchList, int nBatchSize, NppiSize oMaxSizeROI, Npp32f *pWMSSSIM, NppiBufferDescriptor *pDeviceBufferList, NppStreamContext nppStreamCtx)

One channel 8-bit unsigned WMSSSIM for a batch of image pairs with per-image ROI NOTE: It is the user’s responsibility to make sure the dimensions of per-image ROIs are 16 pixels by 16 pixels and above.

Any per-image ROI dimensions less than 16 pixels by 16 pixels will result in undefined behaviour.

Parameters
  • pSrc1BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors.

  • pSrc2BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors.

  • nBatchSize – Number of NppiImageDescriptor, NppiBufferDescriptor, and new max number structures/values processed in this call (must be > 1).

  • oMaxSizeROIRegion-of-Interest (ROI) maximum ROI width and height of ALL images in the batch.

  • pWMSSSIM – Device memory pointer to output array of the computed WMSSSIM for nBatchSize * sizeof(Npp32f) * 1 image pairs.

  • pDeviceBufferList – Device memory pointer to the list of NppiBufferDescriptor buffer descriptors specifying per image device memory buffer pointers and size as returned by at least one nppiWMSSSIMBatchGetBufferHostSize call.

  • nppStreamCtxApplication Managed Stream Context.

Returns

Image Data Related Error Codes, ROI Related Error Codes

NppStatus nppiWMSSSIMBatch_8u_C3R_Advanced_Ctx(const NppiImageDescriptor *pSrc1BatchList, const NppiImageDescriptor *pSrc2BatchList, int nBatchSize, NppiSize oMaxSizeROI, Npp32f *pWMSSSIM, NppiBufferDescriptor *pDeviceBufferList, NppStreamContext nppStreamCtx)

3 channel 8-bit unsigned WMSSSIM for a batch of image pairs with per-image ROI NOTE: It is the user’s responsibility to make sure the dimensions of per-image ROIs are 16 pixels by 16 pixels and above.

Any per-image ROI dimensions less than 16 pixels by 16 pixels will result in undefined behaviour.

Parameters
  • pSrc1BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors.

  • pSrc2BatchList – Source-Batch-Images Pointer device memory pointer to the list of device memory image descriptors.

  • nBatchSize – Number of NppiImageDescriptor, NppiBufferDescriptor, and new max number structures/values processed in this call (must be > 1).

  • oMaxSizeROIRegion-of-Interest (ROI) maximum ROI width and height of ALL images in the batch.

  • pWMSSSIM – Device memory pointer to output array of the computed WMSSSIM for nBatchSize * sizeof(Npp32f) * 3 image pairs.

  • pDeviceBufferList – Device memory pointer to the list of NppiBufferDescriptor buffer descriptors specifying per image device memory buffer pointers and size as returned by at least one nppiWMSSSIMBatchGetBufferHostSize call.

  • nppStreamCtxApplication Managed Stream Context.

Returns

Image Data Related Error Codes, ROI Related Error Codes