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

Various methods for extracting information from compressed marker labels. More...

CompressedMarkerLabelsUFInfo

Generate marker labels info from input image previously generated by call to CompressMarkerLabelsUF or CompressMarkerLabelsUFBatch function with optional output image containing boundaries (contours) around each uniquely labeled connected pixel region.

Before calling any of the CompressedMarkerLabelsUFInfo function the application first needs to call the corresponding CompressedMarkerLabelsGetInfoListSize to determine the amount of device memory to allocate to receive an array of nMaxMarkerLabelID NppiCompressedMarkerLabelsInfo structures.

Note that these functions are only supported for output from the UF versions of LabelMarkers functions. Also the pointer to the beginning of the compressed marker labels image and ROI that was used when generating the compressed marker labels image MUST be used.

Also note that the input image in this function must have been allocated with cudaMalloc() and NOT cudaMallocPitch(). And the pitch MUST be set to oSize.width * sizeof(Npp32u).

NppStatus nppiCompressedMarkerLabelsUFGetInfoListSize_32u_C1R (unsigned int nMaxMarkerLabelID, unsigned int *hpBufferSize)
 Calculate the size of device memory needed for the CompressedMarkerLabelsGetInfoList function based on nMaxMarkerLabelID value returned by previous call to CompressMarkerLabelsUF function. More...
 
NppStatus nppiCompressedMarkerLabelsUFInfo_32u_C1R_Ctx (Npp32u *pCompressedMarkerLabels, Npp32s nCompressedMarkerLabelsStep, NppiSize oSizeROI, unsigned int nMaxMarkerLabelID, NppiCompressedMarkerLabelsInfo *pMarkerLabelsInfoList, Npp8u *pContoursImage, Npp32s nContoursImageStep, NppiContourPixelDirectionInfo *pContoursDirectionImage, Npp32s nContoursDirectionImageStep, NppiContourTotalsInfo *pContoursTotalsInfoHost, Npp32u *pContoursPixelCountsListDev, Npp32u *pContoursPixelCountsListHost, Npp32u *pContoursPixelStartingOffsetHost, NppStreamContext nppStreamCtx)
 1 channel 32-bit unsigned integer connected region marker label renumbered from a previous call to nppiCompressMarkerLabelsUF or nppiCmpressMarkerLabelsUFBatch functions to eliminate label ID sparseness. More...
 

CompressedMarkerLabelsUFContourGeometryLists

Generate pixel geometry lists for connected region contours output by nppiCompressedMarkerLabelsUFInfo function in device memory.

Before calling any of the nppiCompressedMarkerLabelsUFContoursGenerateGeometryLists function the application first needs to call the corresponding CompressedMarkerLabelsUFGetGeometryListsSize to determine the amount of host memory to allocate to receive the contour geometry lists for nMaxMarkerLabelID contours in the image.

Note that these functions are only supported for output from the UF versions of LabelMarkers functions. Also the pointer to the beginning of the compressed marker labels image and ROI that was used when generating the compressed marker labels image MUST be used.

Also note that the input images and output list memory for this function must have been allocated in either device (Dev) or host (Host) memory respectively depending on the parameter name.

NppStatus nppiCompressedMarkerLabelsUFGetGeometryListsSize_C1R (unsigned int nMaxContourPixelGeometryInfoCount, unsigned int *hpBufferSize)
 Calculate the size of device memory needed for the CompressedMarkerLabelsUFContourGeometryLists function based on the final value in the pContoursPixelStartingOffsetHost list returned by previous call nppiCompressedMarkerLabelsUFInfo function. More...
 
NppStatus nppiCompressedMarkerLabelsUFContoursGenerateGeometryLists_C1R_Ctx (NppiCompressedMarkerLabelsInfo *pMarkerLabelsInfoListDev, NppiCompressedMarkerLabelsInfo *pMarkerLabelsInfoListHost, NppiContourPixelDirectionInfo *pContoursDirectionImageDev, Npp32s nContoursDirectionImageStep, NppiContourPixelGeometryInfo *pContoursPixelGeometryListsHost, Npp32u *pContoursPixelCountsListHost, Npp32u *pContoursPixelsFoundListHost, Npp32u *pContoursPixelsStartingOffsetHost, Npp32u nMaxMarkerLabelID, Npp32u nFirstContourGeometryListID, Npp32u nLastContourGeometryListID, NppiSize oSizeROI, NppStreamContext nppStreamCtx)
 1 channel connected region contours image to generate contours geometry info list in host memory. More...
 
