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

Removes sparseness between marker label IDs output from LabelMarkers call. More...

CompressMarkerLabelsGetBufferSize

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

NppStatus nppiCompressMarkerLabelsGetBufferSize_32u_C1R (int nStartingNumber, int *hpBufferSize)
 Calculate scratch buffer size needed for 1 channel 32-bit unsigned integer CompressMarkerLabels function based on the number returned in pNumber from a previous nppiLabelMarkers call. More...
 

CompressMarkerLabels

NOTE: The previous versions of these functions have been deprecated.

Only nppiCompressMarkerLabelsUF_32u works with output from nppiLabelMarkersUF functions.

NppStatus nppiCompressMarkerLabelsUF_32u_C1IR_Ctx (Npp32u *pSrcDst, int nSrcDstStep, NppiSize oSizeROI, int nStartingNumber, int *pNewNumber, Npp8u *pBuffer, NppStreamContext nppStreamCtx)
 1 channel 32-bit unsigned integer in place connected region marker label renumbering for output from nppiLabelMarkersUF functions only with numbering sparseness elimination. More...
 
NppStatus nppiCompressMarkerLabelsUF_32u_C1IR (Npp32u *pSrcDst, int nSrcDstStep, NppiSize oSizeROI, int nStartingNumber, int *pNewNumber, Npp8u *pBuffer)
 

CompressMarkerLabelsUFBatch

Renumber connected region marker label IDs from one or more previous calls to nppiLabelMarkersUF_32u_C1R(_Ctx), nppiLabelMarkersUFBatch_32u_C1R(_Ctx), or nppiLabelMarkersUFBatch_32u_C1R_Advanced(_Ctx) calls to eliminate label numbering sparseness.

Note that while marker label IDs still start at ID number 1, the value of pNewNumber returned by this function will represent the minimum number of label IDs to give each connected region in the image a unique label ID.

Before calling any of the CompressMarkerLabelsUFBatch functions the application first needs to call the corresponding CompressMarkerLabelsGetBufferSize to determine the amount of device memory to allocate as a working buffer for each image. If all of the images in the batch have the same ROI values then the total amount of device memory needed is the value returned by CompressMarkerLabelsGetBufferSize and can be allocated as a single chunk of device memory of returned buffer size value * nBatchList or separately per image in the batch. The pointer to each buffer if the images in the batch have variable ROIs is the returned buffer size for each image. This can also be allocated as a single chunk of device memory for all images in the list if desired. In any case, the buffer pointers for each image in the batch list must be set correctly per each image. Once pBufferList is created and initialized then it needs to be copied to device memory and a pointer to that list must be passed to the compression batch function.

Note that these functions are only supported for output from the UF versions of LabelMarkers functions. Also, for each marker labels image in the list the same image pointer value and ROI that were used when creating the marker labels image MUST be used.

Also note that the images in this function must be allocated with cudaMalloc() and NOT cudaMallocPitch(). And the pitch MUST be set to oSize.width * sizeof(Npp32u). And the image pointers and oSize values MUST match those used when the nppiLabelMarkersUF funcions were called.

NppStatus nppiCompressMarkerLabelsUFBatch_32u_C1IR_Ctx (NppiImageDescriptor *pSrcDstBatchList, NppiBufferDescriptor *pBufferList, unsigned int *pNewMaxLabelIDList, int nBatchSize, NppiSize oSizeROI, int nPerImageBufferSize, NppStreamContext nppStreamCtx)
 1 channel 32-bit unsigned integer in place label markers renumbering for output from nppiLabelMarkersUF functions only with numbering sparseness elimination image generation with one per list image ROI. More...
 
NppStatus nppiCompressMarkerLabelsUFBatch_32u_C1IR (NppiImageDescriptor *pSrcDstBatchList, NppiBufferDescriptor *pBufferList, unsigned int *pNewMaxLabelIDList, int nBatchSize, NppiSize oSizeROI, int nPerImageBufferSize)
 
NppStatus nppiCompressMarkerLabelsUFBatch_32u_C1IR_Advanced_Ctx (NppiImageDescriptor *pSrcDstBatchList, NppiBufferDescriptor *pBufferList, unsigned int *pNewMaxLabelIDList, int nBatchSize, NppiSize oMaxSizeROI, int nLargestPerImageBufferSize, NppStreamContext nppStreamCtx)
 1 channel 32-bit unsigned integer in place label markers renumbering for output from nppiLabelMarkersUF functions only with numbering sparseness elimination image generation with per image ROI. More...
 
NppStatus nppiCompressMarkerLabelsUFBatch_32u_C1IR_Advanced (NppiImageDescriptor *pSrcDstBatchList, NppiBufferDescriptor *pBufferList, unsigned int *pNewMaxLabelIDList, int nBatchSize, NppiSize oMaxSizeROI, int nLargestPerImageBufferSize)
 

Detailed Description

Removes sparseness between marker label IDs output from LabelMarkers call.

Function Documentation

NppStatus nppiCompressMarkerLabelsGetBufferSize_32u_C1R ( int  nStartingNumber,
int *  hpBufferSize 
)

Calculate scratch buffer size needed for 1 channel 32-bit unsigned integer CompressMarkerLabels function based on the number returned in pNumber from a previous nppiLabelMarkers call.

Note that this is the only function that supports the nppiCompressMarkerLabelsUF_32u function and that nStartingNumber MUST be ROI width * ROI height when used with that function.

