Image Morphological Operations Functions

Morphological image operations.

Morphological operations are classified as Neighborhood Operations.

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

Dilation Functions

Image Dilate

Dilation

Dilation computes the output pixel as the maximum pixel value of the pixels under the mask. Pixels who’s corresponding mask values are zero do not participate in the maximum search.

It is the user’s responsibility to avoid Sampling Beyond Image Boundaries.

Common parameters for nppiDilate functions include:

Supported data types include NPP_8U, NPP_16U, 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 Data 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 pMask

Pointer to the start address of the mask array

param oMaskSize

Width and Height mask array.

param oAnchor

X and Y offsets of the mask origin frame of reference w.r.t the source pixel.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

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

Image dilation.

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

Image Dilate Border

Dilation with border control

Dilation computes the output pixel as the maximum pixel value of the pixels under the mask. Pixels who’s corresponding mask values are zero do not participate in the maximum search. For gray scale dilation the mask contains signed mask values which are added to the corresponding source image sample value before determining the maximun value after clamping.

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 nppiDilateBorder functions include:

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

Source image starting point relative to pSrc.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-Of-Interest (ROI).

param pMask

Pointer to the start address of the mask array

param oMaskSize

Width and Height mask array.

param oAnchor

X and Y offsets of the mask origin frame of reference w.r.t 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 nppiDilateBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, const Npp8u *pMask, NppiSize oMaskSize, NppiPoint oAnchor, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image dilation with border control.

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

