Library/ManagedCuda/NPP/NPPImage_16uC3.cs
/// <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>
Filters the image using a unsharp-mask sharpening filter kernel with border control.
The algorithm involves the following steps:
Smooth the original image with a Gaussian filter, with the width controlled by the nRadius.
Subtract the smoothed image from the original to create a high-pass filtered image.
Apply any clipping needed on the high-pass image, as controlled by the nThreshold.
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:
HighPass = Image - Gaussian(Image)
Result = Image + nWeight * HighPass * ( |HighPass| >= nThreshold )
where nWeight is the amount, nThreshold is the threshold, and >= indicates a Boolean operation, 1 if true, or 0 otherwise.

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.
Filters the image using a unsharp - mask sharpening filter kernel with border control . The algorithm involves the following steps : Smooth the original image with a Gaussian filter with the width controlled by the nRadius . Subtract the smoothed image from the original to create a high - pass filtered image . Apply any clipping needed on the high - pass image as controlled by the nThreshold . 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 : HighPass = Image - Gaussian ( Image ) Result = Image + nWeight * HighPass * ( |HighPass| > = nThreshold ) where nWeight is the amount nThreshold is the threshold and > = indicates a Boolean operation 1 if true or 0 otherwise . 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 .
public void FilterUnsharpBorder(NPPImage_16uC3 dst, float nRadius, float nSigma, float nWeight, float nThreshold, NppiBorderType eBorderType, CudaDeviceVariable<byte> buffer)
		{
			if (buffer.Size < FilterUnsharpGetBufferSize(nRadius, nSigma))
				throw new NPPException("Provided buffer is too small.");
			status = NPPNativeMethods.NPPi.FixedFilters.nppiFilterUnsharpBorder_16u_C3R(_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_16u_C3R", status));
			NPPException.CheckNppStatus(status, this);
		}
public void FilterUnsharpBorder ( NPPImage_16uC3 dst , float nRadius , float nSigma , float nWeight , float nThreshold , NppiBorderType eBorderType , CudaDeviceVariable < byte > buffer ) { if ( buffer . Size < FilterUnsharpGetBufferSize ( nRadius , nSigma ) ) throw new NPPException ( " " ) ; status = NPPNativeMethods . NPPi . FixedFilters . nppiFilterUnsharpBorder_16u_C3R ( _devPtr , _pitch , _pointRoi , dst . DevicePointerRoi , dst . Pitch , _sizeRoi , nRadius , nSigma , nWeight , nThreshold , eBorderType , buffer . DevicePointer ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , status ) ) ; NPPException . CheckNppStatus ( status , this ) ; }
Filters the image using a unsharp-mask sharpening filter kernel with border control.
Filters the image using a unsharp - mask sharpening filter kernel with border control .
dst
NPPImage_16uC3
None
nRadius
float
The radius of the Gaussian filter, in pixles, not counting the center pixel.
The radius of the Gaussian filter in pixles not counting the center pixel .
nSigma
float
The standard deviation of the Gaussian filter, in pixel.
The standard deviation of the Gaussian filter in pixel .
nWeight
float
The percentage of the difference between the original and the high pass image that is added back into the original.
The percentage of the difference between the original and the high pass image that is added back into the original .
nThreshold
float
The threshold needed to apply the difference amount.
The threshold needed to apply the difference amount .
eBorderType
NppiBorderType
The border type operation to be applied at source image border boundaries.
The border type operation to be applied at source image border boundaries .
buffer
CudaDeviceVariable<byte>
Pointer to the user-allocated device scratch buffer required for the unsharp operation.
Pointer to the user - allocated device scratch buffer required for the unsharp operation .