Image Filtering Functions

Linear and non-linear image filtering functions.

Filtering functions are classified as Neighborhood Operations. It is the user’s responsibility to avoid Sampling Beyond Image Boundaries.

These functions can be found in the nppif 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.

Image 1D Linear Filters

1D Linear Filter

The set of 1D linear filtering functions available in the library.

Image Filter Column

FilterColumn

Apply convolution filter with user specified 1D column of weights.

Result pixel is equal to the sum of the products between the kernel coefficients (pKernel array) and corresponding neighboring column pixel values in the source image defined by nKernelDim and nAnchorY, divided by nDivisor.

Common parameters for nppiFilterColumn functions include:

Supported 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 eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oROI

Region-of-Interest (ROI).

param pKernel

Pointer to the start address of the kernel coefficient array. Coefficients are expected to be stored in reverse order.

param nMaskSize

Length of the linear kernel array.

param nAnchor

Y offset of the kernel origin frame of reference relative to the source pixel.

param nDivisor

The factor by which the convolved summation from the Filter operation should be divided. If equal to the sum of coefficients, this will keep the maximum result value within full scale.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterColumn_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oROI, const Npp32s *pKernel, Npp32s nMaskSize, Npp32s nAnchor, Npp32s nDivisor, NppStreamContext nppStreamCtx)

Image 1D column convolution with integer coefficients.

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

Image Filter Column Border

FilterColumnBorder

General purpose 1D convolution column filter with border control.

Pixels under the mask are multiplied by the respective weights in the mask and the results are summed. Before writing the result pixel the sum is scaled back via division by nDivisor. If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

Common parameters for nppiFilterColumnBorder functions include:

Supported 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 eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pKernel

Pointer to the start address of the kernel coefficient array. Coeffcients are expected to be stored in reverse order.

param nMaskSize

Width of the kernel.

param nAnchor

X offset of the kernel origin frame of reference relative to the source pixel.

param nDivisor

The factor by which the convolved summation from the Filter operation should be divided. If equal to the sum of coefficients, this will keep the maximum result value within full scale.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterColumnBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oROI, const Npp32s *pKernel, Npp32s nMaskSize, Npp32s nAnchor, Npp32s nDivisor, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image 1D column convolution filter with integer coefficients and border control, pKernel.

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

Image Filter Column 32f

FilterColumn32f

FilterColumn using floating-point weights.

Common parameters for nppiFilterColumn32f 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

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oROI

Region-of-Interest (ROI).

param pKernel

Pointer to the start address of the kernel coefficient array. Coefficients are expected to be stored in reverse order.

param nMaskSize

Length of the linear kernel array.

param nAnchor

Y offset of the kernel origin frame of reference relative to the source pixel.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterColumn32f_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oROI, const Npp32f *pKernel, Npp32s nMaskSize, Npp32s nAnchor, NppStreamContext nppStreamCtx)

Image 1D column convolution with float coefficients.

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

Image Filter Column Border 32f

FilterColumnBorder32f

General purpose 1D column convolution filter using floating-point weights with border control.

Pixels under the mask are multiplied by the respective weights in the mask and the results are summed. If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

Common parameters for nppiFilterColumnBorder32f 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

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pKernel

Pointer to the start address of the kernel coefficient array. Coeffcients are expected to be stored in reverse order.

param nMaskSize

Width of the kernel.

param nAnchor

X offset of the kernel origin frame of reference relative to the source pixel.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterColumnBorder32f_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, int nDstStep, NppiSize oSizeROI, const Npp32f *pKernel, Npp32s nMaskSize, Npp32s nAnchor, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image 1D column convolution filter with float coefficients and border control.

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

Image Filter Row

FilterRow

Apply convolution filter with user specified 1D row of weights.

Result pixel is equal to the sum of the products between the kernel coefficients (pKernel array) and corresponding neighboring row pixel values in the source image defined by nKernelDim and nAnchorX, divided by nDivisor.

Common parameters for nppiFilterRow functions include:

Supported 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 eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oROI

Region-of-Interest (ROI).

param pKernel

Pointer to the start address of the kernel coefficient array. Coefficients are expected to be stored in reverse order.

param nMaskSize

Length of the linear kernel array.

param nAnchor

X offset of the kernel origin frame of reference relative to the source pixel.

param nDivisor

The factor by which the convolved summation from the Filter operation should be divided. If equal to the sum of coefficients, this will keep the maximum result value within full scale.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterRow_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oROI, const Npp32s *pKernel, Npp32s nMaskSize, Npp32s nAnchor, Npp32s nDivisor, NppStreamContext nppStreamCtx)

Image 1D row convolution with integer coefficients.

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

Image Filter Row Border

FilterRowBorder

General purpose 1D convolution row filter with border control.

Pixels under the mask are multiplied by the respective weights in the mask and the results are summed. Before writing the result pixel the sum is scaled back via division by nDivisor. If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

Common parameters for nppiFilterRowBorder functions include:

Supported 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 eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pKernel

Pointer to the start address of the kernel coefficient array. Coeffcients are expected to be stored in reverse order.

param nMaskSize

Width of the kernel.

param nAnchor

X offset of the kernel origin frame of reference relative to the source pixel.

param nDivisor

The factor by which the convolved summation from the Filter operation should be divided. If equal to the sum of coefficients, this will keep the maximum result value within full scale.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterRowBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, const Npp32s *pKernel, Npp32s nMaskSize, Npp32s nAnchor, Npp32s nDivisor, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image 1D row convolution filter with integer coefficients and border control.

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

Image Filter Row 32f

FilterRow32f

FilterRow using floating-point weights.

Common parameters for nppiFilterRow32f functions include:

Supported 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 eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oROI

Region-of-Interest (ROI).

param pKernel

Pointer to the start address of the kernel coefficient array. Coefficients are expected to be stored in reverse order.

param nMaskSize

Length of the linear kernel array.

param nAnchor

X offset of the kernel origin frame of reference relative to the source pixel.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterRow32f_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oROI, const Npp32f *pKernel, Npp32s nMaskSize, Npp32s nAnchor, NppStreamContext nppStreamCtx)

Image 1D row convolution with float coefficients.

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

Image Filter Row Border 32f

FilterRowBorder32f

General purpose 1D row convolution filter using floating-point weights with border control.

Pixels under the mask are multiplied by the respective weights in the mask and the results are summed. If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

Common parameters for nppiFilterRowBorder32f functions include:

Supported 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 eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pKernel

Pointer to the start address of the kernel coefficient array. Coeffcients are expected to be stored in reverse order.

param nMaskSize

Width of the kernel.

param nAnchor

X offset of the kernel origin frame of reference relative to the source pixel.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterRowBorder32f_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, int nDstStep, NppiSize oSizeROI, const Npp32f *pKernel, Npp32s nMaskSize, Npp32s nAnchor, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image 1D row convolution filter with float coefficients and border control.

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

Image Filter 1D Window Sum

1D Window Sum

The set of 1D window sum functions available in the library.

Image Filter 1D Window Column Sum

1D Window Column Sum

1D mask Window Column Sum for 8 and 16 bit images.

Common parameters for nppiSumWindowColumn functions include:

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

param eSrcType

source image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oROI

Region-of-Interest (ROI).

param nMaskSize

Length of the linear kernel array.

param nAnchor

Y offset of the kernel origin frame of reference relative to the source pixel.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiSumWindowColumn_Ctx(NppDataType eSrcType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, Npp32f *pDst, Npp32s nDstStep, NppiSize oROI, Npp32s nMaskSize, Npp32s nAnchor, NppStreamContext nppStreamCtx)

Image 1D (column) sum to 32f.

Apply Column Window Summation filter over a 1D mask region around each source pixel for input images with 32-bit floating point output.

Result 32-bit floating point pixel is equal to the sum of the corresponding and neighboring column pixel values in a mask region of the source image defined by nMaskSize and nAnchor.

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

Image Filter 1D Window Row Sum

1D Window Row Sum

1D mask Window Row Sum for 8 and 16 bit images.

Common parameters for nppiSumWindowRow functions include:

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

param eSrcType

source image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oROI

Region-of-Interest (ROI).

param nMaskSize

Length of the linear kernel array.

param nAnchor

X offset of the kernel origin frame of reference relative to the source pixel.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiSumWindowRow_Ctx(NppDataType eSrcType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, Npp32f *pDst, Npp32s nDstStep, NppiSize oROI, Npp32s nMaskSize, Npp32s nAnchor, NppStreamContext nppStreamCtx)

One channel 8-bit unsigned 1D (row) sum to 32f.

Apply Row Window Summation filter over a 1D mask region around each source pixel for input images with 32-bit floating point output.

Result 32-bit floating point pixel is equal to the sum of the corresponding and neighboring row pixel values in a mask region of the source image defined by nMaskSize and nAnchor.

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

Image Filter 1D Window Sum Border

1D Window Sum with Border Control

The set of 1D window sum functions with border control available in the library.

Image Filter 1D Window Column Sum Border

1D Window Column Sum Border

1D mask Window Column Sum for 8 and 16 bit images with border control.

If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

Common parameters for nppiSumWindowColumnBorder functions include:

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

param eSrcType

source image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oROI

Region-of-Interest (ROI).

param nMaskSize

Length of the linear kernel array.

param nAnchor

