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

Primitives for computing the image quality index of two images. More...

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:

Parameters
pSrc1Source-Image Pointer.
nSrc1StepSource-Image Line Step.
pSrc2Source-Image Pointer.
nSrc2StepSource-Image Line Step.
oRoiSizeRegion-of-Interest (ROI).
pDstPointer to the quality index.
pDeviceBufferPointer to the required device memory allocation, Scratch Buffer and Host Pointer.
nppStreamCtxApplication Managed Stream Context.
Returns
Image Data Related Error Codes, ROI Related Error Codes, or NPP_QUALITY_INDEX_ERROR if pixels of either image are constant numberse.
NppStatus nppiQualityIndex_8u32f_C1R_Ctx (const Npp8u *pSrc1, int nSrc1Step, const Npp8u *pSrc2, int nSrc2Step, NppiSize oRoiSize, Npp32f *pDst, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)
 One-channel 8-bit unsigned image QualityIndex. More...
 
NppStatus nppiQualityIndex_8u32f_C1R (const Npp8u *pSrc1, int nSrc1Step, const Npp8u *pSrc2, int nSrc2Step, NppiSize oRoiSize, Npp32f *pDst, Npp8u *pDeviceBuffer)
 
NppStatus nppiQualityIndex_16u32f_C1R_Ctx (const Npp16u *pSrc1, int nSrc1Step, const Npp16u *pSrc2, int nSrc2Step, NppiSize oRoiSize, Npp32f *pDst, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)
 One-channel 16-bit unsigned image QualityIndex. More...
 
NppStatus nppiQualityIndex_16u32f_C1R (const Npp16u *pSrc1, int nSrc1Step, const Npp16u *pSrc2, int nSrc2Step, NppiSize oRoiSize, Npp32f *pDst, Npp8u *pDeviceBuffer)
 
NppStatus nppiQualityIndex_32f_C1R_Ctx (const Npp32f *pSrc1, int nSrc1Step, const Npp32f *pSrc2, int nSrc2Step, NppiSize oRoiSize, Npp32f *pDst, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)
 One-channel 32-bit floating point image QualityIndex. More...
 
NppStatus nppiQualityIndex_32f_C1R (const Npp32f *pSrc1, int nSrc1Step, const Npp32f *pSrc2, int nSrc2Step, NppiSize oRoiSize, Npp32f *pDst, Npp8u *pDeviceBuffer)
 
NppStatus nppiQualityIndex_8u32f_C3R_Ctx (const Npp8u *pSrc1, int nSrc1Step, const Npp8u *pSrc2, int nSrc2Step, NppiSize oRoiSize, Npp32f *pDst, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)
 Three-channel 8-bit unsigned image QualityIndex. More...
 
NppStatus nppiQualityIndex_8u32f_C3R (const Npp8u *pSrc1, int nSrc1Step, const Npp8u *pSrc2, int nSrc2Step, NppiSize oRoiSize, Npp32f *pDst, Npp8u *pDeviceBuffer)
 
NppStatus nppiQualityIndex_16u32f_C3R_Ctx (const Npp16u *pSrc1, int nSrc1Step, const Npp16u *pSrc2, int nSrc2Step, NppiSize oRoiSize, Npp32f *pDst, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)
 Three-channel 16-bit unsigned image QualityIndex. More...
 
NppStatus nppiQualityIndex_16u32f_C3R (const Npp16u *pSrc1, int nSrc1Step, const Npp16u *pSrc2, int nSrc2Step, NppiSize oRoiSize, Npp32f *pDst, Npp8u *pDeviceBuffer)
 
NppStatus nppiQualityIndex_32f_C3R_Ctx (const Npp32f *pSrc1, int nSrc1Step, const Npp32f *pSrc2, int nSrc2Step, NppiSize oRoiSize, Npp32f *pDst, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)
 Three-channel 32-bit floating point image QualityIndex. More...
 