NppStatus nppiCompressedMarkerLabelsUFContoursOutputGeometryLists_C1R (NppiContourPixelGeometryInfo *pContoursPixelGeometryListsHost, NppiCompressedMarkerLabelsInfo *pMarkerLabelsInfoListHost, Npp8u *pContoursGeometryImageHost, Npp32s nContoursGeometryImageStep, Npp32u *pContoursPixelCountsListHost, Npp32u *pContoursPixelsFoundListHost, Npp32u *pContoursPixelsStartingOffsetHost, Npp32u nMaxMarkerLabelID, Npp32u nFirstContourGeometryListID, Npp32u nLastContourGeometryListID, Npp32u bOutputInCounterclockwiseOrder, NppiSize oSizeROI)
 1 channel connected region contours image to output contours geometry list in host memory. More...
 

Detailed Description

Various methods for extracting information from compressed marker labels.

Function Documentation

NppStatus nppiCompressedMarkerLabelsUFContoursGenerateGeometryLists_C1R_Ctx ( NppiCompressedMarkerLabelsInfo pMarkerLabelsInfoListDev,
NppiCompressedMarkerLabelsInfo pMarkerLabelsInfoListHost,
NppiContourPixelDirectionInfo pContoursDirectionImageDev,
Npp32s  nContoursDirectionImageStep,
NppiContourPixelGeometryInfo pContoursPixelGeometryListsHost,
Npp32u pContoursPixelCountsListHost,
Npp32u pContoursPixelsFoundListHost,
Npp32u pContoursPixelsStartingOffsetHost,
Npp32u  nMaxMarkerLabelID,
Npp32u  nFirstContourGeometryListID,
Npp32u  nLastContourGeometryListID,
NppiSize  oSizeROI,
NppStreamContext  nppStreamCtx 
)

1 channel connected region contours image to generate contours geometry info list in host memory.

Note that ALL input and output data for the function MUST be in device memory except where noted otherwise. Also nFirstContourID and nLastContourID allow only a portion of the contour geometry lists in the image to be output.

