NVIDIA 2D Image And Signal Performance Primitives (NPP)  Version 11.7.1.*
 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 *pContoursPixelStartingOffsetDev, 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 nppiCompressedMarkerLabelsUFGetContoursBlockSegmentListSize_C1R (Npp32u *pContoursPixelCountsListHost, Npp32u nTotalImagePixelContourCount, Npp32u nCompressedLabelCount, Npp32u nFirstContourGeometryListID, Npp32u nLastContourGeometryListID, Npp32u *hpBufferSize)
 Calculate the size of memory needed for the geometry list generation function. More...
 
NppStatus nppiCompressedMarkerLabelsUFGetGeometryListsSize_C1R (Npp32u nMaxContourPixelGeometryInfoCount, Npp32u *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 *pContoursPixelGeometryListsDev, NppiContourPixelGeometryInfo *pContoursPixelGeometryListsHost, Npp8u *pContoursGeometryImageHost, Npp32s nContoursGeometryImageStep, Npp32u *pContoursPixelCountsListDev, Npp32u *pContoursPixelsFoundListDev, Npp32u *pContoursPixelsFoundListHost, Npp32u *pContoursPixelsStartingOffsetDev, Npp32u *pContoursPixelsStartingOffsetHost, Npp32u nTotalImagePixelContourCount, Npp32u nMaxMarkerLabelID, Npp32u nFirstContourGeometryListID, Npp32u nLastContourGeometryListID, NppiContourBlockSegment *pContoursBlockSegmentListDev, NppiContourBlockSegment *pContoursBlockSegmentListHost, Npp32u bOutputInCounterclockwiseOrder, NppiSize oSizeROI, NppStreamContext nppStreamCtx)
 1 channel connected region contours image to generate contours geometry info 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 pContoursPixelGeometryListsDev,
NppiContourPixelGeometryInfo pContoursPixelGeometryListsHost,
Npp8u pContoursGeometryImageHost,
Npp32s  nContoursGeometryImageStep,
Npp32u pContoursPixelCountsListDev,
Npp32u pContoursPixelsFoundListDev,
Npp32u pContoursPixelsFoundListHost,
Npp32u pContoursPixelsStartingOffsetDev,
Npp32u pContoursPixelsStartingOffsetHost,
Npp32u  nTotalImagePixelContourCount,
Npp32u  nMaxMarkerLabelID,
Npp32u  nFirstContourGeometryListID,
Npp32u  nLastContourGeometryListID,
NppiContourBlockSegment pContoursBlockSegmentListDev,
NppiContourBlockSegment pContoursBlockSegmentListHost,
Npp32u  bOutputInCounterclockwiseOrder,
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 to significantly improve performance by default an contour that contains more than 256K pixels will be bypassed when generating the output geometry list. The contour ID and number of contour pixels will be output in the contour list however. You can still get this function to output the geometry of this size contour howver by calling the function with a starting contour ID of that contour ID and and ending contour ID of that contour ID + 1. Note that doing so for contours approaching a million pixels can take many minutes. Also, due to the structure of some images contour ID 0 can contain ALL contours in the image so setting the starting contour ID to 1 can significantly increase output preprocessing performance.

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.

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.
pContoursPixelGeometryListsDevpointer to device memory buffer allocated to be at least as big as size returned by corresponding nppiCompressedMarkerLabelsUFGetGeometryListsSize call.
pContoursPixelGeometryListsHostpointer to host memory buffer allocated to be at least as big as size returned by corresponding nppiCompressedMarkerLabelsUFGetGeometryListsSize call.
pContoursGeometryImageHostoptional pointer to host memory image of at least oSizeROI.width * sizeof(Npp8u) * oSizeROI.height bytes, NULL if not needed.
nContoursGeometryImageStepgeometry image line step.
pContoursPixelCountsListDevdevice memory pointer to array of nMaxMarkerLabelID unsigned integers returned by previous call to nppiCompressedMarkerLabelsUFContoursPixelGeometryLists_C1R_Ctx.
pContoursPixelsFoundListDevdevice 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 previous call to nppiCompressedMarkerLabelsUFContoursPixelGeometryLists_C1R_Ctx.
pContoursPixelsStartingOffsetDevdevice memory pointer to array of unsigned integers returned by this call representing the starting offset index of each contour 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.
nTotalImagePixelContourCountthe total number of contour pixels in the image returned by nppiCompressedMarkerLabelsUFInfo_32u_C1R_Ctx() call.
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, last ID MUST be greater than first ID.
pContoursBlockSegmentListDevdevice memory pointer to array of NppiContourBlockSegment objects, contents will be initialized by NPP.
pContoursBlockSegmentListHosthost memory pointer to array of NppiContourBlockSegment objects, contents will be intialized by NPP.
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.
nppStreamCtxApplication Managed Stream Context.
Returns
Image Data Related Error Codes, ROI Related Error Codes.
NppStatus nppiCompressedMarkerLabelsUFGetContoursBlockSegmentListSize_C1R ( Npp32u pContoursPixelCountsListHost,
Npp32u  nTotalImagePixelContourCount,
Npp32u  nCompressedLabelCount,
Npp32u  nFirstContourGeometryListID,
Npp32u  nLastContourGeometryListID,
Npp32u hpBufferSize 
)

Calculate the size of memory needed for the geometry list generation function.

Parameters
pContoursPixelCountsListHostHost memory pointer to list returned by CompressedMarkerLabelsUFInfo_32u call.
nCompressedLabelCountthe total label count returned by the nppiCompressMarkerLabelsUF function.
nTotalImagePixelContourCountthe total number of contour pixels in the image from the NppiContourTotalsInfo object returned from nppiCompressedMarkerLabelsUFInfo_32u_C1R_Ctx() call.
nFirstContourGeometryListIDthe ID of the first contour geometry list to process.
nLastContourGeometryListIDthe ID of the last contour geometry list to process, last ID MUST be greater than first ID.
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 nppiCompressedMarkerLabelsUFGetGeometryListsSize_C1R ( Npp32u  nMaxContourPixelGeometryInfoCount,
Npp32u 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 pContoursPixelStartingOffsetDev,
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.
pContoursPixelStartingOffsetDevunique per call optional device memory pointer to array of unsigned integers returned by this call representing the starting offset index of each contour found during geometry list generation
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-2022 NVIDIA CORPORATION AND AFFILIATES