NVIDIA Performance Primitives (NPP)  Version 9.1

Primitives for computing the stansdard deviation of the integral images. More...

RectStdDev

NppStatus  nppiRectStdDev_32f_C1R (const Npp32f *pSrc, int nSrcStep, const Npp64f *pSqr, int nSqrStep, Npp32f *pDst, int nDstStep, NppiSize oSizeROI, NppiRect oRect)
  One-channel 32-bit floating point image RectStdDev. More...
 
NppStatus  nppiRectStdDev_32s_C1RSfs (const Npp32s *pSrc, int nSrcStep, const Npp32s *pSqr, int nSqrStep, Npp32s *pDst, int nDstStep, NppiSize oSizeROI, NppiRect oRect, int nScaleFactor)
  One-channel 32-bit signed image RectStdDev, scaled by $2^(-nScaleFactor)$. More...
 
NppStatus  nppiRectStdDev_32s32f_C1R (const Npp32s *pSrc, int nSrcStep, const Npp64f *pSqr, int nSqrStep, Npp32f *pDst, int nDstStep, NppiSize oSizeROI, NppiRect oRect)
  One-channel 32-bit signed image RectStdDev. More...
 

Detailed Description

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).$

Function Documentation

NppStatus nppiRectStdDev_32f_C1R ( const Npp32f pSrc,
int  nSrcStep,
const Npp64f pSqr,
int  nSqrStep,
Npp32f pDst,
int  nDstStep,
NppiSize  oSizeROI,
NppiRect  oRect 
)

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.
oSizeROI Region-of-Interest (ROI).
oRect rectangular window
Returns
Image Data Related Error Codes, ROI Related Error Codes
NppStatus nppiRectStdDev_32s32f_C1R ( const Npp32s pSrc,
int  nSrcStep,
const Npp64f pSqr,
int  nSqrStep,
Npp32f pDst,
int  nDstStep,
NppiSize  oSizeROI,
NppiRect  oRect 
)

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.
oSizeROI Region-of-Interest (ROI).
oRect rectangular window
Returns
Image Data Related Error Codes, ROI Related Error Codes
NppStatus nppiRectStdDev_32s_C1RSfs ( const Npp32s pSrc,
int  nSrcStep,
const Npp32s pSqr,
int  nSqrStep,
Npp32s pDst,
int  nDstStep,
NppiSize  oSizeROI,
NppiRect  oRect,
int  nScaleFactor 
)

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

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.
oSizeROI Region-of-Interest (ROI).
oRect rectangular window
nScaleFactor Integer Result Scaling.
Returns
Image Data Related Error Codes, ROI Related Error Codes