NppStatus nppiQualityIndex_32f_C3R (const Npp32f *pSrc1, int nSrc1Step, const Npp32f *pSrc2, int nSrc2Step, NppiSize oRoiSize, Npp32f *pDst, Npp8u *pDeviceBuffer)
 
NppStatus nppiQualityIndex_8u32f_AC4R_Ctx (const Npp8u *pSrc1, int nSrc1Step, const Npp8u *pSrc2, int nSrc2Step, NppiSize oRoiSize, Npp32f *pDst, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)
 Four-channel 8-bit unsigned image QualityIndex. More...
 
NppStatus nppiQualityIndex_8u32f_AC4R (const Npp8u *pSrc1, int nSrc1Step, const Npp8u *pSrc2, int nSrc2Step, NppiSize oRoiSize, Npp32f *pDst, Npp8u *pDeviceBuffer)
 
NppStatus nppiQualityIndex_16u32f_AC4R_Ctx (const Npp16u *pSrc1, int nSrc1Step, const Npp16u *pSrc2, int nSrc2Step, NppiSize oRoiSize, Npp32f *pDst, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)
 Four-channel 16-bit unsigned image QualityIndex. More...
 
NppStatus nppiQualityIndex_16u32f_AC4R (const Npp16u *pSrc1, int nSrc1Step, const Npp16u *pSrc2, int nSrc2Step, NppiSize oRoiSize, Npp32f *pDst, Npp8u *pDeviceBuffer)
 
NppStatus nppiQualityIndex_32f_AC4R_Ctx (const Npp32f *pSrc1, int nSrc1Step, const Npp32f *pSrc2, int nSrc2Step, NppiSize oRoiSize, Npp32f *pDst, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)
 Four-channel 32-bit floating point image QualityIndex. More...
 
NppStatus nppiQualityIndex_32f_AC4R (const Npp32f *pSrc1, int nSrc1Step, const Npp32f *pSrc2, int nSrc2Step, NppiSize oRoiSize, Npp32f *pDst, Npp8u *pDeviceBuffer)
 

QualityIndexGetBufferHostSize

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

NppStatus nppiQualityIndexGetBufferHostSize_8u32f_C1R_Ctx (NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)
 Buffer size (in bytes) for nppiQualityIndex_8u32f_C1R. More...
 
NppStatus nppiQualityIndexGetBufferHostSize_8u32f_C1R (NppiSize oSizeROI, int *hpBufferSize)
 
NppStatus nppiQualityIndexGetBufferHostSize_16u32f_C1R_Ctx (NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)
 Buffer size (in bytes) for nppiQualityIndex_16u32f_C1R. More...
 
NppStatus nppiQualityIndexGetBufferHostSize_16u32f_C1R (NppiSize oSizeROI, int *hpBufferSize)
 
NppStatus nppiQualityIndexGetBufferHostSize_32f_C1R_Ctx (NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)
 Buffer size (in bytes) for nppiQualityIndex_32f_C1R. More...
 
NppStatus nppiQualityIndexGetBufferHostSize_32f_C1R (NppiSize oSizeROI, int *hpBufferSize)
 
NppStatus nppiQualityIndexGetBufferHostSize_8u32f_C3R_Ctx (NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)
 Buffer size (in bytes) for nppiQualityIndex_8u32f_C3R. More...
 
NppStatus nppiQualityIndexGetBufferHostSize_8u32f_C3R (NppiSize oSizeROI, int *hpBufferSize)
 
NppStatus nppiQualityIndexGetBufferHostSize_16u32f_C3R_Ctx (NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)
 Buffer size (in bytes) for nppiQualityIndex_16u32f_C3R. More...
 
NppStatus nppiQualityIndexGetBufferHostSize_16u32f_C3R (NppiSize oSizeROI, int *hpBufferSize)
 
NppStatus nppiQualityIndexGetBufferHostSize_32f_C3R_Ctx (NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)
 Buffer size (in bytes) for nppiQualityIndex_32f_C3R. More...
 
