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

Various functions for interpolating pixels in image contours. More...

ContoursImageMarchingSquaresInterpolation

Apply Marching Squares bilinear interpolation to all contour pixels in a contours image where contour pixels have values of 0 and non-contour pixels have values of 255.

NppStatus nppiContoursImageMarchingSquaresInterpolation_32f_C1R_Ctx (Npp8u *pContoursImageDev, Npp32s nContoursImageStep, NppiPoint32f *pContoursInterpolatedImageDev, Npp32s nContoursInterpolatedImageStep, NppiContourPixelDirectionInfo *pContoursDirectionImageDev, Npp32s nContoursDirectionImageStep, NppiContourPixelGeometryInfo *pContoursPixelGeometryListsDev, NppiContourPixelGeometryInfo *pContoursPixelGeometryListsHost, NppiPoint32f *pContoursInterpolatedGeometryListsDev, Npp32u *pContoursPixelsFoundListHost, Npp32u *pContoursPixelsStartingOffsetDev, Npp32u *pContoursPixelsStartingOffsetHost, Npp32u nTotalImagePixelContourCount, Npp32u nMaxMarkerLabelID, Npp32u nFirstContourGeometryListID, Npp32u nLastContourGeometryListID, NppiContourBlockSegment *pContoursBlockSegmentListDev, NppiContourBlockSegment *pContoursBlockSegmentListHost, NppiSize oSizeROI, NppStreamContext nppStreamCtx)
 1 channel integer coordinate based contours image to marching squares bilinear interpolated coordinates contours image. More...
 
NppStatus nppiContoursImageMarchingSquaresInterpolation_64f_C1R_Ctx (Npp8u *pContoursImageDev, Npp32s nContoursImageStep, NppiPoint64f *pContoursInterpolatedImageDev, Npp32s nContoursInterpolatedImageStep, NppiContourPixelDirectionInfo *pContoursDirectionImageDev, Npp32s nContoursDirectionImageStep, NppiContourPixelGeometryInfo *pContoursPixelGeometryListsDev, NppiContourPixelGeometryInfo *pContoursPixelGeometryListsHost, NppiPoint64f *pContoursInterpolatedGeometryListsDev, Npp32u *pContoursPixelsFoundListHost, Npp32u *pContoursPixelsStartingOffsetDev, Npp32u *pContoursPixelsStartingOffsetHost, Npp32u nTotalImagePixelContourCount, Npp32u nMaxMarkerLabelID, Npp32u nFirstContourGeometryListID, Npp32u nLastContourGeometryListID, NppiContourBlockSegment *pContoursBlockSegmentListDev, NppiContourBlockSegment *pContoursBlockSegmentListHost, NppiSize oSizeROI, NppStreamContext nppStreamCtx)
 

Detailed Description

Various functions for interpolating pixels in image contours.

Function Documentation

NppStatus nppiContoursImageMarchingSquaresInterpolation_32f_C1R_Ctx ( Npp8u pContoursImageDev,
Npp32s  nContoursImageStep,
NppiPoint32f pContoursInterpolatedImageDev,
Npp32s  nContoursInterpolatedImageStep,
NppiContourPixelDirectionInfo pContoursDirectionImageDev,
Npp32s  nContoursDirectionImageStep,
NppiContourPixelGeometryInfo pContoursPixelGeometryListsDev,
NppiContourPixelGeometryInfo pContoursPixelGeometryListsHost,
NppiPoint32f pContoursInterpolatedGeometryListsDev,
Npp32u pContoursPixelsFoundListHost,
Npp32u pContoursPixelsStartingOffsetDev,
Npp32u pContoursPixelsStartingOffsetHost,
Npp32u  nTotalImagePixelContourCount,
Npp32u  nMaxMarkerLabelID,
Npp32u  nFirstContourGeometryListID,
Npp32u  nLastContourGeometryListID,
NppiContourBlockSegment pContoursBlockSegmentListDev,
NppiContourBlockSegment pContoursBlockSegmentListHost,
NppiSize  oSizeROI,
NppStreamContext  nppStreamCtx 
)

1 channel integer coordinate based contours image to marching squares bilinear interpolated coordinates contours image.

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 a 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
pContoursImageDevpointer to device memory image of at least oSizeROI.width * sizeof(Npp8u) * oSizeROI.height bytes.
nContoursImageStepimage line step.
pContoursInterpolatedImageDevpointer to device memory image of at least oSizeROI.width * sizeof(NppiPoint32f) * OSizeROI.height bytes.
nContoursInterpolatedImageStepimage line step
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.
pContoursInterpolatedGeometryListsDevpointer to device memory buffer allocated to be at least nTotalImagePixelContourCount * sizeof(NppPoint32f) bytes.
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.
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 nppiContoursImageMarchingSquaresInterpolation_64f_C1R_Ctx ( Npp8u pContoursImageDev,
Npp32s  nContoursImageStep,
NppiPoint64f pContoursInterpolatedImageDev,
Npp32s  nContoursInterpolatedImageStep,
NppiContourPixelDirectionInfo pContoursDirectionImageDev,
Npp32s  nContoursDirectionImageStep,
NppiContourPixelGeometryInfo pContoursPixelGeometryListsDev,
NppiContourPixelGeometryInfo pContoursPixelGeometryListsHost,
NppiPoint64f pContoursInterpolatedGeometryListsDev,
Npp32u pContoursPixelsFoundListHost,
Npp32u pContoursPixelsStartingOffsetDev,
Npp32u pContoursPixelsStartingOffsetHost,
Npp32u  nTotalImagePixelContourCount,
Npp32u  nMaxMarkerLabelID,
Npp32u  nFirstContourGeometryListID,
Npp32u  nLastContourGeometryListID,
NppiContourBlockSegment pContoursBlockSegmentListDev,
NppiContourBlockSegment pContoursBlockSegmentListHost,
NppiSize  oSizeROI,
NppStreamContext  nppStreamCtx 
)

Copyright © 2009-2022 NVIDIA CORPORATION AND AFFILIATES