NVIDIA 2D Image And Signal Performance Primitives (NPP)
Version 11.4.0.*
|
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... |
|
Various methods for extracting information from compressed marker labels.
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.
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. |
pContoursPixelGeometryListsHost | pointer to host memory buffer allocated to be at least as big as size returned by corresponding nppiCompressedMarkerLabelsUFGetGeometryListsSize call. |
pContoursPixelCountsListHost | host 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 this call representing the number of contour pixels 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. |
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. |
oSizeROI | Region-of-Interest (ROI) for the images, must be the same as used in previous calls. |
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.
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.
pContoursGeometryListsHost | pointer to host memory buffer allocated to be at least as big as size returned by corresponding nppiCompressedMarkerLabelsUFGetGeometryListsSize call. |
pMarkerLabelsInfoListHost | pointer to host memory buffer containing pMarkerLabelsInfoListHost output from nppiCompressedMarkerLabelsUFContoursGenerateGeometryLists_C1R_Ctx. |
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. |
pContoursPixelCountsListHost | host memory pointer to array of nMaxMarkerLabelID unsigned integers returned by previous call to nppiCompressedMarkerLabelsUFContoursPixelGeometryLists_C1R_Ctx |
pContoursPixelFoundListHost | host memory pointer to array of nMaxMarkerLabelID unsigned integers returned by this call representing the number of contour pixels 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 |
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. |
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. |
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.
nMaxContourPixelGeometryInfoCount | the final value in the pContoursPixelStartingOffsetHost list. |
hpBufferSize | Required buffer size. Important: hpBufferSize is a host pointer. Scratch Buffer and Host Pointer. |
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.
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. |
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.
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. |
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. |
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.