/// <summary> /// label markers image generation with per image destination ROI. /// </summary> /// <param name="pSrcBatchList">source_batch_images_pointer device memory pointer to the list of device memory source image descriptors, oSize element is ignored.</param> /// <param name="pDstBatchList">destination_batch_images_pointer device memory pointer to the list of device memory destination image descriptors, oSize element is ignored.</param> /// <param name="oMaxSizeROI">maximum ROI width and height of ALL images in the batch.</param> /// <param name="eNorm">Type of pixel connectivity test to use, nppiNormInf will use 8 way connectivity and nppiNormL1 will use 4 way connectivity. </param> public static void LabelMarkersUFBatch_Advanced(CudaDeviceVariable <NppiImageDescriptor> pSrcBatchList, CudaDeviceVariable <NppiImageDescriptor> pDstBatchList, NppiSize oMaxSizeROI, NppiNorm eNorm) { NppStatus status = NPPNativeMethods.NPPi.LabelMarkers.nppiLabelMarkersUFBatch_32u_C1R_Advanced(pSrcBatchList.DevicePointer, pDstBatchList.DevicePointer, pSrcBatchList.Size, oMaxSizeROI, eNorm); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiLabelMarkersUFBatch_32u_C1R_Advanced", status)); NPPException.CheckNppStatus(status, pSrcBatchList); }
/// <summary> /// in place flood fill. /// </summary> /// <param name="oSeed">Image location of seed pixel value to be used for comparison.</param> /// <param name="nNewValue">Image pixel values to be used to replace matching pixels.</param> /// <param name="eNorm">Type of pixel connectivity test to use, nppiNormInf will use 8 way connectivity and nppiNormL1 will use 4 way connectivity. </param> /// <param name="pBuffer">Pointer to device memory scratch buffer at least as large as value returned by the corresponding LabelMarkersUFGetBufferSize call.</param> public NppiConnectedRegion FloodFill(NppiPoint oSeed, uint nNewValue, NppiNorm eNorm, CudaDeviceVariable <byte> pBuffer) { NppiConnectedRegion pConnectedRegion = new NppiConnectedRegion(); status = NPPNativeMethods.NPPi.FloodFill.nppiFloodFill_32u_C1IR(_devPtrRoi, _pitch, oSeed, nNewValue, eNorm, _sizeRoi, ref pConnectedRegion, pBuffer.DevicePointer); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFloodFill_32u_C1IR", status)); NPPException.CheckNppStatus(status, this); return(pConnectedRegion); }
/// <summary> /// 1 channel 32-bit to 32-bit unsigned integer label markers image generation. /// </summary> /// <param name="dest">Destination image</param> /// <param name="eNorm">Type of pixel connectivity test to use, nppiNormInf will use 8 way connectivity and nppiNormL1 will use 4 way connectivity. </param> /// <param name="pBuffer">Pointer to device memory scratch buffer at least as large as value returned by the corresponding LabelMarkersUFGetBufferSize call.</param> public void LabelMarkersUF(NPPImage_32uC1 dest, NppiNorm eNorm, CudaDeviceVariable <byte> pBuffer) { status = NPPNativeMethods.NPPi.LabelMarkers.nppiLabelMarkersUF_32u_C1R(_devPtrRoi, _pitch, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, eNorm, pBuffer.DevicePointer); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiLabelMarkersUF_32u_C1R", status)); NPPException.CheckNppStatus(status, this); }
/// <summary> /// 3 channel 8-bit unsigned packed RGB to optional 1 channel 16-bit signed X (vertical), Y (horizontal), magnitude, /// and/or 32-bit floating point angle gradient vectors with user selectable fixed mask size and distance method with border control. /// </summary> /// <param name="destX">X vector destination_image_pointer</param> /// <param name="destY">Y vector destination_image_pointer.</param> /// <param name="destMag">magnitude destination_image_pointer.</param> /// <param name="destAngle">angle destination_image_pointer.</param> /// <param name="eMaskSize">fixed filter mask size to use.</param> /// <param name="eNorm">gradient distance method to use.</param> /// <param name="eBorderType">The border type operation to be applied at source image border boundaries.</param> public void GradientVectorSobelBorder(NPPImage_16sC1 destX, NPPImage_16sC1 destY, NPPImage_16sC1 destMag, NPPImage_32fC1 destAngle, MaskSize eMaskSize, NppiNorm eNorm, NppiBorderType eBorderType) { status = NPPNativeMethods.NPPi.GradientVectorSobelBorder.nppiGradientVectorSobelBorder_8u16s_C3C1R(_devPtr, _pitch, _sizeOriginal, _pointRoi, destX.DevicePointerRoi, destX.Pitch, destY.DevicePointerRoi, destY.Pitch, destMag.DevicePointerRoi, destMag.Pitch, destAngle.DevicePointerRoi, destAngle.Pitch, _sizeRoi, eMaskSize, eNorm, eBorderType); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiGradientVectorSobelBorder_8u16s_C3C1R", status)); NPPException.CheckNppStatus(status, this); }
/// <summary> /// 3 channel 8-bit unsigned packed RGB to 1 channel 8-bit unsigned packed Gray Gradient conversion. /// </summary> /// <param name="dest">Destination image</param> /// <param name="eNorm">Gradient distance method to use.</param> public void GradientColorToGray(NPPImage_8uC1 dest, NppiNorm eNorm) { NppStatus status = NPPNativeMethods.NPPi.GradientColorToGray.nppiGradientColorToGray_8u_C3C1R(DevicePointerRoi, Pitch, dest.DevicePointerRoi, dest.Pitch, SizeRoi, eNorm); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiGradientColorToGray_8u_C3C1R", status)); NPPException.CheckNppStatus(status, null); }
/// <summary> /// in place flood fill. /// </summary> /// <param name="oSeed">Image location of seed pixel value to be used for comparison.</param> /// <param name="nMin">Value of each element of tested pixel must be >= the corresponding seed value - aMin value.</param> /// <param name="nMax">Valeu of each element of tested pixel must be <= the corresponding seed value + aMax value.</param> /// <param name="nNewValue">Image pixel values to be used to replace matching pixels.</param> /// <param name="nBoundaryValue">Image pixel values to be used for region boundary. </param> /// <param name="eNorm">Type of pixel connectivity test to use, nppiNormInf will use 8 way connectivity and nppiNormL1 will use 4 way connectivity. </param> /// <param name="pBuffer">Pointer to device memory scratch buffer at least as large as value returned by the corresponding LabelMarkersUFGetBufferSize call.</param> /// <param name="nppStreamCtx">NPP stream context.</param> public NppiConnectedRegion FloodFillGradient(NppiPoint oSeed, uint nMin, uint nMax, uint nNewValue, uint nBoundaryValue, NppiNorm eNorm, CudaDeviceVariable <byte> pBuffer, NppStreamContext nppStreamCtx) { NppiConnectedRegion pConnectedRegion = new NppiConnectedRegion(); status = NPPNativeMethods_Ctx.NPPi.FloodFill.nppiFloodFillGradientBoundary_32u_C1IR_Ctx(_devPtrRoi, _pitch, oSeed, nMin, nMax, nNewValue, nBoundaryValue, eNorm, _sizeRoi, ref pConnectedRegion, pBuffer.DevicePointer, nppStreamCtx); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFloodFillGradientBoundary_32u_C1IR_Ctx", status)); NPPException.CheckNppStatus(status, this); return(pConnectedRegion); }