NppStatus nppiQualityIndexGetBufferHostSize_32f_C3R (NppiSize oSizeROI, int *hpBufferSize)
 
NppStatus nppiQualityIndexGetBufferHostSize_8u32f_AC4R_Ctx (NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)
 Buffer size (in bytes) for nppiQualityIndex_8u32f_AC4R. More...
 
NppStatus nppiQualityIndexGetBufferHostSize_8u32f_AC4R (NppiSize oSizeROI, int *hpBufferSize)
 
NppStatus nppiQualityIndexGetBufferHostSize_16u32f_AC4R_Ctx (NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)
 Buffer size (in bytes) for nppiQualityIndex_16u32f_AC4R. More...
 
NppStatus nppiQualityIndexGetBufferHostSize_16u32f_AC4R (NppiSize oSizeROI, int *hpBufferSize)
 
NppStatus nppiQualityIndexGetBufferHostSize_32f_AC4R_Ctx (NppiSize oSizeROI, int *hpBufferSize, NppStreamContext nppStreamCtx)
 Buffer size (in bytes) for nppiQualityIndex_32f_AC4R. More...
 
NppStatus nppiQualityIndexGetBufferHostSize_32f_AC4R (NppiSize oSizeROI, int *hpBufferSize)
 

Detailed Description

Primitives for computing the image quality index of two images.

Function Documentation

NppStatus nppiQualityIndex_16u32f_AC4R ( const Npp16u pSrc1,
int  nSrc1Step,
const Npp16u pSrc2,
int  nSrc2Step,
NppiSize  oRoiSize,
Npp32f pDst,
Npp8u pDeviceBuffer 
)
NppStatus nppiQualityIndex_16u32f_AC4R_Ctx ( const Npp16u pSrc1,
int  nSrc1Step,
const Npp16u pSrc2,
int  nSrc2Step,
NppiSize  oRoiSize,
Npp32f pDst,
Npp8u pDeviceBuffer,
NppStreamContext  nppStreamCtx 
)

Four-channel 16-bit unsigned image QualityIndex.

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

NppStatus nppiQualityIndex_16u32f_C1R ( const Npp16u pSrc1,
int  nSrc1Step,
const Npp16u pSrc2,
int  nSrc2Step,
NppiSize  oRoiSize,
Npp32f pDst,
Npp8u pDeviceBuffer 
)
NppStatus nppiQualityIndex_16u32f_C1R_Ctx ( const Npp16u pSrc1,
int  nSrc1Step,
const Npp16u pSrc2,
int  nSrc2Step,
NppiSize  oRoiSize,
Npp32f pDst,
Npp8u pDeviceBuffer,
NppStreamContext  nppStreamCtx 
)

One-channel 16-bit unsigned image QualityIndex.

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

NppStatus nppiQualityIndex_16u32f_C3R ( const Npp16u pSrc1,
int  nSrc1Step,
const Npp16u pSrc2,
int  nSrc2Step,
NppiSize  oRoiSize,
Npp32f pDst,
Npp8u pDeviceBuffer 
)
NppStatus nppiQualityIndex_16u32f_C3R_Ctx ( const Npp16u pSrc1,
int  nSrc1Step,
const Npp16u pSrc2,
int  nSrc2Step,
NppiSize  oRoiSize,
Npp32f pDst,
Npp8u pDeviceBuffer,
NppStreamContext  nppStreamCtx 
)

Three-channel 16-bit unsigned image QualityIndex.

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

NppStatus nppiQualityIndex_32f_AC4R ( const Npp32f pSrc1,
int  nSrc1Step,
const Npp32f pSrc2,
int  nSrc2Step,
NppiSize  oRoiSize,
Npp32f pDst,
Npp8u pDeviceBuffer 
)
NppStatus nppiQualityIndex_32f_AC4R_Ctx ( const Npp32f pSrc1,
int  nSrc1Step,
const Npp32f pSrc2,
int  nSrc2Step,
NppiSize  oRoiSize,
Npp32f pDst,
Npp8u pDeviceBuffer,
NppStreamContext  nppStreamCtx 
)