Y offset of the kernel origin frame of reference relative to the source pixel.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiSumWindowColumnBorder_Ctx(NppDataType eSrcType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, Npp32f *pDst, Npp32s nDstStep, NppiSize oROI, Npp32s nMaskSize, Npp32s nAnchor, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image 1D (column) sum to 32f with border control.

Apply Column Window Summation filter over a 1D mask region around each source pixel for input images with 32-bit floating point output.

Result 32-bit floating point pixel is equal to the sum of the corresponding and neighboring column pixel values in a mask region of the source image defined by nMaskSize and nAnchor.

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

Image Filter 1D Window Row Sum Border

1D Window Row Sum Border

1D mask Window Row Sum for 8 and 16 bit images with border control.

Common parameters for nppiSumWindowRowBorder functions include:

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

param eSrcType

source image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oROI

Region-of-Interest (ROI).

param nMaskSize

Length of the linear kernel array.

param nAnchor

X offset of the kernel origin frame of reference relative to the source pixel.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiSumWindowRowBorder_Ctx(NppDataType eSrcType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, Npp32f *pDst, Npp32s nDstStep, NppiSize oROI, Npp32s nMaskSize, Npp32s nAnchor, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image 1D (row) sum to 32f with border control.

Apply Row Window Summation filter over a 1D mask region around each source pixel for input images with 32-bit floating point output.

Result 32-bit floating point pixel is equal to the sum of the corresponding and neighboring row pixel values in a mask region of the source image defined by nMaskSize and nAnchor.

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

Image Convolution

Convolution

The set convolution functions available in the library.

Image Filter

Filter

General purpose 2D convolution filter.

Pixels under the mask are multiplied by the respective weights in the mask and the results are summed. Before writing the result pixel the sum is scaled back via division by nDivisor.

Common parameters for nppiFilter functions include:

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

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pKernel

Pointer to the start address of the kernel coefficient array. Coeffcients are expected to be stored in reverse order.

param oKernelSize

Width and Height of the rectangular kernel.

param oAnchor

X and Y offsets of the kernel origin frame of reference relative to the source pixel.

param nDivisor

The factor by which the convolved summation from the Filter operation should be divided. If equal to the sum of coefficients, this will keep the maximum result value within full scale.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilter_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, const Npp32s *pKernel, NppiSize oKernelSize, NppiPoint oAnchor, Npp32s nDivisor, NppStreamContext nppStreamCtx)

Image convolution filter with integer coefficients.

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

Image Filter 32f

Filter32f

General purpose 2D convolution filter using floating point weights.

Pixels under the mask are multiplied by the respective weights in the mask and the results are summed.

Common parameters for nppiFilter32f functions include:

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

param eSrcType

source image_data_type.

param eDstType

destination image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pKernel

Pointer to the start address of the kernel coefficient array. Coeffcients are expected to be stored in reverse order.

param oKernelSize

Width and Height of the rectangular kernel.

param oAnchor

X and Y offsets of the kernel origin frame of reference relative to the source pixel.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilter32f_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, void *pDst, int nDstStep, NppiSize oSizeROI, const Npp32f *pKernel, NppiSize oKernelSize, NppiPoint oAnchor, NppStreamContext nppStreamCtx)

Image convolution filter with float coefficients.

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

Image Filter Border

FilterBorder

General purpose 2D convolution filter with border control.

Pixels under the mask are multiplied by the respective weights in the mask and the results are summed. Before writing the result pixel the sum is scaled back via division by nDivisor. If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

Common parameters for nppiFilterBorder functions include:

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

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pKernel

Pointer to the start address of the kernel coefficient array. Coeffcients are expected to be stored in reverse order.

param oKernelSize

Width and Height of the rectangular kernel.

param oAnchor

X and Y offsets of the kernel origin frame of reference relative to the source pixel.

param nDivisor

The factor by which the convolved summation from the Filter operation should be divided. If equal to the sum of coefficients, this will keep the maximum result value within full scale.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, const Npp32s *pKernel, NppiSize oKernelSize, NppiPoint oAnchor, Npp32s nDivisor, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image convolution filter with integer coefficients and border control.

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

Image Filter Border 32f

FilterBorder32f

General purpose 2D convolution filter using floating-point weights with border control.

Pixels under the mask are multiplied by the respective weights in the mask and the results are summed. Before writing the result pixel the sum is scaled back via division by nDivisor. If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

Common parameters for nppiFilterBorder32f functions include:

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

param eSrcType

source image_data_type.

param eDstType

destination image_data_type.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param pKernel

Pointer to the start address of the kernel coefficient array. Coeffcients are expected to be stored in reverse order.

param oKernelSize

Width and Height of the rectangular kernel.

param oAnchor

X and Y offsets of the kernel origin frame of reference relative to the source pixel.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterBorder32f_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, int nDstStep, NppiSize oSizeROI, const Npp32f *pKernel, NppiSize oKernelSize, NppiPoint oAnchor, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image convolution filter with float coefficients and border control.

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

Image 2D Fixed Linear Filters

2D Fixed Linear Filters

The set of 2D fixed linear filtering functions available in the library.

Image Filter Box

FilterBox

Computes the average pixel values of the pixels under a rectangular mask.

Common parameters for nppiFilterBox functions include:

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

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param oMaskSize

Width and Height of the neighborhood region for the local Avg operation.

param oAnchor

X and Y offsets of the kernel origin frame of reference relative to the source pixel.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterBox_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiSize oMaskSize, NppiPoint oAnchor, NppStreamContext nppStreamCtx)

Image box filter.

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

Image Filter Box Border

FilterBoxBorder

Computes the average pixel values of the pixels under a rectangular mask with border control. If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported. *

Common parameters for nppiFilterBoxBorder 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

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param oMaskSize

Width and Height of the neighborhood region for the local Avg operation.

param oAnchor

X and Y offsets of the kernel origin frame of reference relative to the source pixel.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterBoxBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiSize oMaskSize, NppiPoint oAnchor, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image box filter with border control.

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

Image Filter Box Border Advanced

FilterBoxBorderAdvanced

Computes the average pixel values of the pixels under a rectangular mask with border control. If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image. These versions of the functions are intended to significantly improve performance when very large mask sizes are used.

Currently only the NPP_BORDER_REPLICATE border type operation is supported. *

Common parameters for nppiFilterBoxBorderAdvanced functions include:

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

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param oMaskSize

Width and Height of the neighborhood region for the local Avg operation.

param oAnchor

X and Y offsets of the kernel origin frame of reference relative to the source pixel.

param eBorderType

The border type operation to be applied at source image border boundaries.

param pBuffer

Pointer to device memory buffer of size hpBufferSize bytes returned by calling nppiFilterBoxBorderAdvancedGetDeviceBufferSize.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterBoxBorderAdvanced_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiSize oMaskSize, NppiPoint oAnchor, NppiBorderType eBorderType, Npp8u *pBuffer, NppStreamContext nppStreamCtx)

Image box filter advanced with border control.

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

Image Filter Threshold Adaptive Box Border

FilterThresholdAdaptiveBoxBorder

Computes the average pixel values of the pixels under a square mask with border control. If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image. Once the neighborhood average around a source pixel is determined the souce pixel is compared to the average - nDelta and if the source pixel is greater than that average the corresponding destination pixel is set to nValGT, otherwise nValLE.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param oMaskSize

Width and Height of the neighborhood region for the local Avg operation, Width and Height must be equal and odd.

param nDelta

Neighborhood average adjustment value

param nValGT

Destination output value if source pixel is greater than average.

param nValLE

Destination output value if source pixel is less than or equal to average.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Image Rank Filters

Rank Filters

The set of functions providing min/max/median values for rectangular mask region with/without border available in the library.

Image Filter Max

FilterMax

Result pixel value is the maximum of pixel values under the rectangular mask region.

Common parameters for nppiFilterMax 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.

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param oMaskSize

Width and Height of the neighborhood region for the local Max operation.

param oAnchor

X and Y offsets of the kernel origin frame of reference relative to the source pixel.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterMax_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiSize oMaskSize, NppiPoint oAnchor, NppStreamContext nppStreamCtx)

Image maximum filter.

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

Image Filter Max Border

FilterMaxBorder

Result pixel value is the maximum of pixel values under the rectangular mask region with border control.

If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

Common parameters for nppiFilterMaxBorder 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.

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param oMaskSize

Width and Height of the neighborhood region for the local Max operation.

param oAnchor

X and Y offsets of the kernel origin frame of reference relative to the source pixel.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterMaxBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiSize oMaskSize, NppiPoint oAnchor, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image maximum filter with border control.

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

Image Filter Min

FilterMin

Result pixel value is the minimum of pixel values under the rectangular mask region.

Common parameters for nppiFilterMin 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.

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param oMaskSize

Width and Height of the neighborhood region for the local Min operation.

param oAnchor

X and Y offsets of the kernel origin frame of reference relative to the source pixel.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterMin_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiSize oMaskSize, NppiPoint oAnchor, NppStreamContext nppStreamCtx)

Image minimum filter.

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

Image Filter Min Border

FilterMinBorder

Result pixel value is the minimum of pixel values under the rectangular mask region with border control.

If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

Common parameters for nppiFilterMinBorder 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.

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param oMaskSize

Width and Height of the neighborhood region for the local Min operation.

param oAnchor

X and Y offsets of the kernel origin frame of reference relative to the source pixel.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterMinBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiSize oMaskSize, NppiPoint oAnchor, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image minimum filter with border control.

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

Image Filter Median

FilterMedian

Result pixel value is the median of pixel values under the rectangular mask region.

Common parameters for nppiFilterMedian 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.

Common parameters for nppiFilterMedianGetBufferSize 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

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param oMaskSize

Width and Height of the neighborhood region for the local Median operation.

param oAnchor

X and Y offsets of the kernel origin frame of reference relative to the source pixel.

param pBuffer

Pointer to the user-allocated scratch buffer required for the Median operation.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param oSizeROI

Region-of-Interest (ROI).

param oMaskSize

Width and Height of the neighborhood region for the local Median operation.

param nBufferSize

Pointer to the size of the scratch buffer required for the Median operation.

param nppStreamCtx

Application Managed Stream Context

return

Image Data Related Error Codes

Functions

NppStatus nppiFilterMedian_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiSize oMaskSize, NppiPoint oAnchor, Npp8u *pBuffer, NppStreamContext nppStreamCtx)

Image median filter.

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

NppStatus nppiFilterMedianGetBufferSize_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, NppiSize oSizeROI, NppiSize oMaskSize, Npp32u *nBufferSize, NppStreamContext nppStreamCtx)

Get median filter scratch memory size.

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

Image Filter Median Border

FilterMedianBorder

Result pixel value is the median of pixel values under the rectangular mask region.

Common parameters for nppiFilterMedianBorder 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.

Common parameters for nppiFilterMedianBorderGetBufferSize 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

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param oMaskSize

Width and Height of the neighborhood region for the local Median operation.

param oAnchor

X and Y offsets of the kernel origin frame of reference relative to the source pixel.

param pBuffer

Pointer to the user-allocated scratch buffer required for the Median operation.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param oSizeROI

Region-of-Interest (ROI).

param oMaskSize

Width and Height of the neighborhood region for the local Median operation.

param nBufferSize

Pointer to the size of the scratch buffer required for the Median operation.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes

Functions

NppStatus nppiFilterMedianBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiSize oMaskSize, NppiPoint oAnchor, Npp8u *pBuffer, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image median filter with border control.

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

NppStatus nppiFilterMedianBorderGetBufferSize_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, NppiSize oSizeROI, NppiSize oMaskSize, Npp32u *nBufferSize, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Get median filter border scratch memory size.

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

Image Fixed Filters

Fixed Filters

Fixed filters perform linear filtering operations (such as convolutions) with predefined kernels of fixed sizes. Note that this section also contains a few dynamic kernel filters, namely GaussAdvanced and Bilateral.

