NVIDIA 2D Image And Signal Performance Primitives (NPP)  Version 11.3.0.*
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
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. More...

SegmentWatershedGetBufferSize

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

NppStatus  nppiSegmentWatershedGetBufferSize_8u_C1R (NppiSize oSizeROI, int *hpDeviceMemoryBufferSize)
  Calculate scratch buffer sizes needed for 1 channel 8-bit unsigned integer watershed segmentation function based on destination image oSizeROI width and height. More...
 
NppStatus  nppiSegmentWatershedGetBufferSize_16u_C1R (NppiSize oSizeROI, int *hpDeviceMemoryBufferSize)
  Calculate scratch buffer sizes needed for 1 channel 16-bit unsigned integer watershed segmentation function based on destination image oSizeROI width and height. More...
 

SegmentWatershed

Generate an output image containing regions of constant value grayscale defined by watershed segmentation plateau boundaries from a grayscale input image.

Optionally output the corresponding marker labels image.

Before calling any of the SegmentWatershed functions the application first needs to call the corresponding SegmentWatershedGetBufferSize to determine the amount of device memory to allocate as working buffers. The allocatd memory is then passed as the pDeviceMemoryBuffer parameter to the corresponding SegmentWatershed function.

NppStatus  nppiSegmentWatershed_8u_C1IR_Ctx (Npp8u *pSrcDst, Npp32s nSrcDstStep, Npp32u *pMarkerLabels, Npp32s nMarkerLabelsStep, NppiNorm eNorm, NppiWatershedSegmentBoundaryType eSegmentBoundaryType, NppiSize oSizeROI, Npp8u *pDeviceMemoryBuffer, NppStreamContext nppStreamCtx)
  1 channel 8-bit unsigned integer in place image watershed segmentation generation. More...
 
NppStatus  nppiSegmentWatershed_8u_C1IR (Npp8u *pSrcDst, Npp32s nSrcDstStep, Npp32u *pMarkerLabels, Npp32s nMarkerLabelsStep, NppiNorm eNorm, NppiWatershedSegmentBoundaryType eSegmentBoundaryType, NppiSize oSizeROI, Npp8u *pDeviceMemoryBuffer)
 
NppStatus  nppiSegmentWatershed_16u_C1IR_Ctx (Npp16u *pSrcDst, Npp32s nSrcDstStep, Npp32u *pMarkerLabels, Npp32s nMarkerLabelsStep, NppiNorm eNorm, NppiWatershedSegmentBoundaryType eSegmentBoundaryType, NppiSize oSizeROI, Npp8u *pDeviceMemoryBuffer, NppStreamContext nppStreamCtx)
  1 channel 16-bit unsigned integer in place image watershed segmentation generation. More...
 
NppStatus  nppiSegmentWatershed_16u_C1IR (Npp16u *pSrcDst, Npp32s nSrcDstStep, Npp32u *pMarkerLabels, Npp32s nMarkerLabelsStep, NppiNorm eNorm, NppiWatershedSegmentBoundaryType eSegmentBoundaryType, NppiSize oSizeROI, Npp8u *pDeviceMemoryBuffer)
 

Detailed Description

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.

Function Documentation

NppStatus nppiSegmentWatershed_16u_C1IR ( Npp16u pSrcDst,
Npp32s  nSrcDstStep,
Npp32u pMarkerLabels,
Npp32s  nMarkerLabelsStep,
NppiNorm  eNorm,
NppiWatershedSegmentBoundaryType  eSegmentBoundaryType,
NppiSize  oSizeROI,
Npp8u pDeviceMemoryBuffer 
)
NppStatus nppiSegmentWatershed_16u_C1IR_Ctx ( Npp16u pSrcDst,
Npp32s  nSrcDstStep,
Npp32u pMarkerLabels,
Npp32s  nMarkerLabelsStep,
NppiNorm  eNorm,
NppiWatershedSegmentBoundaryType  eSegmentBoundaryType,
NppiSize  oSizeROI,
Npp8u pDeviceMemoryBuffer,
NppStreamContext  nppStreamCtx 
)