Parameters
nStartingNumberThe value returned from a previous call to the nppiLabelMarkers_32u function or ROI width * ROI height for images generated by the nppiLabelMarkersUF function and those values MUST match the values used those used in that call.
hpBufferSizeRequired buffer size in bytes.
NppStatus nppiCompressMarkerLabelsUF_32u_C1IR ( Npp32u pSrcDst,
int  nSrcDstStep,
NppiSize  oSizeROI,
int  nStartingNumber,
int *  pNewNumber,
Npp8u pBuffer 
)
NppStatus nppiCompressMarkerLabelsUF_32u_C1IR_Ctx ( Npp32u pSrcDst,
int  nSrcDstStep,
NppiSize  oSizeROI,
int  nStartingNumber,
int *  pNewNumber,
Npp8u pBuffer,
NppStreamContext  nppStreamCtx 
)

1 channel 32-bit unsigned integer in place connected region marker label renumbering for output from nppiLabelMarkersUF functions only with numbering sparseness elimination.

Parameters
pSrcDstIn-Place Image Pointer.
nSrcDstStepSource-Image Line Step. NOTE THAT THIS VALUE MUST BE EQUAL TO oSizeROI.width * sizeof(Npp32u).
oSizeROIRegion-of-Interest (ROI).
nStartingNumberMUST be ROI width * ROI height and MUST match ROI values used in the label markers generation function call.
pNewNumberPointer to host memory integer value where the maximum renumbered marker label ID will be returned.
pBufferPointer to device memory scratch buffer at least as large as value returned by the corresponding CompressMarkerLabelsGetBufferSize call.
nppStreamCtxApplication Managed Stream Context.
Returns
Image Data Related Error Codes, ROI Related Error Codes.

Note that the image in this function must be allocated with cudaMalloc() and NOT cudaMallocPitch(). Also the pitch MUST be set to oSizeROI.width * sizeof(Npp32u). And the image pointer and oSizeROI values MUST match those used when nppiLabelMarkersUF was called.

NppStatus nppiCompressMarkerLabelsUFBatch_32u_C1IR ( NppiImageDescriptor pSrcDstBatchList,
NppiBufferDescriptor pBufferList,
unsigned int *  pNewMaxLabelIDList,
int  nBatchSize,
NppiSize  oSizeROI,
int  nPerImageBufferSize 
)
NppStatus nppiCompressMarkerLabelsUFBatch_32u_C1IR_Advanced ( NppiImageDescriptor pSrcDstBatchList,
NppiBufferDescriptor pBufferList,
unsigned int *  pNewMaxLabelIDList,
int  nBatchSize,
NppiSize  oMaxSizeROI,
int  nLargestPerImageBufferSize 
)
NppStatus nppiCompressMarkerLabelsUFBatch_32u_C1IR_Advanced_Ctx ( NppiImageDescriptor pSrcDstBatchList,
NppiBufferDescriptor pBufferList,
unsigned int *  pNewMaxLabelIDList,
int  nBatchSize,
NppiSize  oMaxSizeROI,
int  nLargestPerImageBufferSize,
NppStreamContext  nppStreamCtx 
)

1 channel 32-bit unsigned integer in place label markers renumbering for output from nppiLabelMarkersUF functions only with numbering sparseness elimination image generation with per image ROI.

Parameters
pSrcDstBatchListSource-Batch-Images Pointer device memory pointer to the list of device memory image descriptors, per image oSize ROI is used.
pBufferListDevice memory pointer to the list of NppiBufferDescriptor buffer descriptors specifying per image device memory buffer pointers and sizes as returned by per image CompressMarkerLabelsGetBufferSize calls.
pNewMaxLabelIDListDevice memory pointer at least nBatchSize * sizeof(Npp32u) bytes which will contain the returned per image new maximum label ID.
nBatchSizeNumber of NppiImageDescriptor, NppiBufferDescriptor, and new max number structures/values processed in this call (must be > 1).
oMaxSizeROIRegion-of-Interest (ROI) maximum ROI width and height of ALL images in the batch, MUST match the ROI used when the label markers UF image was generated.
nLargestPerImageBufferSizeThe value of the the largest per image buffer size value returned by the per image calls to CompressMarkerLabelsGetBufferSize for the images in the batch list.
nppStreamCtxApplication Managed Stream Context.
Returns
Image Data Related Error Codes, ROI Related Error Codes
NppStatus nppiCompressMarkerLabelsUFBatch_32u_C1IR_Ctx ( NppiImageDescriptor pSrcDstBatchList,
NppiBufferDescriptor pBufferList,
unsigned int *  pNewMaxLabelIDList,
int  nBatchSize,
NppiSize  oSizeROI,
int  nPerImageBufferSize,
NppStreamContext  nppStreamCtx 
)

1 channel 32-bit unsigned integer in place label markers renumbering for output from nppiLabelMarkersUF functions only with numbering sparseness elimination image generation with one per list image ROI.

Parameters
pSrcDstBatchListSource-Batch-Images Pointer device memory pointer to the list of device memory image descriptors, per image oSize is ignored.
pBufferListDevice memory pointer to the list of NppiBufferDescriptor buffer descriptors specifying per image device memory buffer pointers and size as returned by at least one CompressMarkerLabelsGetBufferSize call.
pNewMaxLabelIDListDevice memory pointer at least nBatchSize * sizeof(Npp32u) bytes which will contain the returned per image new maximum label ID.
nBatchSizeNumber of NppiImageDescriptor, NppiBufferDescriptor, and new max number structures/values processed in this call (must be > 1).
oSizeROIRegion-of-Interest (ROI) ROI width and height of ALL images in the batch, MUST match the ROI used when the label markers UF image was generated.
nPerImageBufferSizeThe value of the buffer size value returned by the call to CompressMarkerLabelsGetBufferSize for one image in the batch list.
nppStreamCtxApplication Managed Stream Context.
Returns
Image Data Related Error Codes, ROI Related Error Codes

Copyright © 2009-2022 NVIDIA CORPORATION AND AFFILIATES