Four-channel 32-bit floating point image QualityIndex.

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

NppStatus nppiQualityIndex_32f_C1R ( const Npp32f pSrc1,
int  nSrc1Step,
const Npp32f pSrc2,
int  nSrc2Step,
NppiSize  oRoiSize,
Npp32f pDst,
Npp8u pDeviceBuffer 
)
NppStatus nppiQualityIndex_32f_C1R_Ctx ( const Npp32f pSrc1,
int  nSrc1Step,
const Npp32f pSrc2,
int  nSrc2Step,
NppiSize  oRoiSize,
Npp32f pDst,
Npp8u pDeviceBuffer,
NppStreamContext  nppStreamCtx 
)

One-channel 32-bit floating point image QualityIndex.

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

NppStatus nppiQualityIndex_32f_C3R ( const Npp32f pSrc1,
int  nSrc1Step,
const Npp32f pSrc2,
int  nSrc2Step,
NppiSize  oRoiSize,
Npp32f pDst,
Npp8u pDeviceBuffer 
)
NppStatus nppiQualityIndex_32f_C3R_Ctx ( const Npp32f pSrc1,
int  nSrc1Step,
const Npp32f pSrc2,
int  nSrc2Step,
NppiSize  oRoiSize,
Npp32f pDst,
Npp8u pDeviceBuffer,
NppStreamContext  nppStreamCtx 
)

Three-channel 32-bit floating point image QualityIndex.

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

NppStatus nppiQualityIndex_8u32f_AC4R ( const Npp8u pSrc1,
int  nSrc1Step,
const Npp8u pSrc2,
int  nSrc2Step,
NppiSize  oRoiSize,
Npp32f pDst,
Npp8u pDeviceBuffer 
)
NppStatus nppiQualityIndex_8u32f_AC4R_Ctx ( const Npp8u pSrc1,
int  nSrc1Step,
const Npp8u pSrc2,
int  nSrc2Step,
NppiSize  oRoiSize,
Npp32f pDst,
Npp8u pDeviceBuffer,
NppStreamContext  nppStreamCtx 
)

Four-channel 8-bit unsigned image QualityIndex.

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

NppStatus nppiQualityIndex_8u32f_C1R ( const Npp8u pSrc1,
int  nSrc1Step,
const Npp8u pSrc2,
int  nSrc2Step,
NppiSize  oRoiSize,
Npp32f pDst,
Npp8u pDeviceBuffer 
)
NppStatus nppiQualityIndex_8u32f_C1R_Ctx ( const Npp8u pSrc1,
int  nSrc1Step,
const Npp8u pSrc2,
int  nSrc2Step,
NppiSize  oRoiSize,
Npp32f pDst,
Npp8u pDeviceBuffer,
NppStreamContext  nppStreamCtx 
)

One-channel 8-bit unsigned image QualityIndex.

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

NppStatus nppiQualityIndex_8u32f_C3R ( const Npp8u pSrc1,
int  nSrc1Step,
const Npp8u pSrc2,
int  nSrc2Step,
NppiSize  oRoiSize,
Npp32f pDst,
Npp8u pDeviceBuffer 
)
NppStatus nppiQualityIndex_8u32f_C3R_Ctx ( const Npp8u pSrc1,
int  nSrc1Step,
const Npp8u pSrc2,
int  nSrc2Step,
NppiSize  oRoiSize,
Npp32f pDst,
Npp8u pDeviceBuffer,
NppStreamContext  nppStreamCtx 
)

Three-channel 8-bit unsigned image QualityIndex.

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

