NVIDIA 2D Image And Signal Performance Primitives (NPP)  Version 11.5.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 *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
pMarkerLabelsInfoListDev pointer to device memory buffer which contains the output returned by the corresponding nppiCompressedMarkerLabelsUFInfo_32u_C1R_Ctx call.
pMarkerLabelsInfoListHost pointer to host memory buffer which will be output by this function with additional information added.
pContoursDirectionImageDev Source-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.
nContoursDirectionImageStep image_line_step for contours image.
pContoursPixelGeometryListsDev pointer to device memory buffer allocated to be at least as big as size returned by corresponding nppiCompressedMarkerLabelsUFGetGeometryListsSize call.
pContoursPixelGeometryListsHost pointer to host memory buffer allocated to be at least as big as size returned by corresponding nppiCompressedMarkerLabelsUFGetGeometryListsSize call.
pContoursGeometryImageHost optional pointer to host memory image of at least oSizeROI.width * sizeof(Npp8u) * oSizeROI.height bytes, NULL if not needed.
nContoursGeometryImageStep geometry image line step.
pContoursPixelCountsListDev device memory pointer to array of nMaxMarkerLabelID unsigned integers returned by previous call to nppiCompressedMarkerLabelsUFContoursPixelGeometryLists_C1R_Ctx.
pContoursPixelsFoundListDev device memory pointer to array of nMaxMarkerLabelID unsigned integers returned by previous call to nppiCompressedMarkerLabelsUFContoursPixelGeometryLists_C1R_Ctx.
pContoursPixelsFoundListHost host memory pointer to array of nMaxMarkerLabelID unsigned integers returned by previous call to nppiCompressedMarkerLabelsUFContoursPixelGeometryLists_C1R_Ctx.
pContoursPixelsStartingOffsetDev 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.
pContoursPixelsStartingOffsetHost 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.
nTotalImagePixelContourCount the total number of contour pixels in the image.
nMaxMarkerLabelID the value of the maximum marker label ID returned by corresponding compress marker labels UF call.
nFirstContourGeometryListID the ID of the first contour geometry list to output.
nLastContourGeometryListID the ID of the last contour geometry list to output, last ID MUST be greater than first ID.
pContoursBlockSegmentListDev device memory pointer to array of NppiContourBlockSegment objects, contents will be initialized by NPP.
pContoursBlockSegmentListHost host memory pointer to array of NppiContourBlockSegment objects, contents will be intialized by NPP.
bOutputInCounterclockwiseOrder if nonzero then output geometry list for each contour in counterclockwise order, otherwise clockwise.
oSizeROI Region-of-Interest (ROI) for the images, must be the same as used in previous calls.
nppStreamCtx Application 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
pContoursPixelCountsListHost Host memory pointer to list returned by CompressedMarkerLabelsUFInfo_32u call.
nCompressedLabelCount the total label count returned by the nppiCompressMarkerLabelsUF function.
nTotalImagePixelContourCount the total number of contour pixels in the image from the NppiContourTotalsInfo object.
nFirstContourGeometryListID the ID of the first contour geometry list to process.
nLastContourGeometryListID the ID of the last contour geometry list to process, last ID MUST be greater than first ID.
hpBufferSize Required 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
nMaxContourPixelGeometryInfoCount the final value in the pContoursPixelStartingOffsetHost list.
hpBufferSize Required 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
nMaxMarkerLabelID value returned by previous call to CompressMarkerLabelsUF for this image.
hpBufferSize Required 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
pCompressedMarkerLabels Source-Image Pointer for compressed marker labels UF image.
nCompressedMarkerLabelsStep Source-Image Line Step for compressed marker labels UF image. NOTE THAT THIS VALUE MUST BE EQUAL TO oSizeROI.width * sizeof(Npp32u).
oSizeROI Region-of-Interest (ROI).
nMaxMarkerLabelID the value of the maximum marker label ID returned by corresponding compress marker labels UF call.
pMarkerLabelsInfoList pointer to device memory buffer at least as large as value returned by the corresponding CompressedMarkerLabelsGetInfoListSize call.
pContoursImage optional output image containing contours (boundaries) around each uniquely labeled connected pixel region, set to NULL if not needed.
nContoursImageStep image_line_step for contours image.
pContoursDirectionImage optional output image containing per contour pixel direction info around each uniquely labeled connected pixel region, set to NULL if not needed.
nContoursDirectionImageStep image_line_step for contours image.
pContoursTotalsInfoHost unique per call optional host memory pointer to NppiContourTotalsInfo structure in host memory, MUST be set if pContoursDirectionImage is set.
pContoursPixelCountsListDev unique per call optional device memory pointer to array of nMaxMarkerLabelID unsigned integers in host memory, MUST be set if pContoursDirectionImage is set.
pContoursPixelCountsListHost unique per call optional host memory pointer to array of nMaxMarkerLabelID unsigned integers in host memory, MUST be set if pContoursDirectionImage is set.
pContoursPixelStartingOffsetDev unique 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
pContoursPixelStartingOffsetHost unique 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
nppStreamCtx Application 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.