Note that the geometry list for each contour will begin at pContoursGeometryListsHost[pContoursPixelStartingOffsetHost[nContourID] * sizeof(NppiContourPixelGeometryInfo).

Note that due to the nature of some imput images contour ID 0 can sometimes contain ALL contours in the image which can significantly increase the time taken to output the geometry lists. In these cases setting nFirstContourGeometryListID to >= 1 significantly speed up geometry list output performance and all individual contours will still be output.

Parameters
pMarkerLabelsInfoListDevpointer to device memory buffer which contains the output returned by the corresponding nppiCompressedMarkerLabelsUFInfo_32u_C1R_Ctx call.
pMarkerLabelsInfoListHostpointer to host memory buffer which will be output by this function with additional information added.
pContoursDirectionImageDevSource-Image Pointer to output image in device memory containing per contour pixel direction info around each uniquely labeled connected pixel region returned by corresponding nppiCompressedMarkerLabelsUFInfo call.
nContoursDirectionImageStepimage_line_step for contours image.
pContoursPixelGeometryListsHostpointer to host memory buffer allocated to be at least as big as size returned by corresponding nppiCompressedMarkerLabelsUFGetGeometryListsSize call.
pContoursPixelCountsListHosthost memory pointer to array of nMaxMarkerLabelID unsigned integers returned by previous call to nppiCompressedMarkerLabelsUFContoursPixelGeometryLists_C1R_Ctx.
pContoursPixelsFoundListHosthost memory pointer to array of nMaxMarkerLabelID unsigned integers returned by this call representing the number of contour pixels found during geometry list generation.
pContoursPixelsStartingOffsetHosthost memory pointer to array of unsigned integers returned by this call representing the starting offset index of each contour found during geometry list generation.
nMaxMarkerLabelIDthe value of the maximum marker label ID returned by corresponding compress marker labels UF call.
nFirstContourGeometryListIDthe ID of the first contour geometry list to output.
nLastContourGeometryListIDthe ID of the last contour geometry list to output.
oSizeROIRegion-of-Interest (ROI) for the images, must be the same as used in previous calls.
Returns
Image Data Related Error Codes, ROI Related Error Codes.
NppStatus nppiCompressedMarkerLabelsUFContoursOutputGeometryLists_C1R ( NppiContourPixelGeometryInfo pContoursPixelGeometryListsHost,
NppiCompressedMarkerLabelsInfo pMarkerLabelsInfoListHost,
Npp8u pContoursGeometryImageHost,
Npp32s  nContoursGeometryImageStep,
Npp32u pContoursPixelCountsListHost,
Npp32u pContoursPixelsFoundListHost,
Npp32u pContoursPixelsStartingOffsetHost,
Npp32u  nMaxMarkerLabelID,
Npp32u  nFirstContourGeometryListID,
Npp32u  nLastContourGeometryListID,
Npp32u  bOutputInCounterclockwiseOrder,
NppiSize  oSizeROI 
)

1 channel connected region contours image to output contours geometry list in host memory.

Note that ALL input and output data for the function MUST be in host memory. Also nFirstContourID and nLastContourID allow only a portion of the contour geometry lists in the image to be output.

Note that the geometry list for each contour will begin at pContoursGeometryListsHost[pContoursPixelStartingOffsetHost[nContourID] * sizeof(NppiContourPixelGeometryInfo).

Also note that the ordered contour geometry list is contained in the oContourOrderedGeometryLocation object within the NppiContourPixelGeometryInfo object for each contour pixel and that this location information is the only valid information in the object relevent to that ordered pixel.

Note that for a particular contour geometry pixel list the bounding box for that contour will be contained in the following elements of first pixel (pixel 0) of the corresponding contour pixel list.

* pixel[0].oContourPrevPixelLocation.x will contain pCurMarkerLabelsInfo->oMarkerLabelBoundingBox.x upper left x
* pixel[0].oContourPrevPixelLocation.y will contain pCurMarkerLabelsInfo->oMarkerLabelBoundingBox.y upper left y
* pixel[0].oContourNextPixelLocation.x will contain pCurMarkerLabelsInfo->oMarkerLabelBoundingBox.width lower right x
* pixel[0].oContourNextPixelLocation.y will contain pCurMarkerLabelsInfo->oMarkerLabelBoundingBox.height lower right y
*

Note that while the bounding box is relatively accurate occasionally a few contour pixels may extend beyond the bounding box limits.

Due to the nature of some imput images contour ID 0 can sometimes contain ALL contours in the image which can significantly increase the time taken to output the geometry lists. In these cases setting nFirstContourGeometryListID to >= 1 significantly speed up geometry list output performance and all individual contours will still be output.

Once nppiCompressedMarkerLabelsUFContoursGenerateGeometryLists_C1R_Ctx() has been called with a particular range of contour IDs nppiCompressedMarkerLabelsUFContoursOutputGeometryLists_C1R() can be recalled any number of times with any range of contour IDs that were included in the preceeding corresponding nppiCompressedMarkerLabelsUFContoursGenerateGeometryLists_C1R_Ctx() call.

In general a few contour pixels can escape insertion into the ordered geometry list. When geometry output is in clockwise order the extra pixels will be at the end of the geometry list otherwise they will be at the start of the list.

Parameters
pContoursGeometryListsHostpointer to host memory buffer allocated to be at least as big as size returned by corresponding nppiCompressedMarkerLabelsUFGetGeometryListsSize call.
pMarkerLabelsInfoListHostpointer to host memory buffer containing pMarkerLabelsInfoListHost output from nppiCompressedMarkerLabelsUFContoursGenerateGeometryLists_C1R_Ctx.
pContoursGeometryImageHostoptional pointer to host memory image of at least oSizeROI.width * sizeof(Npp8u) * oSizeROI.height bytes, NULL if not needed.
nContoursGeometryImageStepgeometry image line step.
pContoursPixelCountsListHosthost memory pointer to array of nMaxMarkerLabelID unsigned integers returned by previous call to nppiCompressedMarkerLabelsUFContoursPixelGeometryLists_C1R_Ctx
pContoursPixelFoundListHosthost memory pointer to array of nMaxMarkerLabelID unsigned integers returned by this call representing the number of contour pixels found during geometry list generation
pContoursPixelsStartingOffsetHosthost memory pointer to array of unsigned integers returned by this call representing the starting offset index of each contour found during geometry list generation
nMaxMarkerLabelIDthe value of the maximum marker label ID returned by corresponding compress marker labels UF call.
nFirstContourGeometryListIDthe ID of the first contour geometry list to output.
nLastContourGeometryListIDthe ID of the last contour geometry list to output.
bOutputInCounterclockwiseOrderif nonzero then output geometry list for each contour in counterclockwise order, otherwise clockwise.
oSizeROIRegion-of-Interest (ROI) for the images, must be the same as used in previous calls.
Returns
Image Data Related Error Codes, ROI Related Error Codes.
NppStatus nppiCompressedMarkerLabelsUFGetGeometryListsSize_C1R ( unsigned int  nMaxContourPixelGeometryInfoCount,
unsigned int *  hpBufferSize 
)

Calculate the size of device memory needed for the CompressedMarkerLabelsUFContourGeometryLists function based on the final value in the pContoursPixelStartingOffsetHost list returned by previous call nppiCompressedMarkerLabelsUFInfo function.

Parameters
nMaxContourPixelGeometryInfoCountthe final value in the pContoursPixelStartingOffsetHost list.
hpBufferSizeRequired buffer size. Important: hpBufferSize is a host pointer. Scratch Buffer and Host Pointer.
Returns
Image Data Related Error Codes, ROI Related Error Codes
NppStatus nppiCompressedMarkerLabelsUFGetInfoListSize_32u_C1R ( unsigned int  nMaxMarkerLabelID,
unsigned int *  hpBufferSize 
)

Calculate the size of device memory needed for the CompressedMarkerLabelsGetInfoList function based on nMaxMarkerLabelID value returned by previous call to CompressMarkerLabelsUF function.

Parameters
nMaxMarkerLabelIDvalue returned by previous call to CompressMarkerLabelsUF for this image.
hpBufferSizeRequired buffer size. Important: hpBufferSize is a host pointer. Scratch Buffer and Host Pointer.
Returns
Image Data Related Error Codes, ROI Related Error Codes
NppStatus nppiCompressedMarkerLabelsUFInfo_32u_C1R_Ctx ( Npp32u pCompressedMarkerLabels,
Npp32s  nCompressedMarkerLabelsStep,
NppiSize  oSizeROI,
unsigned int  nMaxMarkerLabelID,
NppiCompressedMarkerLabelsInfo pMarkerLabelsInfoList,
Npp8u pContoursImage,
Npp32s  nContoursImageStep,
NppiContourPixelDirectionInfo pContoursDirectionImage,
Npp32s  nContoursDirectionImageStep,
NppiContourTotalsInfo pContoursTotalsInfoHost,
Npp32u pContoursPixelCountsListDev,
Npp32u pContoursPixelCountsListHost,
Npp32u pContoursPixelStartingOffsetHost,
NppStreamContext  nppStreamCtx 
)

1 channel 32-bit unsigned integer connected region marker label renumbered from a previous call to nppiCompressMarkerLabelsUF or nppiCmpressMarkerLabelsUFBatch functions to eliminate label ID sparseness.

Parameters
pCompressedMarkerLabelsSource-Image Pointer for compressed marker labels UF image.
nCompressedMarkerLabelsStepSource-Image Line Step for compressed marker labels UF image. NOTE THAT THIS VALUE MUST BE EQUAL TO oSizeROI.width * sizeof(Npp32u).
oSizeROIRegion-of-Interest (ROI).
nMaxMarkerLabelIDthe value of the maximum marker label ID returned by corresponding compress marker labels UF call.
pMarkerLabelsInfoListpointer to device memory buffer at least as large as value returned by the corresponding CompressedMarkerLabelsGetInfoListSize call.
pContoursImageoptional output image containing contours (boundaries) around each uniquely labeled connected pixel region, set to NULL if not needed.
nContoursImageStepimage_line_step for contours image.
pContoursDirectionImageoptional output image containing per contour pixel direction info around each uniquely labeled connected pixel region, set to NULL if not needed.
nContoursDirectionImageStepimage_line_step for contours image.
pContoursTotalsInfoHostunique per call optional host memory pointer to NppiContourTotalsInfo structure in host memory, MUST be set if pContoursDirectionImage is set.
pContoursPixelCountsListDevunique per call optional device memory pointer to array of nMaxMarkerLabelID unsigned integers in host memory, MUST be set if pContoursDirectionImage is set.
pContoursPixelCountsListHostunique per call optional host memory pointer to array of nMaxMarkerLabelID unsigned integers in host memory, MUST be set if pContoursDirectionImage is set.
pContoursPixelStartingOffsetHostunique per call optional host memory pointer to array of unsigned integers returned by this call representing the starting offset index of each contour found during geometry list generation
nppStreamCtxApplication Managed Stream Context.
Returns
Image Data Related Error Codes, ROI Related Error Codes.

Note that the input 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.


Copyright © 2009-2020 NVIDIA Corporation