Ejemplo n.º 1
0
 public static extern NppStatus nppiDilate3x3Border_16u_C1R(
     IntPtr pSrc,
     Npp32s nSrcStep,
     NppiSize oSrcSize,
     NppiPoint oSrcOffset,
     IntPtr pDst,
     Npp32s nDstStep,
     NppiSize oSizeROI,
     NppiBorderType eBorderType);
Ejemplo n.º 2
0
		/// <summary>
		/// Filters the image using a separable Gaussian filter kernel with user supplied floating point coefficients
		/// </summary>
		/// <param name="dst">Destination-Image</param>
		/// <param name="Kernel">Pointer to an array of nFilterTaps kernel coefficients which sum to 1.0F, where nFilterTaps =  2 * ((int)((float)ceil(radius) + 0.5F) ) + 1.</param>
		/// <param name="eBorderType">The border type operation to be applied at source image border boundaries.</param>
		public void FilterGaussBorderA(NPPImage_8uC4 dst, CudaDeviceVariable<float> Kernel, NppiBorderType eBorderType)
		{
			status = NPPNativeMethods.NPPi.FilterGaussBorder.nppiFilterGaussAdvancedBorder_8u_AC4R(_devPtr, _pitch, _sizeOriginal, _pointRoi, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, Kernel.Size, Kernel.DevicePointer, eBorderType);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterGaussAdvancedBorder_8u_AC4R", status));
			NPPException.CheckNppStatus(status, this);
		}
Ejemplo n.º 3
0
		/// <summary>
		/// Sharpen filter.
		/// </summary>
		/// <param name="dst">Destination-Image</param>
		/// <param name="eBorderType">The border type operation to be applied at source image border boundaries.</param>
		public void FilterSharpenBorderA(NPPImage_8uC4 dst, NppiBorderType eBorderType)
		{
			status = NPPNativeMethods.NPPi.FixedFilters.nppiFilterSharpenBorder_8u_AC4R(_devPtr, _pitch, _sizeOriginal, _pointRoi, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, eBorderType);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterSharpenBorder_8u_AC4R", status));
			NPPException.CheckNppStatus(status, this);
		}
Ejemplo n.º 4
0
		/// <summary>
		/// Apply Row Window Summation filter over a 1D mask region around each source
		/// pixel for 3-channel 8-bit pixel input images with 32-bit floating point output.  
		/// Result 32-bit floating point pixel is equal to the sum of the corresponding and
		/// neighboring row pixel values in a mask region of the source image defined
		/// by nKernelDim and nAnchorX. 
		/// </summary>
		/// <param name="dest">Destination image</param>
		/// <param name="nMaskSize">Length of the linear kernel array.</param>
		/// <param name="nAnchor">X offset of the kernel origin frame of reference w.r.t the source pixel.</param>
		/// <param name="eBorderType">The border type operation to be applied at source image border boundaries.</param>
		public void SumWindowRowBorder(NPPImage_32fC4 dest, int nMaskSize, int nAnchor, NppiBorderType eBorderType)
		{
			status = NPPNativeMethods.NPPi.WindowSum1D.nppiSumWindowRowBorder_8u32f_C4R(_devPtr, _pitch, _sizeOriginal, _pointRoi, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, nMaskSize, nAnchor, eBorderType);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiSumWindowRowBorder_8u32f_C4R", status));
			NPPException.CheckNppStatus(status, this);
		}
Ejemplo n.º 5
0
		/// <summary>
		/// Erosion computes the output pixel as the minimum pixel value of the pixels under the mask. Pixels who’s
		/// corresponding mask values are zero to not participate in the maximum search. With border control, ignoring alpha-channel.
		/// </summary>
		/// <param name="dest">Destination image</param>
		/// <param name="Mask">Pointer to the start address of the mask array.</param>
		/// <param name="aMaskSize">Width and Height mask array.</param>
		/// <param name="oAnchor">X and Y offsets of the mask origin frame of reference w.r.t the source pixel.</param>
		/// <param name="eBorderType">The border type operation to be applied at source image border boundaries.</param>
		public void ErodeBorderA(NPPImage_8uC4 dest, CudaDeviceVariable<byte> Mask, NppiSize aMaskSize, NppiPoint oAnchor, NppiBorderType eBorderType)
		{
			status = NPPNativeMethods.NPPi.ErosionWithBorderControl.nppiErodeBorder_8u_AC4R(_devPtr, _pitch, _sizeOriginal, _pointRoi, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, Mask.DevicePointer, aMaskSize, oAnchor, eBorderType);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiErodeBorder_8u_AC4R", status));
			NPPException.CheckNppStatus(status, this);
		}