1 channel 16-bit unsigned integer in place image watershed segmentation generation.

Parameters
pSrcDst In-Place Image Pointer.
nSrcDstStep Source-Image Line Step.
pMarkerLabels Device memory pointer to optionally output the corresponding marker labels image, set to NULL if no maker labels image output is desired.
nMarkerLabelsStep Maker labels image line step, ignored if pMarkerLabels is NULL.
eNorm Type of pixel connectivity test to use, nppiNormInf will use 8 way connectivity and nppiNormL1 will use 4 way connectivity.
eSegmentBoundaryType Type of segment boundaries, if any, to be added to output image.
oSizeROI Region-of-Interest (ROI) for both segmented image and corresponding marker labels image.
pDeviceMemoryBuffer Pointer to device memory scratch buffer at least as large as value returned by the corresponging SegmentWatershedGetBufferSize call.
nppStreamCtx Application Managed Stream Context.
Returns
Image Data Related Error Codes, ROI Related Error Codes
NppStatus nppiSegmentWatershed_8u_C1IR ( Npp8u pSrcDst,
Npp32s  nSrcDstStep,
Npp32u pMarkerLabels,
Npp32s  nMarkerLabelsStep,
NppiNorm  eNorm,
NppiWatershedSegmentBoundaryType  eSegmentBoundaryType,
NppiSize  oSizeROI,
Npp8u pDeviceMemoryBuffer 
)
NppStatus nppiSegmentWatershed_8u_C1IR_Ctx ( Npp8u pSrcDst,
Npp32s  nSrcDstStep,
Npp32u pMarkerLabels,
Npp32s  nMarkerLabelsStep,
NppiNorm  eNorm,
NppiWatershedSegmentBoundaryType  eSegmentBoundaryType,
NppiSize  oSizeROI,
Npp8u pDeviceMemoryBuffer,
NppStreamContext  nppStreamCtx 
)

1 channel 8-bit unsigned integer in place image watershed segmentation generation.

Parameters
pSrcDst In-Place Image Pointer.
nSrcDstStep Source-Image Line Step.
pMarkerLabels Device memory pointer to optionally output the corresponding marker labels image, set to NULL if no maker labels image output is desired.
nMarkerLabelsStep Maker labels image line step,ignored if pMarkerLabels is NULL.
eNorm Type of pixel connectivity test to use, nppiNormInf will use 8 way connectivity and nppiNormL1 will use 4 way connectivity.
eSegmentBoundaryType Type of segment boundaries, if any, to be added to output image.
oSizeROI Region-of-Interest (ROI) for both segmented image and corresponding marker labels image.
pDeviceMemoryBuffer Pointer to device memory scratch buffer at least as large as value returned by the corresponging SegmentWatershedGetBufferSize call.
nppStreamCtx Application Managed Stream Context.
Returns
Image Data Related Error Codes, ROI Related Error Codes
NppStatus nppiSegmentWatershedGetBufferSize_16u_C1R ( NppiSize  oSizeROI,
int *  hpDeviceMemoryBufferSize 
)

Calculate scratch buffer sizes needed for 1 channel 16-bit unsigned integer watershed segmentation function based on destination image oSizeROI width and height.

Parameters
oSizeROI Region-of-Interest (ROI).
hpDeviceMemoryBufferSize Required device memory buffer size in bytes.
Returns
Image Data Related Error Codes, ROI Related Error Codes
NppStatus nppiSegmentWatershedGetBufferSize_8u_C1R ( NppiSize  oSizeROI,
int *  hpDeviceMemoryBufferSize 
)

Calculate scratch buffer sizes needed for 1 channel 8-bit unsigned integer watershed segmentation function based on destination image oSizeROI width and height.

Parameters
oSizeROI Region-of-Interest (ROI).
hpDeviceMemoryBufferSize Required device memory buffer size in bytes.
Returns
Image Data Related Error Codes, ROI Related Error Codes