NppStatus nppiQualityIndexGetBufferHostSize_16u32f_AC4R ( NppiSize  oSizeROI,
int *  hpBufferSize 
)
NppStatus nppiQualityIndexGetBufferHostSize_16u32f_AC4R_Ctx ( NppiSize  oSizeROI,
int *  hpBufferSize,
NppStreamContext  nppStreamCtx 
)

Buffer size (in bytes) for nppiQualityIndex_16u32f_AC4R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiQualityIndexGetBufferHostSize_16u32f_C1R ( NppiSize  oSizeROI,
int *  hpBufferSize 
)
NppStatus nppiQualityIndexGetBufferHostSize_16u32f_C1R_Ctx ( NppiSize  oSizeROI,
int *  hpBufferSize,
NppStreamContext  nppStreamCtx 
)

Buffer size (in bytes) for nppiQualityIndex_16u32f_C1R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiQualityIndexGetBufferHostSize_16u32f_C3R ( NppiSize  oSizeROI,
int *  hpBufferSize 
)
NppStatus nppiQualityIndexGetBufferHostSize_16u32f_C3R_Ctx ( NppiSize  oSizeROI,
int *  hpBufferSize,
NppStreamContext  nppStreamCtx 
)

Buffer size (in bytes) for nppiQualityIndex_16u32f_C3R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiQualityIndexGetBufferHostSize_32f_AC4R ( NppiSize  oSizeROI,
int *  hpBufferSize 
)
NppStatus nppiQualityIndexGetBufferHostSize_32f_AC4R_Ctx ( NppiSize  oSizeROI,
int *  hpBufferSize,
NppStreamContext  nppStreamCtx 
)

Buffer size (in bytes) for nppiQualityIndex_32f_AC4R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiQualityIndexGetBufferHostSize_32f_C1R ( NppiSize  oSizeROI,
int *  hpBufferSize 
)
NppStatus nppiQualityIndexGetBufferHostSize_32f_C1R_Ctx ( NppiSize  oSizeROI,
int *  hpBufferSize,
NppStreamContext  nppStreamCtx 
)

Buffer size (in bytes) for nppiQualityIndex_32f_C1R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiQualityIndexGetBufferHostSize_32f_C3R ( NppiSize  oSizeROI,
int *  hpBufferSize 
)
NppStatus nppiQualityIndexGetBufferHostSize_32f_C3R_Ctx ( NppiSize  oSizeROI,
int *  hpBufferSize,
NppStreamContext  nppStreamCtx 
)

Buffer size (in bytes) for nppiQualityIndex_32f_C3R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiQualityIndexGetBufferHostSize_8u32f_AC4R ( NppiSize  oSizeROI,
int *  hpBufferSize 
)
NppStatus nppiQualityIndexGetBufferHostSize_8u32f_AC4R_Ctx ( NppiSize  oSizeROI,
int *  hpBufferSize,
NppStreamContext  nppStreamCtx 
)

Buffer size (in bytes) for nppiQualityIndex_8u32f_AC4R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiQualityIndexGetBufferHostSize_8u32f_C1R ( NppiSize  oSizeROI,
int *  hpBufferSize 
)
NppStatus nppiQualityIndexGetBufferHostSize_8u32f_C1R_Ctx ( NppiSize  oSizeROI,
int *  hpBufferSize,
NppStreamContext  nppStreamCtx 
)

Buffer size (in bytes) for nppiQualityIndex_8u32f_C1R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.

NppStatus nppiQualityIndexGetBufferHostSize_8u32f_C3R ( NppiSize  oSizeROI,
int *  hpBufferSize 
)
NppStatus nppiQualityIndexGetBufferHostSize_8u32f_C3R_Ctx ( NppiSize  oSizeROI,
int *  hpBufferSize,
NppStreamContext  nppStreamCtx 
)

Buffer size (in bytes) for nppiQualityIndex_8u32f_C3R.

For common parameter descriptions, see CommonGetBufferHostSizeParameters.


Copyright © 2009-2022 NVIDIA CORPORATION AND AFFILIATES