Ejemplo n.º 6
0
		/// <summary>
		/// 3x3 erosion with border control.
		/// </summary>
		/// <param name="dest">Destination image</param>
		/// <param name="eBorderType">The border type operation to be applied at source image border boundaries.</param>
		public void Erode3x3Border(NPPImage_16uC3 dest, NppiBorderType eBorderType)
		{
			status = NPPNativeMethods.NPPi.Erode3x3Border.nppiErode3x3Border_16u_C3R(_devPtr, _pitch, _sizeOriginal, _pointRoi, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, eBorderType);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiErode3x3Border_16u_C3R", status));
			NPPException.CheckNppStatus(status, this);
		}
Ejemplo n.º 7
0
 /// <summary>
 /// Two channel 32-bit float convolution filter with border control.<para/>
 /// General purpose 2D convolution filter using floating-point weights with border control.<para/>
 /// Pixels under the mask are multiplied by the respective weights in the mask
 /// and the results are summed. Before writing the result pixel the sum is scaled
 /// back via division by nDivisor. If any portion of the mask overlaps the source
 /// image boundary the requested border type operation is applied to all mask pixels
 /// which fall outside of the source image. <para/>
 /// </summary>
 /// <param name="dest">Destination image</param>
 /// <param name="pKernel">Pointer to the start address of the kernel coefficient array. Coeffcients are expected to be stored in reverse order</param>
 /// <param name="nKernelSize">Width and Height of the rectangular kernel.</param>
 /// <param name="oAnchor">X and Y offsets of the kernel origin frame of reference relative to the source pixel.</param>
 /// <param name="eBorderType">The border type operation to be applied at source image border boundaries.</param>
 public void FilterBorder(NPPImage_32fC2 dest, CudaDeviceVariable <float> pKernel, NppiSize nKernelSize, NppiPoint oAnchor, NppiBorderType eBorderType)
 {
     status = NPPNativeMethods.NPPi.FilterBorder.nppiFilterBorder_32f_C2R(_devPtr, _pitch, _sizeOriginal, _pointRoi, dest.DevicePointerRoi, dest.Pitch, dest.SizeRoi, pKernel.DevicePointer, nKernelSize, oAnchor, eBorderType);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterBorder_32f_C2R", status));
     NPPException.CheckNppStatus(status, this);
 }
Ejemplo n.º 8
0
 public static extern NppStatus nppiFilterMinBorder_8u_C4R(
     IntPtr pSrc,
     Npp32s nSrcStep,
     NppiSize oSrcSize,
     NppiPoint oSrcOffset,
     IntPtr pDst,
     Npp32s nDstStep,
     NppiSize oSizeROI,
     NppiSize oMaskSize,
     NppiPoint oAnchor,
     NppiBorderType eBorderType);
Ejemplo n.º 9
0
 public static extern NppStatus nppiFilterSharpenBorder_32f_C4R(
     IntPtr pSrc,
     Npp32s nSrcStep,
     NppiSize oSrcSize,
     NppiPoint oSrcOffset,
     IntPtr pDst,
     Npp32s nDstStep,
     NppiSize oSizeROI,
     NppiBorderType eBorderType);
Ejemplo n.º 10
0
 public static extern NppStatus nppiFilterScharrHorizBorder_8u16s_C1R(
     IntPtr pSrc,
     Npp32s nSrcStep,
     NppiSize oSrcSize,
     NppiPoint oSrcOffset,
     IntPtr pDst,
     Npp32s nDstStep,
     NppiSize oSizeROI,
     NppiBorderType eBorderType);
Ejemplo n.º 11
0
 public static extern NppStatus nppiFilterRobertsUpBorder_16s_C4R(
     IntPtr pSrc,
     Npp32s nSrcStep,
     NppiSize oSrcSize,
     NppiPoint oSrcOffset,
     IntPtr pDst,
     Npp32s nDstStep,
     NppiSize oSizeROI,
     NppiBorderType eBorderType);