NppStatus nppiGrayDilateBorder_8u_C1R_Ctx(const Npp8u *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, Npp8u *pDst, Npp32s nDstStep, NppiSize oSizeROI, const Npp32s *pMask, NppiSize oMaskSize, NppiPoint oAnchor, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image gray scale dilation with border control.

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

NppStatus nppiGrayDilateBorder_32f_C1R_Ctx(const Npp32f *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, Npp32f *pDst, Npp32s nDstStep, NppiSize oSizeROI, const Npp32f *pMask, NppiSize oMaskSize, NppiPoint oAnchor, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Single-channel 32-bit floating point gray scale dilation with border control.

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

Image Dilate 3x3

Dilate3x3

Dilation using a 3x3 mask with the anchor at its center pixel.

It is the user’s responsibility to avoid Sampling Beyond Image Boundaries.

Common parameters for nppiDilate3x3 functions include:

Supported data types include NPP_8U, NPP_16U, 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 Data 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 nppiDilate3x3_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppStreamContext nppStreamCtx)

Image 3x3 dilation.

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

Image Dilate 3x3 Border

Dilate3x3Border

Dilation using a 3x3 mask with the anchor at its center pixel 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 nppiDilate3x3Border functions include:

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

Source image starting point relative to pSrc.

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 nppiDilate3x3Border_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 3x3 dilation with border control.

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

Erosion Functions

Image Erode

Erode

Erosion computes the output pixel as the minimum pixel value of the pixels under the mask. Pixels who’s corresponding mask values are zero do not participate in the maximum search.

It is the user’s responsibility to avoid Sampling Beyond Image Boundaries.

Common parameters for nppiErode functions include:

Supported data types include NPP_8U, NPP_16U, 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 Data 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 pMask

Pointer to the start address of the mask array

param oMaskSize

Width and Height mask array.

param oAnchor

X and Y offsets of the mask origin frame of reference w.r.t the source pixel.

param nppStreamCtx

Application Managed Stream Context.

return

Image Data Related Error Codes, ROI Related Error Codes

Functions

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

Image erosion.

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

Image Erode Border

Erosion with border control

Erosion computes the output pixel as the minimum pixel value of the pixels under the mask. Pixels who’s corresponding mask values are zero do not participate in the minimum search. For gray scale erosion the mask contains signed mask values which are added to the corresponding source image sample value before determining the minimum value after clamping.

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 nppiErodeBorder functions include:

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

Source image starting point relative to pSrc.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-Of-Interest (ROI).

param pMask

Pointer to the start address of the mask array

param oMaskSize

Width and Height mask array.

param oAnchor

X and Y offsets of the mask origin frame of reference w.r.t 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 nppiErodeBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, const Npp8u *pMask, NppiSize oMaskSize, NppiPoint oAnchor, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image erosion with border control.

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

NppStatus nppiGrayErodeBorder_8u_C1R_Ctx(const Npp8u *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, Npp8u *pDst, Npp32s nDstStep, NppiSize oSizeROI, const Npp32s *pMask, NppiSize oMaskSize, NppiPoint oAnchor, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Single-channel 8-bit unsigned integer gray scale erosion with border control.

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

NppStatus nppiGrayErodeBorder_32f_C1R_Ctx(const Npp32f *pSrc, Npp32s nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, Npp32f *pDst, Npp32s nDstStep, NppiSize oSizeROI, const Npp32f *pMask, NppiSize oMaskSize, NppiPoint oAnchor, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Single-channel 32-bit floating point gray scale erosion with border control.

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

Image Erode 3x3

Erode3x3

Erosion using a 3x3 mask with the anchor at its center pixel.

It is the user’s responsibility to avoid Sampling Beyond Image Boundaries.

Common parameters for nppiErode3x3 functions include:

Supported data types include NPP_8U, NPP_16U, 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 Data 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 nppiErode3x3_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, Npp32s nSrcStep, void *pDst, Npp32s nDstStep, NppiSize oSizeROI, NppStreamContext nppStreamCtx)

Image 3x3 erosion.

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

Image Erode 3x3 Border

Erode3x3Border

Erosion using a 3x3 mask with the anchor at its center pixel 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 nppiErode3x3Border functions include:

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

Source image starting point relative to pSrc.

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 nppiErode3x3Border_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 3x3 erosion with border control.

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

Image Complex Morphphological Operations

Image Morph

ComplexImageMorphology

Complex image morphological operations.

Image Morph Get Buffer Size

MorphGetBufferSize

Before calling any of the MorphCloseBorder, MorphOpenBorder, MorphTopHatBorder, MorphBlackHatBorder, or MorphGradientBorder functions the application first needs to call the corresponding MorphGetBufferSize to determine the amount of device memory to allocate as a working buffer. The application allocated device memory is then passed as the pBuffer parameter to the corresponding MorphXXXBorder function.

Common parameters for nppiMorphGetBufferSize 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 Data Channels.

param oSizeROI

Region-Of-Interest (ROI).

param hpBufferSize

Required buffer size in bytes.

Functions

NppStatus nppiMorphGetBufferSize(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, NppiSize oSizeROI, int *hpBufferSize)

Image morph get buffer size.

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

Image Morph Close Border

MorphCloseBorder

Dilation followed by Erosion with border control.

Morphological close computes the output pixel as the maximum pixel value of the pixels under the mask followed by a second pass using the result of the first pass as input which outputs the minimum pixel value of the pixels under the same mask. Pixels who’s corresponding mask values are zero do not participate in the maximum or minimum search.

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. The mask is centered over the source image pixel being tested.

Before calling any of the MorphCloseBorder functions the application first needs to call the corresponding MorphGetBufferSize 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 MorphCloseBorder function.

Use the oSrcOffset and oSrcSize parameters to control where the border control operation is applied to the source image ROI borders.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

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

Source image starting point relative to pSrc.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-Of-Interest (ROI).

param pMask

Pointer to the start address of the mask array

param oMaskSize

Width and Height mask array.

param oAnchor

X and Y offsets of the mask origin frame of reference w.r.t the source pixel.

param pBuffer

Pointer to device memory scratch buffer at least as large as value returned by the corresponding MorphGetBufferSize call.

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 nppiMorphCloseBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, int nDstStep, NppiSize oSizeROI, const Npp8u *pMask, NppiSize oMaskSize, NppiPoint oAnchor, Npp8u *pBuffer, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image morphological close with border control.

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

Image Morph Open Border

MorphOpenBorder

Erosion followed by Dilation with border control.

Morphological open computes the output pixel as the minimum pixel value of the pixels under the mask followed by a second pass using the result of the first pass as input which outputs the maximum pixel value of the pixels under the same mask. Pixels who’s corresponding mask values are zero do not participate in the minimum or maximum search.

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. The mask is centered over the source image pixel being tested.

Before calling any of the MorphOpenBorder functions the application first needs to call the corresponding MorphGetBufferSize 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 MorphOpenBorder function.

Use the oSrcOffset and oSrcSize parameters to control where the border control operation is applied to the source image ROI borders.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

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

Source image starting point relative to pSrc.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-Of-Interest (ROI).

param pMask

Pointer to the start address of the mask array

param oMaskSize

Width and Height mask array.

param oAnchor

X and Y offsets of the mask origin frame of reference w.r.t the source pixel.

param pBuffer

Pointer to device memory scratch buffer at least as large as value returned by the corresponding MorphGetBufferSize call.

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 nppiMorphOpenBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, int nDstStep, NppiSize oSizeROI, const Npp8u *pMask, NppiSize oMaskSize, NppiPoint oAnchor, Npp8u *pBuffer, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image morphological open with border control.

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

Image Morph Top Hat Border

MorphToHatBorder

Source pixel minus the morphological open pixel result with border control.

Morphological top hat computes the output pixel as the source pixel minus the morphological open result of the pixels under the mask. Pixels who’s corresponding mask values are zero do not participate in the maximum or minimum search.

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. The mask is centered over the source image pixel being tested.

Before calling any of the MorphTopHatBorder functions the application first needs to call the corresponding MorphGetBufferSize 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 MorphTopHatBorder function.

Use the oSrcOffset and oSrcSize parameters to control where the border control operation is applied to the source image ROI borders.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

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

Source image starting point relative to pSrc.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-Of-Interest (ROI).

param pMask

Pointer to the start address of the mask array

param oMaskSize

Width and Height mask array.

param oAnchor

X and Y offsets of the mask origin frame of reference w.r.t the source pixel.

param pBuffer

Pointer to device memory scratch buffer at least as large as value returned by the corresponding MorphGetBufferSize call.

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 nppiMorphTopHatBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, int nDstStep, NppiSize oSizeROI, const Npp8u *pMask, NppiSize oMaskSize, NppiPoint oAnchor, Npp8u *pBuffer, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image morphological top hat with border control.

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

Image Morph Black Hat Border

MorphBlackHatBorder

Morphological close pixel result minus source pixel with border control.

Morphological black hat computes the output pixel as the morphological close pixel value of the pixels under the mask minus the source pixel value. Pixels who’s corresponding mask values are zero do not participate in the maximum or minimum search.

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. The mask is centered over the source image pixel being tested.

Before calling any of the MorphBlackHatBorder functions the application first needs to call the corresponding MorphGetBufferSize 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 MorphBlackHatBorder function.

Use the oSrcOffset and oSrcSize parameters to control where the border control operation is applied to the source image ROI borders.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

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

Source image starting point relative to pSrc.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-Of-Interest (ROI).

param pMask

Pointer to the start address of the mask array

param oMaskSize

Width and Height mask array.

param oAnchor

X and Y offsets of the mask origin frame of reference w.r.t the source pixel.

param pBuffer

Pointer to device memory scratch buffer at least as large as value returned by the corresponding MorphGetBufferSize call.

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 nppiMorphBlackHatBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, int nDstStep, NppiSize oSizeROI, const Npp8u *pMask, NppiSize oMaskSize, NppiPoint oAnchor, Npp8u *pBuffer, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image morphological black hat with border control.

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

Image Morph Gradient Border

MorphGradientBorder

Morphological dilated pixel result minus morphological eroded pixel result with border control.

Morphological gradient computes the output pixel as the morphological dilated pixel value of the pixels under the mask minus the morphological eroded pixel value of the pixels under the mask. Pixels who’s corresponding mask values are zero do not participate in the maximum or minimum search.

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. The mask is centered over the source image pixel being tested.

Before calling any of the MorphGradientBorder functions the application first needs to call the corresponding MorphGetBufferSize 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 MorphGradientBorder function.

Use the oSrcOffset and oSrcSize parameters to control where the border control operation is applied to the source image ROI borders.

Currently only the NPP_BORDER_REPLICATE border type operation is supported.

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

Source image starting point relative to pSrc.

param pDst

Destination-Image Pointer.

param nDstStep

Destination-Image Line Step.

param oSizeROI

Region-Of-Interest (ROI).

param pMask

Pointer to the start address of the mask array

param oMaskSize

Width and Height mask array.

param oAnchor

X and Y offsets of the mask origin frame of reference w.r.t the source pixel.

param pBuffer

Pointer to device memory scratch buffer at least as large as value returned by the corresponding MorphGetBufferSize call.

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 nppiMorphGradientBorder_Ctx(NppDataType eSrcDstType, NppiChannels eSrcDstChannels, const void *pSrc, int nSrcStep, NppiSize oSrcSize, NppiPoint oSrcOffset, void *pDst, int nDstStep, NppiSize oSizeROI, const Npp8u *pMask, NppiSize oMaskSize, NppiPoint oAnchor, Npp8u *pBuffer, NppiBorderType eBorderType, NppStreamContext nppStreamCtx)

Image morphological gradient with border control.

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