Some of the fixed filters have versions with border control. For these functions, if any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported for these functions.

Image Filter Prewitt

FilterPrewitt

Filters the image using a Prewitt filter kernel.

Common parameters for nppiFilterPrewitt functions include:

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

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-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

FilterPrewittHoriz

Filters the image using a horizontal Prewitt filter kernel:

\[\begin{split} \left( \begin{array}{rrr} 1 & 1 & 1 \\ 0 & 0 & 0 \\ -1 & -1 & -1 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterPrewittHoriz_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppStreamContext nppStreamCtx)

Image horizontal Prewitt filter.

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

FilterPrewittVert

Filters the image using a vertical Prewitt filter kernel:

\[\begin{split} \left( \begin{array}{rrr} -1 & 0 & 1 \\ -1 & 0 & 1 \\ -1 & 0 & 1 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterPrewittVert_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppStreamContext nppStreamCtx)

Image vertical Prewitt filter.

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

Image Filter Prewitt Border

FilterPrewittBorder

Filters the image using a Prewitt filter kernel with border control.

Common parameters for nppiFilterPrewittBorder functions include:

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

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

FilterPrewittHorizBorder

Filters the image using a horizontal Prewitt filter kernel with border control.

If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

\[\begin{split} \left( \begin{array}{rrr} 1 & 1 & 1 \\ 0 & 0 & 0 \\ -1 & -1 & -1 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterPrewittHorizBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image horizontal Prewitt filter with border control.

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

FilterPrewittVertBorder

Filters the image using a vertical Prewitt filter kernel with border control.

If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

\[\begin{split} \left( \begin{array}{rrr} -1 & 0 & 1 \\ -1 & 0 & 1 \\ -1 & 0 & 1 \\ \end{array} \right); \end{split}\]

NppStatus nppiFilterPrewittVertBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image vertical Prewitt filter with border control.

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

Image Filter Scharr

FilterScharr

Filters the image using a Scharr filter kernel.

Common parameters for nppiFilterScharr functions include:

Supported data types include NPP_8U, NPP_16S, NPP_32F. Supported channel counts include NPP_CH_1.

param eSrcType

source image_data_type.

param eDstType

destination image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-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

FilterScharrHoriz

Filters the image using a horizontal Scharr filter kernel:

\[\begin{split} \left( \begin{array}{rrr} 3 & 10 & 3 \\ 0 & 0 & 0 \\ -3 & -10 & -3 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterScharrHoriz_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppStreamContext nppStreamCtx)

Image horizontal Scharr filter.

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

FilterScharrVert

Filters the image using a vertical Scharr filter kernel:

\[\begin{split} \left( \begin{array}{rrr} -3 & 0 & 3 \\ -10 & 0 & 10 \\ -3 & 0 & 3 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterScharrVert_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppStreamContext nppStreamCtx)

Image vertical Scharr filter.

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

Image Filter Scharr Border

FilterScharrBorder

Filters the image using a Scharr filter kernel with border control.

Common parameters for nppiFilterScharrBorder functions include:

Supported data types include NPP_8U, NPP_16S, NPP_32F. Supported channel counts include NPP_CH_1.

param eSrcType

source image_data_type.

param eDstType

destination image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

FilterScharrHorizBorder

Filters the image using a horizontal Scharr filter kernel with border control:

\[\begin{split} \left( \begin{array}{rrr} 3 & 10 & 3 \\ 0 & 0 & 0 \\ -3 & -10 & -3 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterScharrHorizBorder_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image horizontal Scharr filter kernel with border control.

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

FilterScharrVertBorder

Filters the image using a vertical Scharr filter kernel kernel with border control:

\[\begin{split} \left( \begin{array}{rrr} -3 & 0 & 3 \\ -10 & 0 & 10 \\ -3 & 0 & 3 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterScharrVertBorder_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image vertical Scharr filter kernel with border control.

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

Image Filter Sobel

FilterSobel

Filters the image using a Sobel filter kernel.

Common parameters for nppiFilterSobel functions include:

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

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param eMaskSize

Enumeration value specifying the mask size.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

FilterSobelHoriz

Filters the image using a horizontal Sobel filter kernel:

\[\begin{split} \left( \begin{array}{rrr} 1 & 2 & 1 \\ 0 & 0 & 0 \\ -1 & -2 & -1 \\ \end{array} \right) \left( \begin{array}{rrrrr} 1 & 4 & 6 & 4 & 1 \\ 2 & 8 & 12 & 8 & 2 \\ 0 & 0 & 0 & 0 & 0 \\ -2 & -8 & -12 & -8 & -2 \\ -1 & -4 & -6 & -4 & -1 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterSobelHoriz_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppStreamContext nppStreamCtx)

Image horizontal Sobel filter.

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

FilterSobelVert

Filters the image using a vertical Sobel filter kernel:

\[\begin{split} \left( \begin{array}{rrr} -1 & 0 & 1 \\ -2 & 0 & 2 \\ -1 & 0 & 1 \\ \end{array} \right) \left( \begin{array}{rrrrr} -1 & -2 & 0 & 2 & 1 \\ -4 & -8 & 0 & 8 & 4 \\ -6 & -12 & 0 & 12 & 6 \\ -4 & -8 & 0 & 8 & 4 \\ -1 & -2 & 0 & 2 & 1 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterSobelVert_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppStreamContext nppStreamCtx)

Image vertical Sobel filter.

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

FilterSobelHorizSecond

Filters the image using a second derivative, horizontal Sobel filter kernel:

\[\begin{split} \left( \begin{array}{rrr} 1 & 2 & 1 \\ -2 & -4 & -2 \\ 1 & 2 & 1 \\ \end{array} \right) \left( \begin{array}{rrrrr} 1 & 4 & 6 & 4 & 1 \\ 0 & 0 & 0 & 0 & 0 \\ -2 & -8 & -12 & -8 & -2 \\ 0 & 0 & 0 & 0 & 0 \\ 1 & 4 & 6 & 4 & 1 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterSobelHorizSecond_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiMaskSize eMaskSize, NppStreamContext nppStreamCtx)

Single channel image signed second derivative, horizontal Sobel filter.

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

FilterSobelVertSecond

Filters the image using a second derivative, vertical Sobel filter kernel:

\[\begin{split} \left( \begin{array}{rrr} 1 & -2 & 1 \\ 2 & -4 & 2 \\ 1 & -2 & 1 \\ \end{array} \right) \left( \begin{array}{rrrrr} 1 & 0 & -2 & 0 & 1 \\ 4 & 0 & -8 & 0 & 4 \\ 6 & 0 & -12 & 0 & 6 \\ 4 & 0 & -8 & 0 & 4 \\ 1 & 0 & -2 & 0 & 1 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterSobelVertSecond_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiMaskSize eMaskSize, NppStreamContext nppStreamCtx)

Single channel image signed second derivative, vertical Sobel filter.

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

FilterSobelCross

Filters the image using a second cross derivative Sobel filter kernel:

\[\begin{split} \left( \begin{array}{rrr} -1 & 0 & 1 \\ 0 & 0 & 0 \\ 1 & 0 & -1 \\ \end{array} \right) \left( \begin{array}{rrrrr} -1 & -2 & 0 & 2 & 1 \\ -2 & -4 & 0 & 4 & 2 \\ 0 & 0 & 0 & 0 & 0 \\ 2 & 4 & 0 & -4 & -2 \\ 1 & 2 & 0 & -2 & -1 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterSobelCross_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiMaskSize eMaskSize, NppStreamContext nppStreamCtx)

Single channel mage signed second cross derivative Sobel filter.

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

Image Filter Sobel Border

FilterSobelBorder

Filters the image using a Sobel filter kernel with border control.

Common parameters for nppiFilterSobelBorder functions include:

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

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param eMaskSize

Enumeration value specifying the mask size.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

FilterSobelHorizBorder

Filters the image using a horizontal Sobel filter kernel with border control:

\[\begin{split} \left( \begin{array}{rrr} 1 & 2 & 1 \\ 0 & 0 & 0 \\ -1 & -2 & -1 \\ \end{array} \right) \left( \begin{array}{rrrrr} 1 & 4 & 6 & 4 & 1 \\ 2 & 8 & 12 & 8 & 2 \\ 0 & 0 & 0 & 0 & 0 \\ -2 & -8 & -12 & -8 & -2 \\ -1 & -4 & -6 & -4 & -1 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterSobelHorizBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image horizontal Sobel filter with border control.

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

FilterSobelVertBorder

Filters the image using a vertical Sobel filter kernel with border control:

\[\begin{split} \left( \begin{array}{rrr} -1 & 0 & 1 \\ -2 & 0 & 2 \\ -1 & 0 & 1 \\ \end{array} \right) \left( \begin{array}{rrrrr} -1 & -2 & 0 & 2 & 1 \\ -4 & -8 & 0 & 8 & 4 \\ -6 & -12 & 0 & 12 & 6 \\ -4 & -8 & 0 & 8 & 4 \\ -1 & -2 & 0 & 2 & 1 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterSobelVertBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image vertical Sobel filter with border control.

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

FilterSobelHorizSecondBorder

Filters the image using a second derivative, horizontal Sobel filter kernel with border control:

\[\begin{split} \left( \begin{array}{rrr} 1 & 2 & 1 \\ -2 & -4 & -2 \\ 1 & 2 & 1 \\ \end{array} \right) \left( \begin{array}{rrrrr} 1 & 4 & 6 & 4 & 1 \\ 0 & 0 & 0 & 0 & 0 \\ -2 & -8 & -12 & -8 & -2 \\ 0 & 0 & 0 & 0 & 0 \\ 1 & 4 & 6 & 4 & 1 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterSobelHorizSecondBorder_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiMaskSize eMaskSize, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Single channel image signed second derivative, horizontal Sobel filter with border control.

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

FilterSobelVertSecondBorder

Filters the image using a second derivative, vertical Sobel filter kernel with border control:

\[\begin{split} \left( \begin{array}{rrr} 1 & -2 & 1 \\ 2 & -4 & 2 \\ 1 & -2 & 1 \\ \end{array} \right) \left( \begin{array}{rrrrr} 1 & 0 & -2 & 0 & 1 \\ 4 & 0 & -8 & 0 & 4 \\ 6 & 0 & -12 & 0 & 6 \\ 4 & 0 & -8 & 0 & 4 \\ 1 & 0 & -2 & 0 & 1 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterSobelVertSecondBorder_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiMaskSize eMaskSize, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Single channel image signed second derivative, vertical Sobel filter with border control.

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

FilterSobelCrossBorder

Filters the image using a second cross derivative Sobel filter kernel with border control:

\[\begin{split} \left( \begin{array}{rrr} -1 & 0 & 1 \\ 0 & 0 & 0 \\ 1 & 0 & -1 \\ \end{array} \right) \left( \begin{array}{rrrrr} -1 & -2 & 0 & 2 & 1 \\ -2 & -4 & 0 & 4 & 2 \\ 0 & 0 & 0 & 0 & 0 \\ 2 & 4 & 0 & -4 & -2 \\ 1 & 2 & 0 & -2 & -1 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterSobelCrossBorder_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiMaskSize eMaskSize, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Single channel image signed second cross derivative Sobel filter with border control.

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

Image Filter Roberts

FilterRoberts

Filters the image using a Roberts filter kernel.

Common parameters for nppiFilterRoberts functions include:

Supported data types include NPP_8U, 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.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-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

FilterRobertsDown

Filters the image using a horizontal Roberts filter kernel:

\[\begin{split} \left( \begin{array}{rrr} 0 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & -1 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterRobertsDown_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppStreamContext nppStreamCtx)

Image horizontal Roberts filter.

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

FilterRobertsUp

Filters the image using a vertical Roberts filter kernel:

\[\begin{split} \left( \begin{array}{rrr} 0 & 0 & 0 \\ 0 & 1 & 0 \\ -1 & 0 & 0 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterRobertsUp_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppStreamContext nppStreamCtx)

Image vertical Roberts filter.

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

Image Filter Roberts Border

FilterRobertsBorder

Filters the image using a Roberts filter kernel with border control.

Common parameters for nppiFilterRobertsBorder functions include:

Supported data types include NPP_8U, 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.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

FilterRobertsDownBorder

Filters the image using a horizontal Roberts filter kernel with border control.

If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

\[\begin{split} \left( \begin{array}{rrr} 0 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & -1 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterRobertsDownBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image horizontal Roberts filter with border control.

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

FilterRobertsUpBorder

Filters the image using a vertical Roberts filter kernel with border control.

If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

\[\begin{split} \left( \begin{array}{rrr} 0 & 0 & 0 \\ 0 & 1 & 0 \\ -1 & 0 & 0 \\ \end{array} \right) \end{split}\]

NppStatus nppiFilterRobertsUpBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image vertical Roberts filter with border control.

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

Image Filter Laplace

FilterLaplace

Filters the image using a Laplacian filter kernel.

Common parameters for nppiFilterLaplace functions include:

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

\[\begin{split} \left( \begin{array}{rrr} -1 & -1 & -1 \\ -1 & 8 & -1 \\ -1 & -1 & -1 \\ \end{array} \right) \left( \begin{array}{rrrrr} -1 & -3 & -4 & -3 & -1 \\ -3 & 0 & 6 & 0 & -3 \\ -4 & 6 & 20 & 6 & -4 \\ -3 & 0 & 6 & 0 & -3 \\ -1 & -3 & -4 & -3 & -1 \\ \end{array} \right)\end{split}\]

param eSrcType

source image_data_type.

param eDstType

destination image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param eMaskSize

Enumeration value specifying the mask size.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterLaplace_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiMaskSize eMaskSize, NppStreamContext nppStreamCtx)

Image Laplace filter.

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

Image Filter Laplace Border

FilterLaplaceBorder

Filters the image using a Laplacian filter kernel with border control.

If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

Common parameters for nppiFilterLaplaceBorder functions include:

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

\[\begin{split} \left( \begin{array}{rrr} -1 & -1 & -1 \\ -1 & 8 & -1 \\ -1 & -1 & -1 \\ \end{array} \right) \left( \begin{array}{rrrrr} -1 & -3 & -4 & -3 & -1 \\ -3 & 0 & 6 & 0 & -3 \\ -4 & 6 & 20 & 6 & -4 \\ -3 & 0 & 6 & 0 & -3 \\ -1 & -3 & -4 & -3 & -1 \\ \end{array} \right)\end{split}\]

param eSrcType

source image_data_type.

param eDstType

destination image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param eMaskSize

Enumeration value specifying the mask size.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterLaplaceBorder_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiMaskSize eMaskSize, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image Laplace filter with border control.

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

Image Filter Gauss

FilterGauss

Filters the image using a Gaussian filter kernel. Use FilterGaussAdvanced if you want to supply your own filter coefficients.

Note that all FilterGauss functions currently support mask sizes up to 15x15. Filter kernels for these functions are calculated using a sigma value of 0.4F + (mask width / 2) * 0.6F.

Common parameters for nppiFilterGauss 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

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param eMaskSize

Enumeration value specifying the mask size.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterGauss_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiMaskSize eMaskSize, NppStreamContext nppStreamCtx)

Image Gauss filter.

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

Image Filter Gauss Advanced

FilterGaussAdvanced

Filters the image using a separable Gaussian filter kernel with user supplied floating point coefficients:

Common parameters for nppiFilterGaussAdvanced 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

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param nFilterTaps

The number of filter taps where nFilterTaps = 2 * ((int)((float)ceil(radius) + 0.5F) ) + 1.

param pKernel

Pointer to an array of nFilterTaps kernel coefficients which sum to 1.0F.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterGaussAdvanced_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, const int nFilterTaps, const Npp32f *pKernel, NppStreamContext nppStreamCtx)

Image Gauss filter advanced.

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

Image Filter Gauss Border

FilterGaussBorder

Filters the image using a Gaussian filter kernel with border control. Use FilterGaussAdvancedBorder if you want to supply your own filter coefficients.

If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

Note that all FilterGaussBorder functions currently support mask sizes up to 15x15. Filter kernels for these functions are calculated using a sigma value of 0.4F + (mask width / 2) * 0.6F.

Common parameters for nppiFilterGaussBorder 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

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param eMaskSize

Enumeration value specifying the mask size.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterGaussBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiMaskSize eMaskSize, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image Gauss filter with border control.

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

Image Filter Gauss Advanced Border

FilterGaussAdvancedBorder

Filters the image using a separable Gaussian filter kernel with user supplied floating point coefficients with border control.

If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Note that the performance of these functions can drop significantly for filter kernels with a very large number of taps.

Currently only the NPP_BORDER_REPLICATE and NPP_BORDER_MIRROR border type operations are supported.

Common parameters for nppiFilterGaussAdvancedBorder 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

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param nFilterTaps

The number of filter taps where nFilterTaps = 2 * ((int)((float)ceil(radius) + 0.5F) ) + 1.

param pKernel

Pointer to an array of nFilterTaps kernel coefficients which sum to 1.0F.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterGaussAdvancedBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, const int nFilterTaps, const Npp32f *pKernel, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image Gauss filter advanced with border control.

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

Image Filter Gauss Pyramid Layer Down Border

FilterGaussPyramidLayerDownBorder

Filters the image using a separable Gaussian filter kernel with user supplied floating point coefficients with downsampling and border control.

If the downsampling rate is equivalent to an integer value then unnecessary source pixels are just skipped. If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_MIRROR and NPP_BORDER_REPLICATE border type operations are supported.

Common parameters for nppiFilterGaussPyramidLayerDownBorder functions include:

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

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param nRate

The downsampling rate to be used. For integer equivalent rates unnecessary source pixels are just skipped. For non-integer rates the source image is bilinear interpolated. nRate must be > 1.0F and <= 10.0F.

param nFilterTaps

The number of filter taps where nFilterTaps = 2 * ((int)((float)ceil(radius) + 0.5F) ) + 1.

param pKernel

Pointer to an array of nFilterTaps kernel coefficients which sum to 1.0F.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Image Filter Gauss Pyramid Layer Up Border

FilterGaussPyramidLayerUpBorder

Filters the image using a separable Gaussian filter kernel with user supplied floating point coefficients with upsampling and border control.

If the upsampling rate is equivalent to an integer value then unnecessary source pixels are just skipped. If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_MIRROR and NPP_BORDER_REPLICATE border type operations are supported.

Common parameters for nppiFilterGaussPyramidLayerUpBorder functions include:

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

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param nRate

The upsampling rate to be used. For integer equivalent rates unnecessary source pixels are just skipped. For non-integer rates the source image is bilinear interpolated. nRate must be > 1.0F and <= 10.0F.

param nFilterTaps

The number of filter taps where nFilterTaps = 2 * ((int)((float)ceil(radius) + 0.5F) ) + 1.

param pKernel

Pointer to an array of nFilterTaps kernel coefficients which sum to 1.0F.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Image Filter Bilateral Gauss Border

FilterBilateralGaussBorder

Filters the image using a bilateral Gaussian filter kernel with border control.

If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

For this filter the anchor point is always the central element of the kernel. Coefficients of the bilateral filter kernel depend on their position in the kernel and on the value of some source image pixels overlayed by the filter kernel. Only source image pixels with both coordinates divisible by nDistanceBetweenSrcPixels are used in calculations.

The value of an output pixel \(d\) is

\[d = \frac{\sum_{h=-nRadius}^{nRadius}\sum_{w=-nRadius}^{nRadius}W1(h,w)\cdot W2(h,w)\cdot S(h,w)}{\sum_{h=-nRadius}^{nRadius}\sum_{w=-nRadius}^{nRadius}W1(h,w)\cdot W2(h,w)}\]
where h and w are the corresponding kernel width and height indexes, S(h,w) is the value of the source image pixel overlayed by filter kernel position (h,w), W1(h,w) is func(nValSquareSigma, (S(h,w) - S(0,0))) where S(0,0) is the value of the source image pixel at the center of the kernel, W2(h,w) is func(nPosSquareSigma, sqrt(h*h+w*w)), and func is the following formula
\[func(S,I) = exp(-\frac{I^2}{2.0F\cdot S^2})\]

Currently only the NPP_BORDER_REPLICATE border type operations are supported.

Common parameters for nppiFilterBilateralGaussBorder functions include:

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

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param nRadius

The radius of the round filter kernel to be used. A radius of 1 indicates a filter kernel size of 3 by 3, 2 indicates 5 by 5, etc. Radius values from 1 to 32 are supported.

param nStepBetweenSrcPixels

The step size between adjacent source image pixels processed by the filter kernel, most commonly 1.

param nValSquareSigma

The square of the sigma for the relative intensity distance between a source image pixel in the filter kernel and the source image pixel at the center of the filter kernel.

param nPosSquareSigma

The square of the sigma for the relative geometric distance between a source image pixel in the filter kernel and the source image pixel at the center of the filter kernel.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterBilateralGaussBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, const int nRadius, const int nStepBetweenSrcPixels, const Npp32f nValSquareSigma, const Npp32f nPosSquareSigma, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image bilateral Gauss filter with border control.

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

Image Filter High Pass

FilterHighPass

Filters the image using a high-pass filter kernel.

Common parameters for nppiFilterHighPass 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.

\[\begin{split} \left( \begin{array}{rrr} -1 & -1 & -1 \\ -1 & 8 & -1 \\ -1 & -1 & -1 \\ \end{array} \right) \left( \begin{array}{rrrrr} -1 & -1 & -1 & -1 & -1 \\ -1 & -1 & -1 & -1 & -1 \\ -1 & -1 & 24 & -1 & -1 \\ -1 & -1 & -1 & -1 & -1 \\ -1 & -1 & -1 & -1 & -1 \\ \end{array} \right) \end{split}\]

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param eMaskSize

Enumeration value specifying the mask size.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterHighPass_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiMaskSize eMaskSize, NppStreamContext nppStreamCtx)

Image high-pass filter.

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

Image Filter High Pass Border

FilterHighPassBorder

Filters the image using a high-pass filter kernel with border control.

If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

Common parameters for nppiFilterHighPassBorder 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.

\[\begin{split} \left( \begin{array}{rrr} -1 & -1 & -1 \\ -1 & 8 & -1 \\ -1 & -1 & -1 \\ \end{array} \right) \left( \begin{array}{rrrrr} -1 & -1 & -1 & -1 & -1 \\ -1 & -1 & -1 & -1 & -1 \\ -1 & -1 & 24 & -1 & -1 \\ -1 & -1 & -1 & -1 & -1 \\ -1 & -1 & -1 & -1 & -1 \\ \end{array} \right) \end{split}\]

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param eMaskSize

Enumeration value specifying the mask size.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterHighPassBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiMaskSize eMaskSize, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image high-pass filter.

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

Image Filter Low Pass

FilterLowPass

Filters the image using a low-pass filter kernel.

Common parameters for nppiFilterLowPass 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.

\[\begin{split} \left( \begin{array}{rrr} 1/9 & 1/9 & 1/9 \\ 1/9 & 1/9 & 1/9 \\ 1/9 & 1/9 & 1/9 \\ \end{array} \right) \left( \begin{array}{rrrrr} 1/25 & 1/25 & 1/25 & 1/25 & 1/25 \\ 1/25 & 1/25 & 1/25 & 1/25 & 1/25 \\ 1/25 & 1/25 & 1/25 & 1/25 & 1/25 \\ 1/25 & 1/25 & 1/25 & 1/25 & 1/25 \\ 1/25 & 1/25 & 1/25 & 1/25 & 1/25 \\ \end{array} \right) \end{split}\]

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param eMaskSize

Enumeration value specifying the mask size.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterLowPass_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiMaskSize eMaskSize, NppStreamContext nppStreamCtx)

Image low-pass filter.

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

Image Filter Low Pass Border

FilterLowPassBorder

Filters the image using a low-pass filter kernel with border control.

If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

Common parameters for nppiFilterLowPassBorder 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.

\[\begin{split} \left( \begin{array}{rrr} 1/9 & 1/9 & 1/9 \\ 1/9 & 1/9 & 1/9 \\ 1/9 & 1/9 & 1/9 \\ \end{array} \right) \left( \begin{array}{rrrrr} 1/25 & 1/25 & 1/25 & 1/25 & 1/25 \\ 1/25 & 1/25 & 1/25 & 1/25 & 1/25 \\ 1/25 & 1/25 & 1/25 & 1/25 & 1/25 \\ 1/25 & 1/25 & 1/25 & 1/25 & 1/25 \\ 1/25 & 1/25 & 1/25 & 1/25 & 1/25 \\ \end{array} \right) \end{split}\]

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param eMaskSize

Enumeration value specifying the mask size.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterLowPassBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiMaskSize eMaskSize, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image high-pass filter.

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

Image Filter Sharpen

FilterSharpen

Filters the image using a sharpening filter kernel:

Common parameters for nppiFilterSharpen 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.

\[\begin{split} \left( \begin{array}{rrr} -1/8 & -1/8 & -1/8 \\ -1/8 & 16/8 & -1/8 \\ -1/8 & -1/8 & -1/8 \\ \end{array} \right) \end{split}\]

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-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

Functions

NppStatus nppiFilterSharpen_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppStreamContext nppStreamCtx)

Image sharpening filter.

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

Image Filter Sharpen Border

FilterSharpenBorder

Filters the image using a sharpening filter kernel with border control.

If any portion of the 3x3 mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

Common parameters for nppiFilterSharpenBorder 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.

\[\begin{split} \left( \begin{array}{rrr} -1/8 & -1/8 & -1/8 \\ -1/8 & 16/8 & -1/8 \\ -1/8 & -1/8 & -1/8 \\ \end{array} \right) \end{split}\]

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterSharpenBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image sharpening filter with border control.

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

Image Filter Unsharp Border

FilterUnsharpBorder

Filters the image using a unsharp-mask sharpening filter kernel with border control.

The algorithm involves the following steps: Smooth the original image with a Gaussian filter, with the width controlled by the nRadius. Subtract the smoothed image from the original to create a high-pass filtered image. Apply any clipping needed on the high-pass image, as controlled by the nThreshold. Add a certain percentage of the high-pass filtered image to the original image, with the percentage controlled by the nWeight. In pseudocode this algorithm can be written as: HighPass = Image - Gaussian(Image) Result = Image + nWeight * HighPass * ( |HighPass| >= nThreshold ) where nWeight is the amount, nThreshold is the threshold, and >= indicates a Boolean operation, 1 if true, or 0 otherwise.

If any portion of the mask overlaps the source image boundary, the requested border type operation is applied to all mask pixels which fall outside of the source image.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

Common parameters for nppiFilterUnsharpBorder 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.

Common parameters for nppiFilterUnsharpGetBufferSize functions include:

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

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param nRadius

The radius of the Gaussian filter, in pixles, not counting the center pixel.

param nSigma

The standard deviation of the Gaussian filter, in pixel.

param nWeight

The percentage of the difference between the original and the high pass image that is added back into the original.

param nThreshold

The threshold neede to apply the difference amount.

param eBorderType

The border type operation to be applied at source image border boundaries.

param pDeviceBuffer

Pointer to the user-allocated device scratch buffer required for the unsharp operation.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

param eSrcDstType

image_data_type.

param nRadius

The radius of the Gaussian filter, in pixles, not counting the center pixel.

param nSigma

The standard deviation of the Gaussian filter, in pixel.

param hpBufferSize

Pointer to the size of the scratch buffer required for the unsharp operation.

return

Image Data Related Error Codes

Functions

NppStatus nppiFilterUnsharpBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, Npp32f nRadius, Npp32f nSigma, Npp32f nWeight, Npp32f nThreshold, NppiBorderType eBorderType, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Image unsharp filter.

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

NppStatus nppiFilterUnsharpGetBufferSize(NppDataType eSrcDstType, const Npp32f nRadius, const Npp32f nSigma, int *hpBufferSize)

Unsharp filter scratch memory size.

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

Image Filter Wiener Border

FilterWienerBorder

Noise removal filtering of an image using an adaptive Wiener filter with border control.

Pixels under the source mask are used to generate statistics about the local neighborhood which are then used to control the amount of adaptive noise filtering locally applied.

Note that if the noise value for a particular channel is set to 0.0f then the output for that channel will contain the square of the variance of local pixels within aMaskSize surrounding each pixel in oSizeROI. Note that is unlikely to be useful unless the pixel data type is floating point due to result clamping. Output from these cases can then be passed through an nppiMean function call using the same oSizeROI. The square root for that channel from the nppiMean call result can then be used as a noise value for a future call to this function if there is no known preexisting noise value.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

Common parameters for nppiFilterWienerBorder functions include:

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

For each pixel in the source image the function estimates the local mean and variance in the neighborhood defined by oMaskSize relative to the primary source pixel located at oAnchor.x and oAnchor.y. Given an oMaskSize with width

\(W\) and height \(H\), the mean, variance, and destination pixel value will be computed per channel as
\[Mean = \frac{1}{W\cdot H}\sum_{j=0}^{H-1}\sum_{i=0}^{W-1}pSrc(j,i)\]
\[Variance^2 = \frac{1}{W\cdot H}\sum_{j=0}^{H-1}\sum_{i=0}^{W-1}(pSrc(j,i)^2-Mean^2)\]
\[pDst(j,i) = Mean+\frac{(Variance^2-NoiseVariance^2)}{Variance^2}\cdot {(pSrc(j,i)-Mean)}\]

param eSrcDstType

image_data_type.

param eSrcDstChannels

image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-of-Interest (ROI).

param oMaskSize

Pixel Width and Height of the rectangular region of interest surrounding the source pixel.

param oAnchor

Positive X and Y relative offsets of primary pixel in region of interest surrounding the source pixel relative to bottom right of oMaskSize.

param aNoise

Fixed size array of per-channel noise variance level value in range of 0.0F to 1.0F.

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiFilterWienerBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppiSize oMaskSize, NppiPoint oAnchor, Npp32f aNoise[4], NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image Wiener filter with border control.

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

Image Filter Gradient Vector Prewitt Border

GradientVectorPrewittBorder

RGB Color to Prewitt Gradient Vector conversion using user selected fixed mask size and gradient distance method. Functions support up to 4 optional single channel output gradient vectors, X (vertical), Y (horizontal), magnitude, and angle with user selectable distance methods. Output for a particular vector is disabled by supplying a NULL pointer for that vector. X and Y gradient vectors are in cartesian form in the destination data type.

Magnitude vectors are polar gradient form in the destination data type, angle is always in floating point polar gradient format. Only fixed mask sizes of 3x3 are supported. Only nppiNormL1 (sum) and nppiNormL2 (sqrt of sum of squares) distance methods are currently supported.

Currently only the NPP_BORDER_REPLICATE border type operation is supported. Borderless output can be accomplished by using a larger source image than the destination and adjusting oSrcSize and oSrcOffset parameters accordingly.

Common parameters for nppiFilterGradientVectorPrewittBorder functions include:

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

The following fixed kernel mask is used for producing the pDstX (vertical) output image.

\[\begin{split} \left( \begin{array}{rrr} -1 & 0 & 1 \\ -1 & 0 & 1 \\ -1 & 0 & 1 \\ \end{array} \right) \end{split}\]

The following fixed kernel mask is used for producing the pDstY (horizontal) output image.

\[\begin{split} \left( \begin{array}{rrr} 1 & 1 & 1 \\ 0 & 0 & 0 \\ -1 & -1 & -1 \\ \end{array} \right) \end{split}\]

For the C1R versions of the function the pDstMag output image value for L1 normalization consists of the absolute value of the pDstX value plus the absolute value of the pDstY value at that particular image pixel location. For the C1R versions of the function the pDstMag output image value for L2 normalization consists of the square root of the pDstX value squared plus the pDstY value squared at that particular image pixel location. For the C1R versions of the function the pDstAngle output image value consists of the arctangent (atan2) of the pDstY value and the pDstX value at that particular image pixel location.

For the C3C1R versions of the function, regardless of the selected normalization method, the L2 normalization value is first determined for each or the pDstX and pDstY values for each source channel then the largest L2 normalization value (largest gradient) is used to select which of the 3 pDstX channel values are output to the pDstX image or pDstY channel values are output to the pDstY image. For the C3C1R versions of the function the pDstMag output image value for L1 normalizaton consists of the same technique used for the C1R version for each source image channel. Then the largest L2 normalization value is again used to select which of the 3 pDstMag channel values to output to the pDstMag image. For the C3C1R versions of the function the pDstMag output image value for L2 normalizaton consists of just outputting the largest per source channel L2 normalization value to the pDstMag image. For the C3C1R versions of the function the pDstAngle output image value consists of the same technique used for the C1R version calculated for each source image channel. Then the largest L2 normalization value is again used to select which of the 3 angle values to output to the pDstAngle image.

param eSrcType

source image_data_type.

param eDstType

destination image_data_type.

param eSrcChannels

source image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDstX

X vector destination_image_pointer.

param nDstXStep

X vector destination_image_line_step.

param pDstY

Y vector destination_image_pointer.

param nDstYStep

Y vector destination_image_line_step.

param pDstMag

magnitude destination_image_pointer.

param nDstMagStep

magnitude destination_image_line_step.

param pDstAngle

angle destination_image_pointer.

param nDstAngleStep

angle destination_image_line_step.

param oSizeROI

Region-of-Interest (ROI).

param eMaskSize

fixed filter mask size to use.

param eNorm

gradient distance method to use.

param eBorderType

source image border type to use use.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiGradientVectorPrewittBorder_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcChannels, const void *pSrc, int nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDstX, int nDstXStep, void *pDstY, int nDstYStep, void *pDstMag, int nDstMagStep, Npp32f *pDstAngle, int nDstAngleStep, NppiSize oSizeROI, NppiMaskSize eMaskSize, NppiNorm eNorm, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Packed RGB to 1 channel signed X (vertical), Y (horizontal), magnitude, and/or 32-bit floating point angle gradient vectors with user selectable fixed mask size and distance method with border control.

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

Image Filter Gradient Vector Scharr Border

GradientVectorScharrBorder

RGB Color to Scharr Gradient Vector conversion using user selected fixed mask size and gradient distance method. Functions support up to 4 optional single channel output gradient vectors, X (vertical), Y (horizontal), magnitude, and angle with user selectable distance methods. Output for a particular vector is disabled by supplying a NULL pointer for that vector. X and Y gradient vectors are in cartesian form in the destination data type.

Magnitude vectors are polar gradient form in the destination data type, angle is always in floating point polar gradient format. Only fixed mask sizes of 3x3 are supported. Only nppiNormL1 (sum) and nppiNormL2 (sqrt of sum of squares) distance methods are currently supported.

Currently only the NPP_BORDER_REPLICATE border type operation is supported. Borderless output can be accomplished by using a larger source image than the destination and adjusting oSrcSize and oSrcOffset parameters accordingly.

Common parameters for nppiFilterGradientVectorScharrBorder functions include:

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

The following fixed kernel mask is used for producing the pDstX (vertical) output image.

\[\begin{split} \left( \begin{array}{rrr} 3 & 0 & -3 \\ 10 & 0 & -10 \\ 3 & 0 & -3 \\ \end{array} \right) \end{split}\]

The following fixed kernel mask is used for producing the pDstY (horizontal) output image.

\[\begin{split} \left( \begin{array}{rrr} 3 & 10 & 3 \\ 0 & 0 & 0 \\ -3 & -10 & -3 \\ \end{array} \right) \end{split}\]

For the C1R versions of the function the pDstMag output image value for L1 normalization consists of the absolute value of the pDstX value plus the absolute value of the pDstY value at that particular image pixel location. For the C1R versions of the function the pDstMag output image value for L2 normalization consists of the square root of the pDstX value squared plus the pDstY value squared at that particular image pixel location. For the C1R versions of the function the pDstAngle output image value consists of the arctangent (atan2) of the pDstY value and the pDstX value at that particular image pixel location.

For the C3C1R versions of the function, regardless of the selected normalization method, the L2 normalization value is first determined for each or the pDstX and pDstY values for each source channel then the largest L2 normalization value (largest gradient) is used to select which of the 3 pDstX channel values are output to the pDstX image or pDstY channel values are output to the pDstY image. For the C3C1R versions of the function the pDstMag output image value for L1 normalizaton consists of the same technique used for the C1R version for each source image channel. Then the largest L2 normalization value is again used to select which of the 3 pDstMag channel values to output to the pDstMag image. For the C3C1R versions of the function the pDstMag output image value for L2 normalizaton consists of just outputting the largest per source channel L2 normalization value to the pDstMag image. For the C3C1R versions of the function the pDstAngle output image value consists of the same technique used for the C1R version calculated for each source image channel. Then the largest L2 normalization value is again used to select which of the 3 angle values to output to the pDstAngle image.

param eSrcType

source image_data_type.

param eDstType

destination image_data_type.

param eSrcChannels

source image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDstX

X vector destination_image_pointer.

param nDstXStep

X vector destination_image_line_step.

param pDstY

Y vector destination_image_pointer.

param nDstYStep

Y vector destination_image_line_step.

param pDstMag

magnitude destination_image_pointer.

param nDstMagStep

magnitude destination_image_line_step.

param pDstAngle

angle destination_image_pointer.

param nDstAngleStep

angle destination_image_line_step.

param oSizeROI

Region-of-Interest (ROI).

param eMaskSize

fixed filter mask size to use.

param eNorm

gradient distance method to use.

param eBorderType

source image border type to use use.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiGradientVectorScharrBorder_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcChannels, const void *pSrc, int nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDstX, int nDstXStep, void *pDstY, int nDstYStep, void *pDstMag, int nDstMagStep, Npp32f *pDstAngle, int nDstAngleStep, NppiSize oSizeROI, NppiMaskSize eMaskSize, NppiNorm eNorm, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Packed RGB to 1 channel signed X (vertical), Y (horizontal), magnitude, and/or 32-bit floating point angle gradient vectors with user selectable fixed mask size and distance method with border control.

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

Image Filter Gradient Vector Sobel Border

GradientVectorSobelBorder

RGB Color to Sobel Gradient Vector conversion using user selected fixed mask size and gradient distance method. Functions support up to 4 optional single channel output gradient vectors, X (vertical), Y (horizontal), magnitude, and angle with user selectable distance methods. Output for a particular vector is disabled by supplying a NULL pointer for that vector. X and Y gradient vectors are in cartesian form in the destination data type.

Magnitude vectors are polar gradient form in the destination data type, angle is always in floating point polar gradient format. Only fixed mask sizes of 3x3 and 5x5 are supported. Only nppiNormL1 (sum) and nppiNormL2 (sqrt of sum of squares) distance methods are currently supported.

Currently only the NPP_BORDER_REPLICATE border type operation is supported. Borderless output can be accomplished by using a larger source image than the destination and adjusting oSrcSize and oSrcOffset parameters accordingly.

Common parameters for nppiFilterGradientVectorSobelBorder functions include:

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

One of the following fixed kernel masks are used for producing the 3x3 or 5x5 pDstX (vertical) output image depending on selected mask size.

\[\begin{split} \left( \begin{array}{rrr} -1 & 0 & 1 \\ -2 & 0 & 2 \\ -1 & 0 & 1 \\ \end{array} \right) \end{split}\]

\[\begin{split} \left( \begin{array}{rrrrr} -1 & -2 & 0 & 2 & 1 \\ -4 & -8 & 0 & 8 & 4 \\ -6 & -12 & 0 & 12 & 6 \\ -4 & -8 & 0 & 8 & 4 \\ -1 & -2 & 0 & 2 & 1 \\ \end{array} \right) \end{split}\]

One of the following fixed kernel masks are used for producing the 3x3 or 5x5 pDstY (horizontal) output image depending on selected mask size.

\[\begin{split} \left( \begin{array}{rrr} 1 & 2 & 1 \\ 0 & 0 & 0 \\ -1 & -2 & -1 \\ \end{array} \right) \end{split}\]

\[\begin{split} \left( \begin{array}{rrrrr} 1 & 4 & 6 & 4 & 1 \\ 2 & 8 & 12 & 8 & 2 \\ 0 & 0 & 0 & 0 & 0 \\ -2 & -8 & -12 & -8 & -2 \\ -1 & -4 & -6 & -4 & -1 \\ \end{array} \right) \end{split}\]

For the C1R versions of the function the pDstMag output image value for L1 normalization consists of the absolute value of the pDstX value plus the absolute value of the pDstY value at that particular image pixel location. For the C1R versions of the function the pDstMag output image value for L2 normalization consists of the square root of the pDstX value squared plus the pDstY value squared at that particular image pixel location. For the C1R versions of the function the pDstAngle output image value consists of the arctangent (atan2) of the pDstY value and the pDstX value at that particular image pixel location.

For the C3C1R versions of the function, regardless of the selected normalization method, the L2 normalization value is first determined for each or the pDstX and pDstY values for each source channel then the largest L2 normalization value (largest gradient) is used to select which of the 3 pDstX channel values are output to the pDstX image or pDstY channel values are output to the pDstY image. For the C3C1R versions of the function the pDstMag output image value for L1 normalizaton consists of the same technique used for the C1R version for each source image channel. Then the largest L2 normalization value is again used to select which of the 3 pDstMag channel values to output to the pDstMag image. For the C3C1R versions of the function the pDstMag output image value for L2 normalizaton consists of just outputting the largest per source channel L2 normalization value to the pDstMag image. For the C3C1R versions of the function the pDstAngle output image value consists of the same technique used for the C1R version calculated for each source image channel. Then the largest L2 normalization value is again used to select which of the 3 angle values to output to the pDstAngle image.

param eSrcType

source image_data_type.

param eDstType

destination image_data_type.

param eSrcChannels

source image_channels.

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param pDstX

X vector destination_image_pointer.

param nDstXStep

X vector destination_image_line_step.

param pDstY

Y vector destination_image_pointer.

param nDstYStep

Y vector destination_image_line_step.

param pDstMag

magnitude destination_image_pointer.

param nDstMagStep

magnitude destination_image_line_step.

param pDstAngle

angle destination_image_pointer.

param nDstAngleStep

angle destination_image_line_step.

param oSizeROI

Region-of-Interest (ROI).

param eMaskSize

fixed filter mask size to use.

param eNorm

gradient distance method to use.

param eBorderType

source image border type to use use.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

NppStatus nppiGradientVectorSobelBorder_Ctx(NppDataType eSrcType, NppDataType eDstType, NppiChannels eSrcChannels, const void *pSrc, int nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDstX, int nDstXStep, void *pDstY, int nDstYStep, void *pDstMag, int nDstMagStep, Npp32f *pDstAngle, int nDstAngleStep, NppiSize oSizeROI, NppiMaskSize eMaskSize, NppiNorm eNorm, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Packed RGB to 1 channel signed X (vertical), Y (horizontal), magnitude, and/or 32-bit floating point angle gradient vectors with user selectable fixed mask size and distance method with border control.

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

Image Computer Vision Filtering Functions

Computer Vision

The set of computer vision functions available in the library.

Image Filter Distance Transform

FilterDistanceTransform

Performs Exact Euclidean Distance Transform function using the Parallel Banding Algorithm (PBA+) defined by Tiow-Seng Tan, et al paper named “Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU” published dated August 8, 2019.

Output for these functions is an optional 16-bit signed integer voronoi diagram (pairs of signed 16 bit integer x, y distance values) and/or an optional true euclidean distance transform image generated from the internal voronoi diagram in either unsigned 16-bit truncated integer format or 32-bit floating point format. Additional optional output can include an signed 16-bit integer Voronoi diagram containing site indices and/or a signed 16-bit integer Voronoi diagram containing relative Manhattan distances to the closest sites. Minimum and maximum image ROI widths and heights are 64 and 32767.

Note that an input image that does not contain at least one site pixel is considered to be an invalid image. If you suspect that your input image may be invalid you can call an NPP function like nppiCountInRange() first to confirm that the image is valid before calling the distance transform function.

The nMinSiteValue and nMaxSiteValue parameters can be used to control which source image pixels are considered sites(traditionally 0) and non-sites (everything else).

Antialiased true distance transform, when available, is only available as double precision floating point (Npp64f) output data only and is enabled by setting the pAntialiasingDeviceBuffer pointer parameter to a non-NULL value.

The algorithm used for antialising is derived from the edtaa4 version from “Anti-aliased Euclidean distance transform” by Stefan Gustavson et. al. published in 2009 and is used under the permissions specified below.

Derived from edtaa4.c - compute the Euclidean distance transform of an image, with more accurate handling of 1 pixel wide anti-aliased edges.

This is a MEX-file for MATLAB. MATLAB is a product of The MathWorks, Inc.

Code in “edtaa4func.c” originally by Stefan Gustavson 1994, implemented from a verbal description in the PhD dissertation of Ingemar Ragnemalm, dept of EE, Linkoping University.

Modification to handle antialiased edges and this Matlab MEX wrapper by Stefan Gustavson, (stefan.gustavson@gmail.com) 2009-05-17

Copyright (C) 2009 Stefan Gustavson (stefan.gustavson@gmail.com)

This software is distributed under the permissive “MIT License”:

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Image Filter Harris Corners Border

FilterHarrisCornersBorder

Performs Harris Corner detection on a single channel 8-bit grayscale image and outputs a single channel 32-bit floating point image consisting the corner response at each pixel of the image.

The algorithm consists of two phases. The first phase generates the floating point product of XX, YY, and XY gradients at each pixel in the image. The type of gradient used is controlled by the eFilterType and eMaskSize parameters. The second phase averages those products over a window of either 3x3 or 5x5 pixels around the center pixel then generates the Harris corner response at that pixel which is output in the destination image. The Harris response value is determined as H = ((XX * YY - XY * XY) - (nK * ((XX + YY) * (XX + YY)))) * nScale.

Currently only the NPP_BORDER_REPLICATE border type operation is supported. Borderless output can be accomplished by using a larger source image than the destination and adjusting oSrcSize and oSrcOffset parameters accordingly.

Image Filter Hough Line

FilterHoughLine

Extracts Hough lines from a single channel 8-bit binarized (0, 255) source feature (canny edges, etc.) image.

Outputs a list of lines in point polar format representing the length (rho) and angle (theta) of each line from the origin of the normal to the line using the formula rho = x cos(theta) + y sin(theta). The level of discretization, nDelta, is specified as an input parameter. The performance and effectiveness of this function highly depends on this parameter with higher performance for larger numbers and more detailed results for lower numbers. Also, lines are not guaranteed to be added to the pDeviceLines list in the same order from one call to the next. However, all of the same lines will still be generated as long as nMaxLineCount is set large enough so that they all can fit in the list. To convert lines in point polar format back to cartesian lines use the following formula:

Npp32f nHough = ((sqrt(2.0F) * static_cast<Npp32f>(oSizeROI.height > oSizeROI.width ? oSizeROI.height 
                                                                                    : oSizeROI.width)) / 2.0F); 
int nAccumulatorsHeight = nDelta.rho > 1.0F ? static_cast<int>(ceil(nHough * 2.0F)) 
                                            : static_cast<int>(ceil((nHough * 2.0F) / nDelta.rho));
int nCenterX = oSizeROI.width >> 1;
int nCenterY = oSizeROI.height >> 1;
Npp32f nThetaRad = static_cast<Npp32f>(deviceline.theta) * 0.0174532925199433F;
Npp32f nSinTheta = sin(nThetaRad);
Npp32f nCosTheta = cos(nThetaRad);
int nX1, nY1, nX2, nY2;

if (deviceline.theta >= 45 && deviceline.theta <= 135) // degrees
{
    // y = (rho - x cos(theta)) / sin(theta)
    nX1 = minimum cartesian X boundary value;
    nY1 = static_cast<int>((static_cast<Npp32f>(deviceline.rho - (nAccumulatorsHeight >> 1)) - 
                           ((nX1 - nCenterX) * nCosTheta)) / nSinTheta + nCenterY);
    nX2 = maximum cartesian X boundary value;
    nY2 = static_cast<int>((static_cast<Npp32f>(deviceline.rho - (nAccumulatorsHeight >> 1)) - 
                           ((nX2 - nCenterX) * nCosTheta)) / nSinTheta + nCenterY);
}
else
{
    // x = (rho - y sin(theta)) / cos(theta)
    nY1 = minimum cartesian Y boundary value;
    nX1 = static_cast<int>((static_cast<Npp32f>(deviceline.rho - (nAccumulatorsHeight >> 1)) - 
                           ((nY1 - nCenterY) * nSinTheta)) / nCosTheta + nCenterX);
    nY2 = maximum cartesian Y boundary value;
    nX2 = static_cast<int>((static_cast<Npp32f>(deviceline.rho - (nAccumulatorsHeight >> 1)) - 
                           ((nY2 - nCenterY) * nSinTheta)) / nCosTheta + nCenterX);
}

Image Filter Histogram Of Oriented Gradients Border

HistogramOfOrientedGradientsBorder

Performs Histogram Of Oriented Gradients operation on source image generating separate windows of Histogram Descriptors for each requested location.

This function implements the simplest form of functionality described by N. Dalal and B. Triggs. Histograms of Oriented Gradients for Human Detection. INRIA, 2005. It supports overlapped contrast normalized block histogram output with L2 normalization only, no threshold clipping, and no pre or post gaussian smoothing of input images or histogram output values. It supports both single channel grayscale source images and three channel color images. For color images, the color channel with the highest magnitude value is used as that pixel’s magnitude. Output is row order only. Descriptors are output consecutively with no separation padding if multiple descriptor output is requested (one desriptor per source image location). For example, common HOG parameters are 9 histogram bins per 8 by 8 pixel cell, 2 by 2 cells per block, with a descriptor window size of 64 horizontal by 128 vertical pixels yielding 7 by 15 overlapping blocks (1 cell overlap in both horizontal and vertical directions). This results in 9 bins * 4 cells * 7 horizontal overlapping blocks * 15 vertical overlapping blocks or 3780 32-bit floating point output values (bins) per descriptor window.

The number of horizontal overlapping block histogram bins per descriptor window width is determined by (((oHOGConfig.detectionWindowSize.width / oHOGConfig.histogramBlockSize) * 2) - 1) * oHOGConfig.nHistogramBins. The number of vertical overlapping block histograms per descriptor window height is determined by (((oHOGConfig.detectionWindowSize.height / oHOGConfig.histogramBlockSize) * 2) - 1) The offset of each descriptor window in the descriptors output buffer is therefore horizontal histogram bins per descriptor window width * vertical histograms per descriptor window height 32-bit floating point values relative to the previous descriptor window output.

The algorithm uses a 1D centered derivative mask of [-1, 0, +1] when generating input magnitude and angle gradients. Magnitudes are added to the two nearest histogram bins of oriented gradients between 0 and 180 degrees using a weighted linear interpolation of each magnitude value across the 2 nearest angular bin orientations. 2D overlapping blocks of histogram bins consisting of the bins from 2D arrangements of cells are then contrast normalized using L2 normalization and output to the corresponding histogram descriptor window for that particular window location in the window locations list.

Some restrictions include:

#define NPP_HOG_MAX_CELL_SIZE                          (16)
#define NPP_HOG_MAX_BLOCK_SIZE                         (64)
#define NPP_HOG_MAX_BINS_PER_CELL                      (16)
#define NPP_HOG_MAX_CELLS_PER_DESCRIPTOR              (256)
#define NPP_HOG_MAX_OVERLAPPING_BLOCKS_PER_DESCRIPTOR (256)
#define NPP_HOG_MAX_DESCRIPTOR_LOCATIONS_PER_CALL     (128)

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

Common parameters for nppiFilterHistogramOfGradientsBorder functions include:

param pSrc

Source-Image Pointer.

param nSrcStep

Source-Image Line Step.

param oSrcSize

Source image width and height in pixels relative to pSrc.

param oSrcOffset

The pixel offset that pSrc points to relative to the origin of the source image.

param hpLocations

Host pointer to array of NppiPoint source pixel starting locations of requested descriptor windows. Important: hpLocations is a host pointer.

param nLocations

Number of NppiPoint in pLocations array.

param pDstWindowDescriptorBuffer

Output device memory buffer pointer of size hpDescriptorsSize bytes to first of nLoc descriptor windows (see nppiHistogramOfGradientsBorderGetDescriptorsSize() above).

param oSizeROI

Region-of-Interest (ROI) of source image.

param oHOGConfig

Requested HOG configuration parameters structure.

param pScratchBuffer

Device memory buffer pointer of size hpBufferSize bytes to scratch memory buffer (see nppiHistogramOfGradientsBorderGetBufferSize() above).

param eBorderType

The border type operation to be applied at source image border boundaries.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Image Filter Flood Fill

FloodFill

Flood fill a connected region of an image with a specified new value.

Flood Fill

FloodFill

In place flood fill of a region of pixels connected to the pixel at the seed pixel location in an image with a new pixel value.

Before calling any of the FloodFill functions the application first needs to call the FloodFillGetBufferSize function to determine the amount of device memory to allocate as a working buffer. The allocated device memory is then passed as the pBuffer parameter to the corresponding FloodFill function.

Optionally the function can return connected region information for the filled region in the pConnectedRegion NppiConnectedRegion structure in host memory. The oBoundingBox x and y will be set to the left and top coordinates and width and height will be set to the right bottom coordinates of the bounding box relative to pSrcDst. Set pConnectedRegion to NULL if not required. Requesting pConnectedRegion information may slightly degrade performance.

Flood Fill Boundary

FloodFillBoundary

In place flood fill of a region of pixels connected to the pixel at the seed pixel location in an image with a new pixel value. Also fill boundary of filled region with a specified color.

Before calling any of the FloodFill functions the application first needs to call the FloodFillGetBufferSize function to determine the amount of device memory to allocate as a working buffer. The allocated device memory is then passed as the pBuffer parameter to the corresponding FloodFill function.

Optionally the function can return connected region information for the filled region in the pConnectedRegion NppiConnectedRegion structure in host memory. The oBoundingBox x and y will be set to the left and top coordinates and width and height will be set to the right bottom coordinates of the bounding box relative to pSrcDst. Set pConnectedRegion to NULL if not required. Requesting pConnectedRegion information may slightly degrade performance.

Flood Fill Range

FloodFillRange

In place flood fill of a region of pixels connected to the pixel at the seed pixel location and with a Pixel value >= Min and <= Max in an image with a new pixel value.

Before calling any of the FloodFill functions the application first needs to call the FloodFillGetBufferSize function to determine the amount of device memory to allocate as a working buffer. The allocated device memory is then passed as the pBuffer parameter to the corresponding FloodFill function.

Optionally the function can return connected region information for the filled region in the pConnectedRegion NppiConnectedRegion structure in host memory. The oBoundingBox x and y will be set to the left and top coordinates and width and height will be set to the right bottom coordinates of the bounding box relative to pSrcDst. Set pConnectedRegion to NULL if not required. Requesting pConnectedRegion information may slightly degrade performance.

Flood Fill Range Boundary

FloodFillRangeBoundary

In place flood fill of a region of pixels connected to the pixel at the seed pixel location and with a Pixel value >= Min and <= Max in an image with a new pixel value. Also fill boundary of filled region with a specified color.

Before calling any of the FloodFill functions the application first needs to call the FloodFillGetBufferSize function to determine the amount of device memory to allocate as a working buffer. The allocated device memory is then passed as the pBuffer parameter to the corresponding FloodFill function.

Optionally the function can return connected region information for the filled region in the pConnectedRegion NppiConnectedRegion structure in host memory. The oBoundingBox x and y will be set to the left and top coordinates and width and height will be set to the right bottom coordinates of the bounding box relative to pSrcDst. Set pConnectedRegion to NULL if not required. Requesting pConnectedRegion information may slightly degrade performance.

Flood Fill Gradient

FloodFillGradient

In place flood fill of a region of pixels connected to the pixel at the seed pixel location and with an original pixel value including seed - Min to seed + Max in an image with a new pixel value.

In place flood fill of a region of pixels connected to the pixel at the seed pixel location in an image with a new pixel value.

Before calling any of the FloodFill functions the application first needs to call the FloodFillGetBufferSize function to determine the amount of device memory to allocate as a working buffer. The allocated device memory is then passed as the pBuffer parameter to the corresponding FloodFill function.

Optionally the function can return connected region information for the filled region in the pConnectedRegion NppiConnectedRegion structure in host memory. The oBoundingBox x and y will be set to the left and top coordinates and width and height will be set to the right bottom coordinates of the bounding box relative to pSrcDst. Set pConnectedRegion to NULL if not required. Requesting pConnectedRegion information may slightly degrade performance.

Flood Fill Gradient Boundary

FloodFillGradientBoundary

In place flood fill of a region of pixels connected to the pixel at the seed pixel location and with an original pixel value including seed - Min to seed + Max in an image with a new pixel value. Also fill boundary of filled region with a specified color.

In place flood fill of a region of pixels connected to the pixel at the seed pixel location in an image with a new pixel value.

Before calling any of the FloodFill functions the application first needs to call the FloodFillGetBufferSize function to determine the amount of device memory to allocate as a working buffer. The allocated device memory is then passed as the pBuffer parameter to the corresponding FloodFill function.

Optionally the function can return connected region information for the filled region in the pConnectedRegion NppiConnectedRegion structure in host memory. The oBoundingBox x and y will be set to the left and top coordinates and width and height will be set to the right bottom coordinates of the bounding box relative to pSrcDst. Set pConnectedRegion to NULL if not required. Requesting pConnectedRegion information may slightly degrade performance.

Label Markers

LabelMarkers

Generate image connected region label markers to be used for later image segmentation.

These functions have been deprecated. Use LabelMarkersUF functions instead.

Label MarkersUF

LabelMarkersUF

Generate image connected region label markers to be used for later image segmentation.

A connected region is any pixel region where all pixels in the region have the same pixel value. Note that marker label IDs generally increase in value from image left to right and top to bottom they are not generated in any particular order and there may be numeric gaps between sequential marker IDs. To limit the number of marker IDs generated the application should pass the image through a threshold filter before calling this funcion. Doing so however does not necessarily limit the maximum marker ID value generated by this function. Note that these functions currently only support image ROI sizes up to 4 gigapixels. Also note that while these functions support destination image pitches that are not exactly equal to oSizeROI.width * sizeof(Npp32u) it can avoid a cudaMemCpyAsync() call to copy the final result from the working buffer to the destination image if the pitch exactly equals oSizeROI.width * sizeof(Npp32u).

Before calling any of the LabelMarkersUF functions the application first needs to call the LabelMarkersUFGetBufferSize to determine the amount of device memory to allocate as a working buffer. The allocated device memory is then passed as the pBuffer parameter to the corresponding LabelMarkersUF function.

The algorithm used in this implementation is based on the one described in “An Optimized Union-Find Algorithm for Connected Components Labeling Using GPUs” by Jun Chen and others.

Note that the destination image in these functions must be allocated with cudaMalloc() and NOT cudaMallocPitch(). Also the pitch of the output image MUST be set to oSizeROI.width * sizeof(Npp32u).

Label MarkersUF Batch

LabelMarkersUFBatch

Generate image connected region label markers to be used for later image segmentation for a batched list of images.

A connected region is any pixel region where all pixels in the region have the same pixel value. Note that marker label IDs generally increase in value from image left to right and top to bottom they are not generated in any particular order and there may be numeric gaps between sequential marker IDs. To limit the number of marker IDs generated the application should pass the image through a threshold filter before calling this funcion. Doing so however does not necessarily limit the maximum marker ID value generated by this function. Note that these functions currently only support image ROI sizes up to 4 gigapixels. Also note that these functions work directly in the destination image so destination pitch MUST be equal to destination ROI.width * sizeof(Npp32u) and even if destination pitch is greater than that the output will be in that format. If this doesn’t work for you use the single image version of these functions or cudaMemCopy2D can be called for each output image to restore the original pitch. Note that all source and destination images in the batch list must contain enough device memory to support the full ROI size. ROIs in descriptor lists are ignored in these functions.

The algorithm used in this implementation is based on the one described in “An Optimized Union-Find Algorithm for Connected Components Labeling Using GPUs” by Jun Chen and others.

Note that the destination images in these functions must be allocated with cudaMalloc() and NOT cudaMallocPitch(). Also the pitch of the output image MUST be set to oSizeROI.width * sizeof(Npp32u).

Label MarkersUF Batch Advanced

LabelMarkersUFBatchAdvanced

Generate image connected region label markers to be used for later image segmentation for a batched list of images.

A connected region is any pixel region where all pixels in the region have the same pixel value. Note that marker label IDs generally increase in value from image left to right and top to bottom they are not generated in any particular order and there may be numeric gaps between sequential marker IDs. To limit the number of marker IDs generated the application should pass the image through a threshold filter before calling this funcion. Doing so however does not necessarily limit the maximum marker ID value generated by this function. Note that these functions currently only support image ROI sizes up to 4 gigapixels. Also note that these functions work directly in the destination image so destination pitch MUST be equal to destination ROI.width * sizeof(Npp32u) for each destination image in the list and even if the destination image pitch is greater than that of the output will be in that format. If this doesn’t work for you use the single image version of these functions or cudaMemCopy2D can be called for each output image to restore the original pitch. Note that all source and destination images in the batch list must contain enough device memory to contain their specified ROI size.

The algorithm used in this implementation is based on the one described in “An Optimized Union-Find Algorithm for Connected Components Labeling Using GPUs” by Jun Chen and others.

Note that the destination images in these functions must be allocated with cudaMalloc() and NOT cudaMallocPitch(). Also the pitch of the output image MUST be set to oSizeROI.width * sizeof(Npp32u).

Image Filter Compress Marker Labels

/section image_filter_compress_marker_labels CompressMarkerLabels

Removes sparseness between marker label IDs output from LabelMarkers call.

Image Filter Compress Marker Labels Info

Various methods for extracting information from compressed marker labels.

Image Filter Contour Pixel Interpolation

ContourPixelInterpolation

Various functions for interpolating pixels in image contours.

Bound Segments

Note that these functions have been deprecated.

Use the nppiLabelMarkerUF, nppiCompressMarkerLabelsUF, and nppiCompressedMarkerLabelsUFInfo functions to generate connected pixel region boundaries (contours).

Watershed Segmentation

WatershedSegmentation

Segments a grayscale image using the watershed segmentation technique described in “Efficient 2D and 3D Watershed on Graphics Processing Unit: Block-Asynchronous Approaches Based on Cellular Automata” by Pablo Quesada-Barriuso and others.