Ejemplo n.º 12
0
 /// <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);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Three channel 8-bit unsigned Gauss filter with downsampling and border control.
 /// </summary>
 /// <param name="dest">Destination image</param>
 /// <param name="nRate">The downsampling rate to be used.  For integer equivalent rates unnecessary source pixels are just skipped. For non-integer rates the source image is bilinear interpolated. nRate must be > 1.0F and &lt;=  10.0F. </param>
 /// <param name="nFilterTaps">The number of filter taps where nFilterTaps =  2 * ((int)((float)ceil(radius) + 0.5F) ) + 1.</param>
 /// <param name="pKernel">Pointer to an array of nFilterTaps kernel coefficients which sum to 1.0F. </param>
 /// <param name="eBorderType">The border type operation to be applied at source image border boundaries.</param>
 public void FilterGaussPyramidLayerUpBorder(NPPImage_8uC3 dest, float nRate, int nFilterTaps, CudaDeviceVariable<float> pKernel, NppiBorderType eBorderType)
 {
     status = NPPNativeMethods.NPPi.FilterGaussPyramid.nppiFilterGaussPyramidLayerUpBorder_8u_C3R(_devPtr, _pitch, _sizeOriginal, _pointRoi, dest.DevicePointerRoi, dest.Pitch, dest.SizeRoi, nRate, nFilterTaps, pKernel.DevicePointer, eBorderType);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterGaussPyramidLayerUpBorder_8u_C3R", status));
     NPPException.CheckNppStatus(status, this);
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Three channel 8-bit unsigned bilateral Gauss filter with border control.
 /// </summary>
 /// <param name="dest">Destination image</param>
 /// <param name="nRadius">The radius of the round filter kernel to be used.  A radius of 1 indicates a filter kernel size of 3 by 3, 2 indicates 5 by 5, etc. Radius values from 1 to 32 are supported.</param>
 /// <param name="nStepBetweenSrcPixels">The step size between adjacent source image pixels processed by the filter kernel, most commonly 1. </param>
 /// <param name="nValSquareSigma">The square of the sigma for the relative intensity distance between a source image pixel in the filter kernel and the source image pixel at the center of the filter kernel.</param>
 /// <param name="nPosSquareSigma">The square of the sigma for the relative geometric distance between a source image pixel in the filter kernel and the source image pixel at the center of the filter kernel.</param>
 /// <param name="eBorderType">The border type operation to be applied at source image border boundaries.</param>
 public void FilterBilateralGaussBorder(NPPImage_8uC3 dest, int nRadius, int nStepBetweenSrcPixels, float nValSquareSigma, float nPosSquareSigma, NppiBorderType eBorderType)
 {
     status = NPPNativeMethods.NPPi.FilterBilateralGaussBorder.nppiFilterBilateralGaussBorder_8u_C3R(_devPtr, _pitch, _sizeOriginal, _pointRoi, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, nRadius, nStepBetweenSrcPixels, nValSquareSigma, nPosSquareSigma, eBorderType);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterBilateralGaussBorder_8u_C3R", status));
     NPPException.CheckNppStatus(status, this);
 }
Ejemplo n.º 15
0
 public static extern NppStatus nppiDilateBorder_8u_C4R(
     IntPtr pSrc,
     int nSrcStep,
     NppiSize oSrcSize,
     NppiPoint oSrcOffset,
     IntPtr pDst,
     int nDstStep,
     NppiSize oSizeROI,
     IntPtr pMask,
     NppiSize oMaskSize,
     NppiPoint oAnchor,
     NppiBorderType eBorderType);
Ejemplo n.º 16
0
 public static extern NppStatus nppiFilterSobelVertBorder_8u_AC4R(
     IntPtr pSrc,
     Npp32s nSrcStep,
     NppiSize oSrcSize,
     NppiPoint oSrcOffset,
     IntPtr pDst,
     Npp32s nDstStep,
     NppiSize oSizeROI,
     NppiBorderType eBorderType);
Ejemplo n.º 17
0
 public static extern NppStatus nppiFilterLowPassBorder_8u_C3R(
     IntPtr pSrc,
     Npp32s nSrcStep,
     NppiSize oSrcSize,
     NppiPoint oSrcOffset,
     IntPtr pDst,
     Npp32s nDstStep,
     NppiSize oSizeROI,
     NppiMaskSize eMaskSize,
     NppiBorderType eBorderType);
Ejemplo n.º 18
0
 public static extern NppStatus nppiFilterSobelVertSecondBorder_8u16s_C1R(
     IntPtr pSrc,
     Npp32s nSrcStep,
     NppiSize oSrcSize,
     NppiPoint oSrcOffset,
     IntPtr pDst,
     Npp32s nDstStep,
     NppiSize oSizeROI,
     NppiMaskSize eMaskSize,
     NppiBorderType eBorderType);
Ejemplo n.º 19
0
 public static extern NppStatus nppiFilterBorder32f_32s_AC4R(
     IntPtr pSrc,
     int nSrcStep,
     NppiSize oSrcSize,
     NppiPoint oSrcOffset,
     IntPtr pDst,
     int nDstStep,
     NppiSize oSizeROI,
     IntPtr pKernel,
     NppiSize oKernelSize,
     NppiPoint oAnchor,
     NppiBorderType eBorderType);
Ejemplo n.º 20
0
 public static extern NppStatus nppiFilterUnsharpBorder_8u_C4R(
     IntPtr pSrc,
     Npp32s nSrcStep,
     NppiPoint oSrcOffset,
     IntPtr pDst,
     Npp32s nDstStep,
     NppiSize oSizeROI,
     Npp32f nRadius,
     Npp32f nSigma,
     Npp32f nWeight,
     Npp32f nThreshold,
     NppiBorderType eBorderType,
     IntPtr pDeviceBuffer);
Ejemplo n.º 21
0
 /// <summary>
 /// 32-bit float convolution filter with border control.
 /// </summary>
 /// <param name="dest">Destination image</param>
 /// <param name="pKernel">Pointer to the start address of the kernel coefficient array. Coeffcients are expected to be stored in reverse order</param>
 /// <param name="nKernelSize">Width and Height of the rectangular kernel.</param>
 /// <param name="oAnchor">X and Y offsets of the kernel origin frame of reference relative to the source pixel.</param>
 /// <param name="eBorderType">The border type operation to be applied at source image border boundaries.</param>
 /// <param name="filterArea">The area where the filter is allowed to read pixels. The point is relative to the ROI set to source image, the size is the total size starting from the filterArea point. Default value is the set ROI.</param>
 /// <param name="nppStreamCtx">NPP stream context.</param>
 public void FilterBorder(NPPImage_16fC1 dest, CudaDeviceVariable <float> pKernel, NppiSize nKernelSize, NppiPoint oAnchor, NppiBorderType eBorderType, NppStreamContext nppStreamCtx, NppiRect filterArea = new NppiRect())
 {
     if (filterArea.Size == new NppiSize())
     {
         filterArea.Size = _sizeRoi;
     }
     status = NPPNativeMethods_Ctx.NPPi.FilterBorder32f.nppiFilterBorder32f_16f_C1R_Ctx(_devPtrRoi, _pitch, filterArea.Size, filterArea.Location, dest.DevicePointerRoi, dest.Pitch, dest.SizeRoi, pKernel.DevicePointer, nKernelSize, oAnchor, eBorderType, nppStreamCtx);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterBorder32f_16f_C1R_Ctx", status));
     NPPException.CheckNppStatus(status, this);
 }
Ejemplo n.º 22
0
 public static extern NppStatus nppiSumWindowRowBorder_8u32f_C4R(
     IntPtr pSrc,
     Npp32s nSrcStep,
     NppiSize oSrcSize,
     NppiPoint oSrcOffset,
     IntPtr pDst,
     Npp32s nDstStep,
     NppiSize oROI,
     Npp32s nMaskSize,
     Npp32s nAnchor,
     NppiBorderType eBorderType);
Ejemplo n.º 23
0
		/// <summary>
		/// Low pass filter.
		/// </summary>
		/// <param name="dst">Destination-Image</param>
		/// <param name="eMaskSize">Enumeration value specifying the mask size.</param>
		/// <param name="eBorderType">The border type operation to be applied at source image border boundaries.</param>
		public void FilterLowPassBorder(NPPImage_16uC3 dst, MaskSize eMaskSize, NppiBorderType eBorderType)
		{
			status = NPPNativeMethods.NPPi.FixedFilters.nppiFilterLowPassBorder_16u_C3R(_devPtr, _pitch, _sizeOriginal, _pointRoi, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, eMaskSize, eBorderType);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterLowPassBorder_16u_C3R", status));
			NPPException.CheckNppStatus(status, this);
		}
Ejemplo n.º 24
0
 public static extern NppStatus nppiFilterBorder_16u_C3R(
     IntPtr pSrc,
     Npp32s nSrcStep,
     NppiSize oSrcSize,
     NppiPoint oSrcOffset,
     IntPtr pDst,
     Npp32s nDstStep,
     NppiSize oSizeROI,
     IntPtr pKernel,
     NppiSize oKernelSize,
     NppiPoint oAnchor,
     Npp32s nDivisor,
     NppiBorderType eBorderType);
Ejemplo n.º 25
0
		/// <summary>
		/// General purpose 1D convolution row filter with border control.<para/>
		/// Pixels under the mask are multiplied by the respective weights in the mask
		/// and the results are summed. If any portion of the mask overlaps the source
		/// image boundary the requested border type operation is applied to all mask pixels
		/// which fall outside of the source image.
		/// </summary>
		/// <param name="dest">Destination image</param>
		/// <param name="Kernel">Pointer to the start address of the kernel coefficient array. Coeffcients are expected to be stored in reverse order.</param>
		/// <param name="nAnchor">X offset of the kernel origin frame of reference w.r.t the source pixel.</param>
		/// <param name="eBorderType">The border type operation to be applied at source image border boundaries.</param>
		public void FilterRowBorder(NPPImage_8uC4 dest, CudaDeviceVariable<float> Kernel, int nAnchor, NppiBorderType eBorderType)
		{
			status = NPPNativeMethods.NPPi.LinearFilter1D.nppiFilterRowBorder32f_8u_C4R(_devPtr, _pitch, _sizeOriginal, _pointRoi, dest.DevicePointerRoi, dest.Pitch, dest.SizeRoi, Kernel.DevicePointer, Kernel.Size, nAnchor, eBorderType);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterRowBorder32f_8u_C4R", status));
			NPPException.CheckNppStatus(status, this);
		}
Ejemplo n.º 26
0
 public static extern NppStatus nppiFilterColumnBorder32f_16s_C3R(
     IntPtr pSrc,
     int nSrcStep,
     NppiSize oSrcSize,
     NppiPoint oSrcOffset,
     IntPtr pDst,
     int nDstStep,
     NppiSize oSizeROI,
     IntPtr pKernel,
     Npp32s nMaskSize,
     Npp32s nAnchor,
     NppiBorderType eBorderType);
Ejemplo n.º 27
0
		/// <summary>
		/// Result pixel value is the maximum of pixel values under the rectangular mask region.
		/// </summary>
		/// <param name="dest">Destination image</param>
		/// <param name="oMaskSize">Width and Height of the neighborhood region for the local Avg operation.</param>
		/// <param name="oAnchor">X and Y offsets of the kernel origin frame of reference w.r.t the source pixel.</param>
		/// <param name="eBorderType">The border type operation to be applied at source image border boundaries.</param>
		public void FilterMaxBorder(NPPImage_8uC4 dest, NppiSize oMaskSize, NppiPoint oAnchor, NppiBorderType eBorderType)
		{
			status = NPPNativeMethods.NPPi.RankFilters.nppiFilterMaxBorder_8u_C4R(_devPtr, _pitch, _sizeOriginal, _pointRoi, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, oMaskSize, oAnchor, eBorderType);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterMaxBorder_8u_C4R", status));
			NPPException.CheckNppStatus(status, this);
		}
Ejemplo n.º 28
0
 public static extern NppStatus nppiFilterColumnBorder_8u_C4R(
     IntPtr pSrc,
     Npp32s nSrcStep,
     NppiSize oSrcSize,
     NppiPoint oSrcOffset,
     IntPtr pDst,
     Npp32s nDstStep,
     NppiSize oSizeROI,
     IntPtr pKernel,
     Npp32s nMaskSize,
     Npp32s nAnchor,
     Npp32s nDivisor,
     NppiBorderType eBorderType);
Ejemplo n.º 29
0
		/// <summary>
		/// Filters the image using a unsharp-mask sharpening filter kernel with border control.<para/>
		/// The algorithm involves the following steps:<para/>
		/// Smooth the original image with a Gaussian filter, with the width controlled by the nRadius.<para/>
		/// Subtract the smoothed image from the original to create a high-pass filtered image.<para/>
		/// Apply any clipping needed on the high-pass image, as controlled by the nThreshold.<para/>
		/// Add a certain percentage of the high-pass filtered image to the original image, 
		/// with the percentage controlled by the nWeight.
		/// In pseudocode this algorithm can be written as:<para/>
		/// HighPass = Image - Gaussian(Image)<para/>
		/// Result = Image + nWeight * HighPass * ( |HighPass| >= nThreshold ) <para/>
		/// where nWeight is the amount, nThreshold is the threshold, and >= indicates a Boolean operation, 1 if true, or 0 otherwise.
		/// <para/>
		/// If any portion of the mask overlaps the source image boundary, the requested border type 
		/// operation is applied to all mask pixels which fall outside of the source image.
		/// </summary>
		/// <param name="dst">Destination-Image</param>
		/// <param name="nRadius">The radius of the Gaussian filter, in pixles, not counting the center pixel.</param>
		/// <param name="nSigma">The standard deviation of the Gaussian filter, in pixel.</param>
		/// <param name="nWeight">The percentage of the difference between the original and the high pass image that is added back into the original.</param>
		/// <param name="nThreshold">The threshold needed to apply the difference amount.</param>
		/// <param name="eBorderType">The border type operation to be applied at source image border boundaries.</param>
		/// <param name="buffer">Pointer to the user-allocated device scratch buffer required for the unsharp operation.</param>
		public void FilterUnsharpBorderA(NPPImage_8uC4 dst, float nRadius, float nSigma, float nWeight, float nThreshold, NppiBorderType eBorderType, CudaDeviceVariable<byte> buffer)
		{
			if (buffer.Size < FilterUnsharpGetBufferSizeA(nRadius, nSigma))
				throw new NPPException("Provided buffer is too small.");

			status = NPPNativeMethods.NPPi.FixedFilters.nppiFilterUnsharpBorder_8u_AC4R(_devPtr, _pitch, _pointRoi, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, nRadius, nSigma, nWeight, nThreshold, eBorderType, buffer.DevicePointer);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterUnsharpBorder_8u_AC4R", status));
			NPPException.CheckNppStatus(status, this);
		}
Ejemplo n.º 30
0
 public static extern NppStatus nppiFilterGaussAdvancedBorder_8u_C4R(
     IntPtr pSrc,
     Npp32s nSrcStep,
     NppiSize oSrcSize,
     NppiPoint oSrcOffset,
     IntPtr pDst,
     Npp32s nDstStep,
     NppiSize oSizeROI,
     int nFilterTaps,
     IntPtr pKernel,
     NppiBorderType eBorderType);
Ejemplo n.º 31
0
		/// <summary>
		/// Four channel 32-bit signed convolution filter with border control, ignoring alpha channel.<para/>
		/// General purpose 2D convolution filter using floating-point weights with border control.<para/>
		/// Pixels under the mask are multiplied by the respective weights in the mask
		/// and the results are summed. Before writing the result pixel the sum is scaled
		/// back via division by nDivisor. If any portion of the mask overlaps the source
		/// image boundary the requested border type operation is applied to all mask pixels
		/// which fall outside of the source image. <para/>
		/// </summary>
		/// <param name="dest">Destination image</param>
		/// <param name="pKernel">Pointer to the start address of the kernel coefficient array. Coeffcients are expected to be stored in reverse order</param>
		/// <param name="nKernelSize">Width and Height of the rectangular kernel.</param>
		/// <param name="oAnchor">X and Y offsets of the kernel origin frame of reference relative to the source pixel.</param>
		/// <param name="eBorderType">The border type operation to be applied at source image border boundaries.</param>
		public void FilterBorderA(NPPImage_32sC4 dest, CudaDeviceVariable<float> pKernel, NppiSize nKernelSize, NppiPoint oAnchor, NppiBorderType eBorderType)
		{
			status = NPPNativeMethods.NPPi.FilterBorder32f.nppiFilterBorder32f_32s_AC4R(_devPtr, _pitch, _sizeOriginal, _pointRoi, dest.DevicePointerRoi, dest.Pitch, dest.SizeRoi, pKernel.DevicePointer, nKernelSize, oAnchor, eBorderType);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterBorder32f_32s_AC4R", status));
			NPPException.CheckNppStatus(status, this);
		}
Ejemplo n.º 32
0
 public static extern NppStatus nppiDilate3x3Border_8u_AC4R(
     IntPtr pSrc,
     int nSrcStep,
     NppiSize oSrcSize,
     NppiPoint oSrcOffset,
     IntPtr pDst,
     int nDstStep,
     NppiSize oSizeROI,
     NppiBorderType eBorderType);