Class NPPImage_32sC3
Implements
Inherited Members
Namespace: ManagedCuda.NPP
Assembly: NPP.dll
Syntax
public class NPPImage_32sC3 : NPPImageBase, IDisposable
Constructors
| Improve this Doc View SourceNPPImage_32sC3(CUdeviceptr, NppiSize, Int32)
Creates a new NPPImage from allocated device ptr.
Declaration
public NPPImage_32sC3(CUdeviceptr devPtr, NppiSize size, int pitch)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr | devPtr | Already allocated device ptr. |
NppiSize | size | Image size |
System.Int32 | pitch | Pitch / Line step |
NPPImage_32sC3(CUdeviceptr, NppiSize, Int32, Boolean)
Creates a new NPPImage from allocated device ptr.
Declaration
public NPPImage_32sC3(CUdeviceptr devPtr, NppiSize size, int pitch, bool isOwner)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr | devPtr | Already allocated device ptr. |
NppiSize | size | Image size |
System.Int32 | pitch | Pitch / Line step |
System.Boolean | isOwner | If TRUE, devPtr is freed when disposing |
NPPImage_32sC3(CUdeviceptr, Int32, Int32, Int32)
Creates a new NPPImage from allocated device ptr. Does not take ownership of decPtr.
Declaration
public NPPImage_32sC3(CUdeviceptr devPtr, int width, int height, int pitch)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr | devPtr | Already allocated device ptr. |
System.Int32 | width | Image width in pixels |
System.Int32 | height | Image height in pixels |
System.Int32 | pitch | Pitch / Line step |
NPPImage_32sC3(CUdeviceptr, Int32, Int32, Int32, Boolean)
Creates a new NPPImage from allocated device ptr.
Declaration
public NPPImage_32sC3(CUdeviceptr devPtr, int width, int height, int pitch, bool isOwner)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr | devPtr | Already allocated device ptr. |
System.Int32 | width | Image width in pixels |
System.Int32 | height | Image height in pixels |
System.Int32 | pitch | Pitch / Line step |
System.Boolean | isOwner | If TRUE, devPtr is freed when disposing |
NPPImage_32sC3(NPPImageBase)
Creates a new NPPImage from allocated device ptr. Does not take ownership of inner image device pointer.
Declaration
public NPPImage_32sC3(NPPImageBase image)
Parameters
Type | Name | Description |
---|---|---|
NPPImageBase | image | NPP image |
NPPImage_32sC3(NppiSize)
Allocates new memory on device using NPP-Api.
Declaration
public NPPImage_32sC3(NppiSize size)
Parameters
Type | Name | Description |
---|---|---|
NppiSize | size | Image size |
NPPImage_32sC3(Int32, Int32)
Allocates new memory on device using NPP-Api.
Declaration
public NPPImage_32sC3(int nWidthPixels, int nHeightPixels)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nWidthPixels | Image width in pixels |
System.Int32 | nHeightPixels | Image height in pixels |
Methods
| Improve this Doc View SourceAdd(NPPImage_32sC3, NPPImage_32sC3, Int32)
Image addition, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Add(NPPImage_32sC3 src2, NPPImage_32sC3 dest, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | src2 | 2nd source image |
NPPImage_32sC3 | dest | Destination image |
System.Int32 | nScaleFactor | scaling factor |
Add(NPPImage_32sC3, Int32)
In place image addition, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Add(NPPImage_32sC3 src2, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | src2 | 2nd source image |
System.Int32 | nScaleFactor | scaling factor |
Add(Int32[], NPPImage_32sC3, Int32)
Add constant to image, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Add(int[] nConstant, NPPImage_32sC3 dest, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | nConstant | Values to add |
NPPImage_32sC3 | dest | Destination image |
System.Int32 | nScaleFactor | scaling factor |
Add(Int32[], Int32)
Add constant to image, scale by 2^(-nScaleFactor), then clamp to saturated value. Inplace.
Declaration
public void Add(int[] nConstant, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | nConstant | Values to add |
System.Int32 | nScaleFactor | scaling factor |
And(NPPImage_32sC3)
In place image logical and.
Declaration
public void And(NPPImage_32sC3 src2)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | src2 | 2nd source image |
And(NPPImage_32sC3, NPPImage_32sC3)
Image logical and.
Declaration
public void And(NPPImage_32sC3 src2, NPPImage_32sC3 dest)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | src2 | 2nd source image |
NPPImage_32sC3 | dest | Destination image |
And(Int32[])
In place image logical and with constant.
Declaration
public void And(int[] nConstant)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | nConstant | Value (Array length = 3) |
And(Int32[], NPPImage_32sC3)
Image logical and with constant.
Declaration
public void And(int[] nConstant, NPPImage_32sC3 dest)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | nConstant | Value (Array length = 3) |
NPPImage_32sC3 | dest | Destination image |
AverageError(NPPImage_32sC4, CudaDeviceVariable<Double>)
image average error. User buffer is internally allocated and freed.
Declaration
public void AverageError(NPPImage_32sC4 src2, CudaDeviceVariable<double> pError)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC4 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pError | Pointer to the computed error. |
AverageError(NPPImage_32sC4, CudaDeviceVariable<Double>, CudaDeviceVariable<Byte>)
image average error.
Declaration
public void AverageError(NPPImage_32sC4 src2, CudaDeviceVariable<double> pError, CudaDeviceVariable<byte> buffer)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC4 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pError | Pointer to the computed error. |
CudaDeviceVariable<System.Byte> | buffer | Pointer to the user-allocated scratch buffer required for the AverageError operation. |
AverageErrorGetBufferHostSize()
Device scratch buffer size (in bytes) for AverageError.
Declaration
public int AverageErrorGetBufferHostSize()
Returns
Type | Description |
---|---|
System.Int32 |
AverageRelativeError(NPPImage_32sC4, CudaDeviceVariable<Double>)
image average relative error. User buffer is internally allocated and freed.
Declaration
public void AverageRelativeError(NPPImage_32sC4 src2, CudaDeviceVariable<double> pError)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC4 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pError | Pointer to the computed error. |
AverageRelativeError(NPPImage_32sC4, CudaDeviceVariable<Double>, CudaDeviceVariable<Byte>)
image average relative error.
Declaration
public void AverageRelativeError(NPPImage_32sC4 src2, CudaDeviceVariable<double> pError, CudaDeviceVariable<byte> buffer)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC4 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pError | Pointer to the computed error. |
CudaDeviceVariable<System.Byte> | buffer | Pointer to the user-allocated scratch buffer required for the AverageRelativeError operation. |
AverageRelativeErrorGetBufferHostSize()
Device scratch buffer size (in bytes) for AverageRelativeError.
Declaration
public int AverageRelativeErrorGetBufferHostSize()
Returns
Type | Description |
---|---|
System.Int32 |
Convert(NPPImage_8sC3)
32-bit signed to 8-bit signed conversion.
Declaration
public void Convert(NPPImage_8sC3 dst)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_8sC3 | dst | Destination image |
Convert(NPPImage_8uC3)
32-bit signed to 8-bit unsigned conversion.
Declaration
public void Convert(NPPImage_8uC3 dst)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_8uC3 | dst | Destination image |
Copy(NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1)
Three-channel 8-bit unsigned packed to planar image copy.
Declaration
public void Copy(NPPImage_32sC1 dst0, NPPImage_32sC1 dst1, NPPImage_32sC1 dst2)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | dst0 | Destination image channel 0 |
NPPImage_32sC1 | dst1 | Destination image channel 1 |
NPPImage_32sC1 | dst2 | Destination image channel 2 |
Copy(NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC3)
Three-channel 8-bit unsigned planar to packed image copy.
Declaration
public static void Copy(NPPImage_32sC1 src0, NPPImage_32sC1 src1, NPPImage_32sC1 src2, NPPImage_32sC3 dest)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src0 | Source image channel 0 |
NPPImage_32sC1 | src1 | Source image channel 1 |
NPPImage_32sC1 | src2 | Source image channel 2 |
NPPImage_32sC3 | dest | Destination image |
Copy(NPPImage_32sC1, Int32)
Image copy.
Declaration
public void Copy(NPPImage_32sC1 dst, int channel)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | dst | Destination image |
System.Int32 | channel | Channel number. This number is added to the dst pointer |
Copy(NPPImage_32sC3)
image copy.
Declaration
public void Copy(NPPImage_32sC3 dst)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | dst | Destination image |
Copy(NPPImage_32sC3, NPPImage_8uC1)
Masked Operation 8-bit unsigned image copy.
Declaration
public void Copy(NPPImage_32sC3 dst, NPPImage_8uC1 mask)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | dst | Destination image |
NPPImage_8uC1 | mask | Mask image |
Copy(NPPImage_32sC3, Int32, Int32)
Image copy.
Declaration
public void Copy(NPPImage_32sC3 dst, int channelSrc, int channelDst)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | dst | Destination image |
System.Int32 | channelSrc | Channel number. This number is added to the src pointer |
System.Int32 | channelDst | Channel number. This number is added to the dst pointer |
Copy(NPPImage_32sC3, Int32, Int32, Int32[])
Copy image and pad borders with a constant, user-specifiable color.
Declaration
public void Copy(NPPImage_32sC3 dst, int nTopBorderHeight, int nLeftBorderWidth, int[] nValue)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | dst | Destination image. The image ROI defines the destination region, i.e. the region that gets filled with data from the source image (inner part) and constant border color (outer part). |
System.Int32 | nTopBorderHeight | Height (in pixels) of the top border. The height of the border at the bottom of the destination ROI is implicitly defined by the size of the source ROI: nBottomBorderHeight = oDstSizeROI.height - nTopBorderHeight - oSrcSizeROI.height. |
System.Int32 | nLeftBorderWidth | Width (in pixels) of the left border. The width of the border at the right side of the destination ROI is implicitly defined by the size of the source ROI: nRightBorderWidth = oDstSizeROI.width - nLeftBorderWidth - oSrcSizeROI.width. |
System.Int32[] | nValue | The pixel value to be set for border pixels. |
CopyReplicateBorder(NPPImage_32sC3, Int32, Int32)
image copy with nearest source image pixel color.
Declaration
public void CopyReplicateBorder(NPPImage_32sC3 dst, int nTopBorderHeight, int nLeftBorderWidth)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | dst | Destination-Image |
System.Int32 | nTopBorderHeight | Height (in pixels) of the top border. The height of the border at the bottom of the destination ROI is implicitly defined by the size of the source ROI: nBottomBorderHeight = oDstSizeROI.height - nTopBorderHeight - oSrcSizeROI.height. |
System.Int32 | nLeftBorderWidth | Width (in pixels) of the left border. The width of the border at the right side of the destination ROI is implicitly defined by the size of the source ROI: nRightBorderWidth = oDstSizeROI.width - nLeftBorderWidth - oSrcSizeROI.width. |
CopySubpix(NPPImage_32sC3, Single, Single)
linearly interpolated source image subpixel coordinate color copy.
Declaration
public void CopySubpix(NPPImage_32sC3 dst, float nDx, float nDy)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | dst | Destination-Image |
System.Single | nDx | Fractional part of source image X coordinate. |
System.Single | nDy | Fractional part of source image Y coordinate. |
CopyWrapBorder(NPPImage_32sC3, Int32, Int32)
image copy with the borders wrapped by replication of source image pixel colors.
Declaration
public void CopyWrapBorder(NPPImage_32sC3 dst, int nTopBorderHeight, int nLeftBorderWidth)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | dst | Destination-Image |
System.Int32 | nTopBorderHeight | Height (in pixels) of the top border. The height of the border at the bottom of the destination ROI is implicitly defined by the size of the source ROI: nBottomBorderHeight = oDstSizeROI.height - nTopBorderHeight - oSrcSizeROI.height. |
System.Int32 | nLeftBorderWidth | Width (in pixels) of the left border. The width of the border at the right side of the destination ROI is implicitly defined by the size of the source ROI: nRightBorderWidth = oDstSizeROI.width - nLeftBorderWidth - oSrcSizeROI.width. |
Div(NPPImage_32sC3, NPPImage_32sC3, Int32)
Image division, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Div(NPPImage_32sC3 src2, NPPImage_32sC3 dest, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | src2 | 2nd source image |
NPPImage_32sC3 | dest | Destination image |
System.Int32 | nScaleFactor | scaling factor |
Div(NPPImage_32sC3, Int32)
In place image division, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Div(NPPImage_32sC3 src2, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | src2 | 2nd source image |
System.Int32 | nScaleFactor | scaling factor |
Div(Int32[], NPPImage_32sC3, Int32)
Divide constant to image, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Div(int[] nConstant, NPPImage_32sC3 dest, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | nConstant | Value |
NPPImage_32sC3 | dest | Destination image |
System.Int32 | nScaleFactor | scaling factor |
Div(Int32[], Int32)
Divide constant to image, scale by 2^(-nScaleFactor), then clamp to saturated value. Inplace.
Declaration
public void Div(int[] nConstant, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | nConstant | Value |
System.Int32 | nScaleFactor | scaling factor |
DotProdGetBufferHostSize()
Device scratch buffer size (in bytes) for nppiDotProd_32s64f_C3R.
Declaration
public int DotProdGetBufferHostSize()
Returns
Type | Description |
---|---|
System.Int32 |
DotProduct(NPPImage_32sC3, CudaDeviceVariable<Double>)
Three-channel 32-bit signed image DotProd. Buffer is internally allocated and freed.
Declaration
public void DotProduct(NPPImage_32sC3 src2, CudaDeviceVariable<double> pDp)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pDp | Pointer to the computed dot product of the two images. (3 * sizeof(double)) |
DotProduct(NPPImage_32sC3, CudaDeviceVariable<Double>, CudaDeviceVariable<Byte>)
Three-channel 32-bit signed image DotProd.
Declaration
public void DotProduct(NPPImage_32sC3 src2, CudaDeviceVariable<double> pDp, CudaDeviceVariable<byte> buffer)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pDp | Pointer to the computed dot product of the two images. (3 * sizeof(double)) |
CudaDeviceVariable<System.Byte> | buffer | Allocated device memory with size of at DotProdGetBufferHostSize() |
Filter(NPPImage_32sC3, CudaDeviceVariable<Single>, NppiSize, NppiPoint)
convolution filter.
Declaration
public void Filter(NPPImage_32sC3 dst, CudaDeviceVariable<float> pKernel, NppiSize oKernelSize, NppiPoint oAnchor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | dst | Destination-Image |
CudaDeviceVariable<System.Single> | pKernel | Pointer to the start address of the kernel coefficient array. Coefficients are expected to be stored in reverse order. |
NppiSize | oKernelSize | Width and Height of the rectangular kernel. |
NppiPoint | oAnchor | X and Y offsets of the kernel origin frame of reference |
FilterBorder(NPPImage_32sC3, CudaDeviceVariable<Single>, NppiSize, NppiPoint, NppiBorderType)
Three channel 32-bit signed convolution filter with border control.
General purpose 2D convolution filter using floating-point weights with border control.
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.
Declaration
public void FilterBorder(NPPImage_32sC3 dest, CudaDeviceVariable<float> pKernel, NppiSize nKernelSize, NppiPoint oAnchor, NppiBorderType eBorderType)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | dest | Destination image |
CudaDeviceVariable<System.Single> | pKernel | Pointer to the start address of the kernel coefficient array. Coeffcients are expected to be stored in reverse order |
NppiSize | nKernelSize | Width and Height of the rectangular kernel. |
NppiPoint | oAnchor | X and Y offsets of the kernel origin frame of reference relative to the source pixel. |
NppiBorderType | eBorderType | The border type operation to be applied at source image border boundaries. |
Finalize()
For dispose
Declaration
protected void Finalize()
GetAffineBound(Double[,])
Calculates bounding box of the affine transform projection of the given source rectangular ROI
Declaration
public double[, ] GetAffineBound(double[, ] coeffs)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | coeffs | Affine transform coefficients [2,3] |
Returns
Type | Description |
---|---|
System.Double[,] | Destination quadrangle [2,2] |
GetAffineQuad(Double[,])
Calculates affine transform projection of given source rectangular ROI
Declaration
public double[, ] GetAffineQuad(double[, ] coeffs)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | coeffs | Affine transform coefficients [2,3] |
Returns
Type | Description |
---|---|
System.Double[,] | Destination quadrangle [4,2] |
GetAffineTransform(Double[,])
Calculates affine transform coefficients given source rectangular ROI and its destination quadrangle projection
Declaration
public double[, ] GetAffineTransform(double[, ] quad)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | quad | Destination quadrangle [4,2] |
Returns
Type | Description |
---|---|
System.Double[,] | Affine transform coefficients [2,3] |
GetPerspectiveBound(Double[,])
Calculates bounding box of the affine transform projection of the given source rectangular ROI
Declaration
public double[, ] GetPerspectiveBound(double[, ] coeffs)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | coeffs | Perspective transform coefficients [3,3] |
Returns
Type | Description |
---|---|
System.Double[,] | Destination quadrangle [2,2] |
GetPerspectiveQuad(Double[,])
Calculates perspective transform projection of given source rectangular ROI
Declaration
public double[, ] GetPerspectiveQuad(double[, ] coeffs)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | coeffs | Perspective transform coefficients [3,3] |
Returns
Type | Description |
---|---|
System.Double[,] | Destination quadrangle [4,2] |
GetPerspectiveTransform(Double[,])
Calculates affine transform coefficients given source rectangular ROI and its destination quadrangle projection
Declaration
public double[, ] GetPerspectiveTransform(double[, ] quad)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | quad | Destination quadrangle [4,2] |
Returns
Type | Description |
---|---|
System.Double[,] | Perspective transform coefficients [3,3] |
LShiftC(UInt32[])
image bit shift by constant (left), inplace.
Declaration
public void LShiftC(uint[] nConstant)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32[] | nConstant | Constant (Array length = 3) |
LShiftC(UInt32[], NPPImage_32sC3)
image bit shift by constant (left).
Declaration
public void LShiftC(uint[] nConstant, NPPImage_32sC3 dest)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32[] | nConstant | Constant (Array length = 3) |
NPPImage_32sC3 | dest | Destination image |
MaxError(NPPImage_32sC4, CudaDeviceVariable<Double>)
image maximum error. User buffer is internally allocated and freed.
Declaration
public void MaxError(NPPImage_32sC4 src2, CudaDeviceVariable<double> pError)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC4 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pError | Pointer to the computed error. |
MaxError(NPPImage_32sC4, CudaDeviceVariable<Double>, CudaDeviceVariable<Byte>)
image maximum error.
Declaration
public void MaxError(NPPImage_32sC4 src2, CudaDeviceVariable<double> pError, CudaDeviceVariable<byte> buffer)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC4 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pError | Pointer to the computed error. |
CudaDeviceVariable<System.Byte> | buffer | Pointer to the user-allocated scratch buffer required for the MaxError operation. |
MaxErrorGetBufferHostSize()
Device scratch buffer size (in bytes) for MaxError.
Declaration
public int MaxErrorGetBufferHostSize()
Returns
Type | Description |
---|---|
System.Int32 |
MaximumRelativeError(NPPImage_32sC4, CudaDeviceVariable<Double>)
image maximum relative error. User buffer is internally allocated and freed.
Declaration
public void MaximumRelativeError(NPPImage_32sC4 src2, CudaDeviceVariable<double> pError)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC4 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pError | Pointer to the computed error. |
MaximumRelativeError(NPPImage_32sC4, CudaDeviceVariable<Double>, CudaDeviceVariable<Byte>)
image maximum relative error.
Declaration
public void MaximumRelativeError(NPPImage_32sC4 src2, CudaDeviceVariable<double> pError, CudaDeviceVariable<byte> buffer)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC4 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pError | Pointer to the computed error. |
CudaDeviceVariable<System.Byte> | buffer | Pointer to the user-allocated scratch buffer required for the MaximumRelativeError operation. |
MaximumRelativeErrorGetBufferHostSize()
Device scratch buffer size (in bytes) for MaximumRelativeError.
Declaration
public int MaximumRelativeErrorGetBufferHostSize()
Returns
Type | Description |
---|---|
System.Int32 |
Mirror(NppiAxis)
Mirror image inplace.
Declaration
public void Mirror(NppiAxis flip)
Parameters
Type | Name | Description |
---|---|---|
NppiAxis | flip | Specifies the axis about which the image is to be mirrored. |
Mirror(NPPImage_32sC3, NppiAxis)
Mirror image.
Declaration
public void Mirror(NPPImage_32sC3 dest, NppiAxis flip)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | dest | Destination image |
NppiAxis | flip | Specifies the axis about which the image is to be mirrored. |
Mul(NPPImage_32sC3, NPPImage_32sC3, Int32)
Image multiplication, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Mul(NPPImage_32sC3 src2, NPPImage_32sC3 dest, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | src2 | 2nd source image |
NPPImage_32sC3 | dest | Destination image |
System.Int32 | nScaleFactor | scaling factor |
Mul(NPPImage_32sC3, Int32)
In place image multiplication, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Mul(NPPImage_32sC3 src2, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | src2 | 2nd source image |
System.Int32 | nScaleFactor | scaling factor |
Mul(Int32[], NPPImage_32sC3, Int32)
Multiply constant to image, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Mul(int[] nConstant, NPPImage_32sC3 dest, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | nConstant | Value |
NPPImage_32sC3 | dest | Destination image |
System.Int32 | nScaleFactor | scaling factor |
Mul(Int32[], Int32)
Multiply constant to image, scale by 2^(-nScaleFactor), then clamp to saturated value. Inplace.
Declaration
public void Mul(int[] nConstant, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | nConstant | Value |
System.Int32 | nScaleFactor | scaling factor |
Or(NPPImage_32sC3)
In place image logical Or.
Declaration
public void Or(NPPImage_32sC3 src2)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | src2 | 2nd source image |
Or(NPPImage_32sC3, NPPImage_32sC3)
Image logical Or.
Declaration
public void Or(NPPImage_32sC3 src2, NPPImage_32sC3 dest)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | src2 | 2nd source image |
NPPImage_32sC3 | dest | Destination image |
Or(Int32[])
In place image logical Or with constant.
Declaration
public void Or(int[] nConstant)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | nConstant | Value (Array length = 3) |
Or(Int32[], NPPImage_32sC3)
Image logical Or with constant.
Declaration
public void Or(int[] nConstant, NPPImage_32sC3 dest)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | nConstant | Value (Array length = 3) |
NPPImage_32sC3 | dest | Destination image |
RShiftC(UInt32[])
image bit shift by constant (right), inplace.
Declaration
public void RShiftC(uint[] nConstant)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32[] | nConstant | Constant (Array length = 3) |
RShiftC(UInt32[], NPPImage_32sC3)
image bit shift by constant (right).
Declaration
public void RShiftC(uint[] nConstant, NPPImage_32sC3 dest)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32[] | nConstant | Constant (Array length = 3) |
NPPImage_32sC3 | dest | Destination image |
Scale(NPPImage_8uC3, NppHintAlgorithm)
image conversion.
Declaration
public void Scale(NPPImage_8uC3 dst, NppHintAlgorithm hint)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_8uC3 | dst | Destination-Image |
NppHintAlgorithm | hint | algorithm performance or accuracy selector, currently ignored |
Set(Int32, Int32)
Set pixel values to nValue.
The 8-bit mask image affects setting of the respective pixels in the destination image.
If the mask value is zero (0) the pixel is not set, if the mask is non-zero, the corresponding destination pixel is set to specified value.
Declaration
public void Set(int nValue, int channel)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nValue | Value to be set |
System.Int32 | channel | Channel number. This number is added to the dst pointer |
Set(Int32[])
Set pixel values to nValue.
Declaration
public void Set(int[] nValue)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | nValue | Value to be set (Array size = 3) |
Set(Int32[], NPPImage_8uC1)
Set pixel values to nValue.
The 8-bit mask image affects setting of the respective pixels in the destination image.
If the mask value is zero (0) the pixel is not set, if the mask is non-zero, the corresponding destination pixel is set to specified value.
Declaration
public void Set(int[] nValue, NPPImage_8uC1 mask)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | nValue | Value to be set (Array size = 3) |
NPPImage_8uC1 | mask | Mask image |
Sub(NPPImage_32sC3, NPPImage_32sC3, Int32)
Image subtraction, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Sub(NPPImage_32sC3 src2, NPPImage_32sC3 dest, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | src2 | 2nd source image |
NPPImage_32sC3 | dest | Destination image |
System.Int32 | nScaleFactor | scaling factor |
Sub(NPPImage_32sC3, Int32)
In place image subtraction, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Sub(NPPImage_32sC3 src2, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | src2 | 2nd source image |
System.Int32 | nScaleFactor | scaling factor |
Sub(Int32[], NPPImage_32sC3, Int32)
Subtract constant to image, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Sub(int[] nConstant, NPPImage_32sC3 dest, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | nConstant | Value to subtract |
NPPImage_32sC3 | dest | Destination image |
System.Int32 | nScaleFactor | scaling factor |
Sub(Int32[], Int32)
Subtract constant to image, scale by 2^(-nScaleFactor), then clamp to saturated value. Inplace.
Declaration
public void Sub(int[] nConstant, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | nConstant | Value to subtract |
System.Int32 | nScaleFactor | scaling factor |
SwapChannels(NPPImage_32sC3, Int32[])
Swap color channels
Declaration
public void SwapChannels(NPPImage_32sC3 dest, int[] aDstOrder)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | dest | Destination image |
System.Int32[] | aDstOrder | Integer array describing how channel values are permutated. The n-th entry of the array contains the number of the channel that is stored in the n-th channel of the output image. E.g. Given an RGB image, aDstOrder = [2,1,0] converts this to BGR channel order. |
SwapChannels(NPPImage_32sC4, Int32[], Int32)
Swap color channels
Declaration
public void SwapChannels(NPPImage_32sC4 dest, int[] aDstOrder, int nValue)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC4 | dest | Destination image |
System.Int32[] | aDstOrder | Integer array describing how channel values are permutated. The n-th entry of the array contains the number of the channel that is stored in the n-th channel of the output image. E.g. Given an RGB image, aDstOrder = [3,2,1,0] converts this to VBGR channel order. |
System.Int32 | nValue | (V) Single channel constant value that can be replicated in one or more of the 4 destination channels. nValue is either written or not written to a particular channel depending on the aDstOrder entry for that destination channel. An aDstOrder value of 3 will output nValue to that channel, an aDstOrder value greater than 3 will leave that particular destination channel value unmodified. |
SwapChannels(Int32[])
Swap color channels inplace
Declaration
public void SwapChannels(int[] aDstOrder)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | aDstOrder | Integer array describing how channel values are permutated. The n-th entry of the array contains the number of the channel that is stored in the n-th channel of the output image. E.g. Given an RGB image, aDstOrder = [2,1,0] converts this to BGR channel order. |
ToCudaPitchedDeviceVariable()
Converts a NPPImage to a CudaPitchedDeviceVariable
Declaration
public CudaPitchedDeviceVariable<int3> ToCudaPitchedDeviceVariable()
Returns
Type | Description |
---|---|
CudaPitchedDeviceVariable<int3> |
Transpose(NPPImage_32sC3)
image transpose
Declaration
public void Transpose(NPPImage_32sC3 dest)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | dest | Destination image |
WarpAffine(NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, Double[,], InterpolationMode)
Affine transform of an image.
This function operates using given transform coefficients that can be obtained by using nppiGetAffineTransform function or set explicitly. The function operates on source and destination regions of interest. The affine warp function transforms the source image pixel coordinates (x,y) according to the following formulas:
X_new = C_00 * x + C_01 * y + C_02
Y_new = C_10 * x + C_11 * y + C_12
The transformed part of the source image is resampled using the specified interpolation method and written to the destination ROI. The functions nppiGetAffineQuad and nppiGetAffineBound can help with destination ROI specification.
NPPI specific recommendation:
The function operates using 2 types of kernels: fast and accurate. The fast method is about 4 times faster than its accurate variant, but does not perform memory access checks and requires the destination ROI to be 64 bytes aligned. Hence any destination ROI is chunked into 3 vertical stripes: the first and the third are processed by accurate kernels and the central one is processed by the fast one.
In order to get the maximum available speed of execution, the projection of destination ROI onto image addresses must be 64 bytes aligned. This is always true if the values
(int)((void *)(pDst + dstRoi.x))
and
(int)((void *)(pDst + dstRoi.x + dstRoi.width))
are multiples of 64. Another rule of thumb is to specify destination ROI in such way that left and right sides of the projected image are separated from the ROI by at least 63 bytes from each side. However, this requires the whole ROI to be part of allocated memory. In case when the conditions above are not satisfied, the function may decrease in speed slightly and will return NPP_MISALIGNED_DST_ROI_WARNING warning.
Declaration
public static void WarpAffine(NPPImage_32sC1 src0, NPPImage_32sC1 src1, NPPImage_32sC1 src2, NPPImage_32sC1 dest0, NPPImage_32sC1 dest1, NPPImage_32sC1 dest2, double[, ] coeffs, InterpolationMode eInterpolation)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src0 | Source image (Channel 0) |
NPPImage_32sC1 | src1 | Source image (Channel 1) |
NPPImage_32sC1 | src2 | Source image (Channel 2) |
NPPImage_32sC1 | dest0 | Destination image (Channel 0) |
NPPImage_32sC1 | dest1 | Destination image (Channel 1) |
NPPImage_32sC1 | dest2 | Destination image (Channel 2) |
System.Double[,] | coeffs | Affine transform coefficients [2,3] |
InterpolationMode | eInterpolation | Interpolation mode: can be NearestNeighbor, Linear or Cubic |
WarpAffine(NPPImage_32sC3, Double[,], InterpolationMode)
Affine transform of an image.
This function operates using given transform coefficients that can be obtained by using nppiGetAffineTransform function or set explicitly. The function operates on source and destination regions of interest. The affine warp function transforms the source image pixel coordinates (x,y) according to the following formulas:
X_new = C_00 * x + C_01 * y + C_02
Y_new = C_10 * x + C_11 * y + C_12
The transformed part of the source image is resampled using the specified interpolation method and written to the destination ROI. The functions nppiGetAffineQuad and nppiGetAffineBound can help with destination ROI specification.
NPPI specific recommendation:
The function operates using 2 types of kernels: fast and accurate. The fast method is about 4 times faster than its accurate variant, but does not perform memory access checks and requires the destination ROI to be 64 bytes aligned. Hence any destination ROI is chunked into 3 vertical stripes: the first and the third are processed by accurate kernels and the central one is processed by the fast one.
In order to get the maximum available speed of execution, the projection of destination ROI onto image addresses must be 64 bytes aligned. This is always true if the values
(int)((void *)(pDst + dstRoi.x))
and
(int)((void *)(pDst + dstRoi.x + dstRoi.width))
are multiples of 64. Another rule of thumb is to specify destination ROI in such way that left and right sides of the projected image are separated from the ROI by at least 63 bytes from each side. However, this requires the whole ROI to be part of allocated memory. In case when the conditions above are not satisfied, the function may decrease in speed slightly and will return NPP_MISALIGNED_DST_ROI_WARNING warning.
Declaration
public void WarpAffine(NPPImage_32sC3 dest, double[, ] coeffs, InterpolationMode eInterpolation)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | dest | Destination image |
System.Double[,] | coeffs | Affine transform coefficients [2,3] |
InterpolationMode | eInterpolation | Interpolation mode: can be NearestNeighbor, Linear or Cubic |
WarpAffineBack(NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, Double[,], InterpolationMode)
Inverse affine transform of an image.
This function operates using given transform coefficients that can be obtained by using nppiGetAffineTransform function or set explicitly. Thus there is no need to invert coefficients in your application before calling WarpAffineBack. The function operates on source and destination regions of interest.
The affine warp function transforms the source image pixel coordinates (x,y) according to the following formulas:
X_new = C_00 * x + C_01 * y + C_02
Y_new = C_10 * x + C_11 * y + C_12
The transformed part of the source image is resampled using the specified interpolation method and written to the destination ROI. The functions nppiGetAffineQuad and nppiGetAffineBound can help with destination ROI specification.
NPPI specific recommendation:
The function operates using 2 types of kernels: fast and accurate. The fast method is about 4 times faster than its accurate variant, but doesn't perform memory access checks and requires the destination ROI to be 64 bytes aligned. Hence any destination ROI is chunked into 3 vertical stripes: the first and the third are processed by accurate kernels and the central one is processed by the fast one. In order to get the maximum available speed of execution, the projection of destination ROI onto image addresses must be 64 bytes aligned. This is always true if the values
(int)((void *)(pDst + dstRoi.x))
and
(int)((void *)(pDst + dstRoi.x + dstRoi.width))
are multiples of 64. Another rule of thumb is to specify destination ROI in such way that left and right sides of the projected image are separated from the ROI by at least 63 bytes from each side. However, this requires the whole ROI to be part of allocated memory. In case when the conditions above are not satisfied, the function may decrease in speed slightly and will return NPP_MISALIGNED_DST_ROI_WARNING warning.
Declaration
public static void WarpAffineBack(NPPImage_32sC1 src0, NPPImage_32sC1 src1, NPPImage_32sC1 src2, NPPImage_32sC1 dest0, NPPImage_32sC1 dest1, NPPImage_32sC1 dest2, double[, ] coeffs, InterpolationMode eInterpolation)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src0 | Source image (Channel 0) |
NPPImage_32sC1 | src1 | Source image (Channel 1) |
NPPImage_32sC1 | src2 | Source image (Channel 2) |
NPPImage_32sC1 | dest0 | Destination image (Channel 0) |
NPPImage_32sC1 | dest1 | Destination image (Channel 1) |
NPPImage_32sC1 | dest2 | Destination image (Channel 2) |
System.Double[,] | coeffs | Affine transform coefficients [2,3] |
InterpolationMode | eInterpolation | Interpolation mode: can be NearestNeighbor, Linear or Cubic |
WarpAffineBack(NPPImage_32sC3, Double[,], InterpolationMode)
Inverse affine transform of an image.
This function operates using given transform coefficients that can be obtained by using nppiGetAffineTransform function or set explicitly. Thus there is no need to invert coefficients in your application before calling WarpAffineBack. The function operates on source and destination regions of interest.
The affine warp function transforms the source image pixel coordinates (x,y) according to the following formulas:
X_new = C_00 * x + C_01 * y + C_02
Y_new = C_10 * x + C_11 * y + C_12
The transformed part of the source image is resampled using the specified interpolation method and written to the destination ROI. The functions nppiGetAffineQuad and nppiGetAffineBound can help with destination ROI specification.
NPPI specific recommendation:
The function operates using 2 types of kernels: fast and accurate. The fast method is about 4 times faster than its accurate variant, but doesn't perform memory access checks and requires the destination ROI to be 64 bytes aligned. Hence any destination ROI is chunked into 3 vertical stripes: the first and the third are processed by accurate kernels and the central one is processed by the fast one. In order to get the maximum available speed of execution, the projection of destination ROI onto image addresses must be 64 bytes aligned. This is always true if the values
(int)((void *)(pDst + dstRoi.x))
and
(int)((void *)(pDst + dstRoi.x + dstRoi.width))
are multiples of 64. Another rule of thumb is to specify destination ROI in such way that left and right sides of the projected image are separated from the ROI by at least 63 bytes from each side. However, this requires the whole ROI to be part of allocated memory. In case when the conditions above are not satisfied, the function may decrease in speed slightly and will return NPP_MISALIGNED_DST_ROI_WARNING warning.
Declaration
public void WarpAffineBack(NPPImage_32sC3 dest, double[, ] coeffs, InterpolationMode eInterpolation)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | dest | Destination image |
System.Double[,] | coeffs | Affine transform coefficients [2,3] |
InterpolationMode | eInterpolation | Interpolation mode: can be NearestNeighbor, Linear or Cubic |
WarpAffineQuad(NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, Double[,], NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, Double[,], InterpolationMode)
Affine transform of an image.
This function performs affine warping of a the specified quadrangle in the source image to the specified quadrangle in the destination image. The function nppiWarpAffineQuad uses the same formulas for pixel mapping as in nppiWarpAffine function. The transform coefficients are computed internally. The transformed part of the source image is resampled using the specified eInterpolation method and written to the destination ROI.
NPPI specific recommendation:
The function operates using 2 types of kernels: fast and accurate. The fast method is about 4 times faster than its accurate variant, but doesn't perform memory access checks and requires the destination ROI to be 64 bytes aligned. Hence any destination ROI is chunked into 3 vertical stripes: the first and the third are processed by accurate kernels and the central one is processed by the fast one. In order to get the maximum available speed of execution, the projection of destination ROI onto image addresses must be 64 bytes aligned. This is always true if the values
(int)((void *)(pDst + dstRoi.x))
and
(int)((void *)(pDst + dstRoi.x + dstRoi.width))
are multiples of 64. Another rule of thumb is to specify destination ROI in such way that left and right sides of the projected image are separated from the ROI by at least 63 bytes from each side. However, this requires the whole ROI to be part of allocated memory. In case when the conditions above are not satisfied, the function may decrease in speed slightly and will return NPP_MISALIGNED_DST_ROI_WARNING warning.
Declaration
public static void WarpAffineQuad(NPPImage_32sC1 src0, NPPImage_32sC1 src1, NPPImage_32sC1 src2, double[, ] srcQuad, NPPImage_32sC1 dest0, NPPImage_32sC1 dest1, NPPImage_32sC1 dest2, double[, ] dstQuad, InterpolationMode eInterpolation)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src0 | Source image (Channel 0) |
NPPImage_32sC1 | src1 | Source image (Channel 1) |
NPPImage_32sC1 | src2 | Source image (Channel 2) |
System.Double[,] | srcQuad | Source quadrangle [4,2] |
NPPImage_32sC1 | dest0 | Destination image (Channel 0) |
NPPImage_32sC1 | dest1 | Destination image (Channel 1) |
NPPImage_32sC1 | dest2 | Destination image (Channel 2) |
System.Double[,] | dstQuad | Destination quadrangle [4,2] |
InterpolationMode | eInterpolation | Interpolation mode: can be NearestNeighbor, Linear or Cubic |
WarpAffineQuad(Double[,], NPPImage_32sC3, Double[,], InterpolationMode)
Affine transform of an image.
This function performs affine warping of a the specified quadrangle in the source image to the specified quadrangle in the destination image. The function nppiWarpAffineQuad uses the same formulas for pixel mapping as in nppiWarpAffine function. The transform coefficients are computed internally. The transformed part of the source image is resampled using the specified eInterpolation method and written to the destination ROI.
NPPI specific recommendation:
The function operates using 2 types of kernels: fast and accurate. The fast method is about 4 times faster than its accurate variant, but doesn't perform memory access checks and requires the destination ROI to be 64 bytes aligned. Hence any destination ROI is chunked into 3 vertical stripes: the first and the third are processed by accurate kernels and the central one is processed by the fast one. In order to get the maximum available speed of execution, the projection of destination ROI onto image addresses must be 64 bytes aligned. This is always true if the values
(int)((void *)(pDst + dstRoi.x))
and
(int)((void *)(pDst + dstRoi.x + dstRoi.width))
are multiples of 64. Another rule of thumb is to specify destination ROI in such way that left and right sides of the projected image are separated from the ROI by at least 63 bytes from each side. However, this requires the whole ROI to be part of allocated memory. In case when the conditions above are not satisfied, the function may decrease in speed slightly and will return NPP_MISALIGNED_DST_ROI_WARNING warning.
Declaration
public void WarpAffineQuad(double[, ] srcQuad, NPPImage_32sC3 dest, double[, ] dstQuad, InterpolationMode eInterpolation)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | srcQuad | Source quadrangle [4,2] |
NPPImage_32sC3 | dest | Destination image |
System.Double[,] | dstQuad | Destination quadrangle [4,2] |
InterpolationMode | eInterpolation | Interpolation mode: can be NearestNeighbor, Linear or Cubic |
WarpPerspective(NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, Double[,], InterpolationMode)
Perspective transform of an image.
This function operates using given transform coefficients that can be obtained by using nppiGetPerspectiveTransform function or set explicitly. The function operates on source and destination regions of interest. The perspective warp function transforms the source image pixel coordinates (x,y) according to the following formulas:
X_new = (C_00 * x + C_01 * y + C_02) / (C_20 * x + C_21 * y + C_22)
Y_new = (C_10 * x + C_11 * y + C_12) / (C_20 * x + C_21 * y + C_22)
The transformed part of the source image is resampled using the specified interpolation method and written to the destination ROI. The functions nppiGetPerspectiveQuad and nppiGetPerspectiveBound can help with destination ROI specification.
NPPI specific recommendation:
The function operates using 2 types of kernels: fast and accurate. The fast method is about 4 times faster than its accurate variant, but doesn't perform memory access checks and requires the destination ROI to be 64 bytes aligned. Hence any destination ROI is chunked into 3 vertical stripes: the first and the third are processed by accurate kernels and the central one is processed by the fast one. In order to get the maximum available speed of execution, the projection of destination ROI onto image addresses must be 64 bytes aligned. This is always true if the values
(int)((void *)(pDst + dstRoi.x))
and
(int)((void *)(pDst + dstRoi.x + dstRoi.width))
are multiples of 64. Another rule of thumb is to specify destination ROI in such way that left and right sides of the projected image are separated from the ROI by at least 63 bytes from each side. However, this requires the whole ROI to be part of allocated memory. In case when the conditions above are not satisfied, the function may decrease in speed slightly and will return NPP_MISALIGNED_DST_ROI_WARNING warning.
Declaration
public static void WarpPerspective(NPPImage_32sC1 src0, NPPImage_32sC1 src1, NPPImage_32sC1 src2, NPPImage_32sC1 dest0, NPPImage_32sC1 dest1, NPPImage_32sC1 dest2, double[, ] coeffs, InterpolationMode eInterpolation)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src0 | Source image (Channel 0) |
NPPImage_32sC1 | src1 | Source image (Channel 1) |
NPPImage_32sC1 | src2 | Source image (Channel 2) |
NPPImage_32sC1 | dest0 | Destination image (Channel 0) |
NPPImage_32sC1 | dest1 | Destination image (Channel 1) |
NPPImage_32sC1 | dest2 | Destination image (Channel 2) |
System.Double[,] | coeffs | Perspective transform coefficients [3,3] |
InterpolationMode | eInterpolation | Interpolation mode: can be NearestNeighbor, Linear or Cubic |
WarpPerspective(NPPImage_32sC3, Double[,], InterpolationMode)
Perspective transform of an image.
This function operates using given transform coefficients that can be obtained by using nppiGetPerspectiveTransform function or set explicitly. The function operates on source and destination regions of interest. The perspective warp function transforms the source image pixel coordinates (x,y) according to the following formulas:
X_new = (C_00 * x + C_01 * y + C_02) / (C_20 * x + C_21 * y + C_22)
Y_new = (C_10 * x + C_11 * y + C_12) / (C_20 * x + C_21 * y + C_22)
The transformed part of the source image is resampled using the specified interpolation method and written to the destination ROI. The functions nppiGetPerspectiveQuad and nppiGetPerspectiveBound can help with destination ROI specification.
NPPI specific recommendation:
The function operates using 2 types of kernels: fast and accurate. The fast method is about 4 times faster than its accurate variant, but doesn't perform memory access checks and requires the destination ROI to be 64 bytes aligned. Hence any destination ROI is chunked into 3 vertical stripes: the first and the third are processed by accurate kernels and the central one is processed by the fast one. In order to get the maximum available speed of execution, the projection of destination ROI onto image addresses must be 64 bytes aligned. This is always true if the values
(int)((void *)(pDst + dstRoi.x))
and
(int)((void *)(pDst + dstRoi.x + dstRoi.width))
are multiples of 64. Another rule of thumb is to specify destination ROI in such way that left and right sides of the projected image are separated from the ROI by at least 63 bytes from each side. However, this requires the whole ROI to be part of allocated memory. In case when the conditions above are not satisfied, the function may decrease in speed slightly and will return NPP_MISALIGNED_DST_ROI_WARNING warning.
Declaration
public void WarpPerspective(NPPImage_32sC3 dest, double[, ] coeffs, InterpolationMode eInterpolation)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | dest | Destination image |
System.Double[,] | coeffs | Perspective transform coefficients [3,3] |
InterpolationMode | eInterpolation | Interpolation mode: can be NearestNeighbor, Linear or Cubic |
WarpPerspectiveBack(NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, Double[,], InterpolationMode)
Inverse perspective transform of an image.
This function operates using given transform coefficients that can be obtained by using nppiGetPerspectiveTransform function or set explicitly. Thus there is no need to invert coefficients in your application before calling WarpPerspectiveBack. The function operates on source and destination regions of interest. The perspective warp function transforms the source image pixel coordinates (x,y) according to the following formulas:
X_new = (C_00 * x + C_01 * y + C_02) / (C_20 * x + C_21 * y + C_22)
Y_new = (C_10 * x + C_11 * y + C_12) / (C_20 * x + C_21 * y + C_22)
The transformed part of the source image is resampled using the specified interpolation method and written to the destination ROI. The functions nppiGetPerspectiveQuad and nppiGetPerspectiveBound can help with destination ROI specification.
NPPI specific recommendation:
The function operates using 2 types of kernels: fast and accurate. The fast method is about 4 times faster than its accurate variant, but doesn't perform memory access checks and requires the destination ROI to be 64 bytes aligned. Hence any destination ROI is chunked into 3 vertical stripes: the first and the third are processed by accurate kernels and the central one is processed by the fast one. In order to get the maximum available speed of execution, the projection of destination ROI onto image addresses must be 64 bytes aligned. This is always true if the values
(int)((void *)(pDst + dstRoi.x))
and
(int)((void *)(pDst + dstRoi.x + dstRoi.width))
are multiples of 64. Another rule of thumb is to specify destination ROI in such way that left and right sides of the projected image are separated from the ROI by at least 63 bytes from each side. However, this requires the whole ROI to be part of allocated memory. In case when the conditions above are not satisfied, the function may decrease in speed slightly and will return NPP_MISALIGNED_DST_ROI_WARNING warning.
Declaration
public static void WarpPerspectiveBack(NPPImage_32sC1 src0, NPPImage_32sC1 src1, NPPImage_32sC1 src2, NPPImage_32sC1 dest0, NPPImage_32sC1 dest1, NPPImage_32sC1 dest2, double[, ] coeffs, InterpolationMode eInterpolation)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src0 | Source image (Channel 0) |
NPPImage_32sC1 | src1 | Source image (Channel 1) |
NPPImage_32sC1 | src2 | Source image (Channel 2) |
NPPImage_32sC1 | dest0 | Destination image (Channel 0) |
NPPImage_32sC1 | dest1 | Destination image (Channel 1) |
NPPImage_32sC1 | dest2 | Destination image (Channel 2) |
System.Double[,] | coeffs | Perspective transform coefficients [3,3] |
InterpolationMode | eInterpolation | Interpolation mode: can be NearestNeighbor, Linear or Cubic |
WarpPerspectiveBack(NPPImage_32sC3, Double[,], InterpolationMode)
Inverse perspective transform of an image.
This function operates using given transform coefficients that can be obtained by using nppiGetPerspectiveTransform function or set explicitly. Thus there is no need to invert coefficients in your application before calling WarpPerspectiveBack. The function operates on source and destination regions of interest. The perspective warp function transforms the source image pixel coordinates (x,y) according to the following formulas:
X_new = (C_00 * x + C_01 * y + C_02) / (C_20 * x + C_21 * y + C_22)
Y_new = (C_10 * x + C_11 * y + C_12) / (C_20 * x + C_21 * y + C_22)
The transformed part of the source image is resampled using the specified interpolation method and written to the destination ROI. The functions nppiGetPerspectiveQuad and nppiGetPerspectiveBound can help with destination ROI specification.
NPPI specific recommendation:
The function operates using 2 types of kernels: fast and accurate. The fast method is about 4 times faster than its accurate variant, but doesn't perform memory access checks and requires the destination ROI to be 64 bytes aligned. Hence any destination ROI is chunked into 3 vertical stripes: the first and the third are processed by accurate kernels and the central one is processed by the fast one. In order to get the maximum available speed of execution, the projection of destination ROI onto image addresses must be 64 bytes aligned. This is always true if the values
(int)((void *)(pDst + dstRoi.x))
and
(int)((void *)(pDst + dstRoi.x + dstRoi.width))
are multiples of 64. Another rule of thumb is to specify destination ROI in such way that left and right sides of the projected image are separated from the ROI by at least 63 bytes from each side. However, this requires the whole ROI to be part of allocated memory. In case when the conditions above are not satisfied, the function may decrease in speed slightly and will return NPP_MISALIGNED_DST_ROI_WARNING warning.
Declaration
public void WarpPerspectiveBack(NPPImage_32sC3 dest, double[, ] coeffs, InterpolationMode eInterpolation)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | dest | Destination image |
System.Double[,] | coeffs | Perspective transform coefficients [3,3] |
InterpolationMode | eInterpolation | Interpolation mode: can be NearestNeighbor, Linear or Cubic |
WarpPerspectiveQuad(NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, Double[,], NPPImage_32sC1, NPPImage_32sC1, NPPImage_32sC1, Double[,], InterpolationMode)
Perspective transform of an image.
This function performs perspective warping of a the specified quadrangle in the source image to the specified quadrangle in the destination image. The function nppiWarpPerspectiveQuad uses the same formulas for pixel mapping as in nppiWarpPerspective function. The transform coefficients are computed internally. The transformed part of the source image is resampled using the specified interpolation method and written to the destination ROI.
NPPI specific recommendation:
The function operates using 2 types of kernels: fast and accurate. The fast method is about 4 times faster than its accurate variant, but doesn't perform memory access checks and requires the destination ROI to be 64 bytes aligned. Hence any destination ROI is chunked into 3 vertical stripes: the first and the third are processed by accurate kernels and the central one is processed by the fast one. In order to get the maximum available speed of execution, the projection of destination ROI onto image addresses must be 64 bytes aligned. This is always true if the values
(int)((void *)(pDst + dstRoi.x))
and
(int)((void *)(pDst + dstRoi.x + dstRoi.width))
are multiples of 64. Another rule of thumb is to specify destination ROI in such way that left and right sides of the projected image are separated from the ROI by at least 63 bytes from each side. However, this requires the whole ROI to be part of allocated memory. In case when the conditions above are not satisfied, the function may decrease in speed slightly and will return NPP_MISALIGNED_DST_ROI_WARNING warning.
Declaration
public static void WarpPerspectiveQuad(NPPImage_32sC1 src0, NPPImage_32sC1 src1, NPPImage_32sC1 src2, double[, ] srcQuad, NPPImage_32sC1 dest0, NPPImage_32sC1 dest1, NPPImage_32sC1 dest2, double[, ] destQuad, InterpolationMode eInterpolation)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src0 | Source image (Channel 0) |
NPPImage_32sC1 | src1 | Source image (Channel 1) |
NPPImage_32sC1 | src2 | Source image (Channel 2) |
System.Double[,] | srcQuad | Source quadrangle [4,2] |
NPPImage_32sC1 | dest0 | Destination image (Channel 0) |
NPPImage_32sC1 | dest1 | Destination image (Channel 1) |
NPPImage_32sC1 | dest2 | Destination image (Channel 2) |
System.Double[,] | destQuad | Destination quadrangle [4,2] |
InterpolationMode | eInterpolation | Interpolation mode: can be NearestNeighbor, Linear or Cubic |
WarpPerspectiveQuad(Double[,], NPPImage_32sC3, Double[,], InterpolationMode)
Perspective transform of an image.
This function performs perspective warping of a the specified quadrangle in the source image to the specified quadrangle in the destination image. The function nppiWarpPerspectiveQuad uses the same formulas for pixel mapping as in nppiWarpPerspective function. The transform coefficients are computed internally. The transformed part of the source image is resampled using the specified interpolation method and written to the destination ROI.
NPPI specific recommendation:
The function operates using 2 types of kernels: fast and accurate. The fast method is about 4 times faster than its accurate variant, but doesn't perform memory access checks and requires the destination ROI to be 64 bytes aligned. Hence any destination ROI is chunked into 3 vertical stripes: the first and the third are processed by accurate kernels and the central one is processed by the fast one. In order to get the maximum available speed of execution, the projection of destination ROI onto image addresses must be 64 bytes aligned. This is always true if the values
(int)((void *)(pDst + dstRoi.x))
and
(int)((void *)(pDst + dstRoi.x + dstRoi.width))
are multiples of 64. Another rule of thumb is to specify destination ROI in such way that left and right sides of the projected image are separated from the ROI by at least 63 bytes from each side. However, this requires the whole ROI to be part of allocated memory. In case when the conditions above are not satisfied, the function may decrease in speed slightly and will return NPP_MISALIGNED_DST_ROI_WARNING warning.
Declaration
public void WarpPerspectiveQuad(double[, ] srcQuad, NPPImage_32sC3 dest, double[, ] destQuad, InterpolationMode eInterpolation)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | srcQuad | Source quadrangle [4,2] |
NPPImage_32sC3 | dest | Destination image |
System.Double[,] | destQuad | Destination quadrangle [4,2] |
InterpolationMode | eInterpolation | Interpolation mode: can be NearestNeighbor, Linear or Cubic |
Xor(NPPImage_32sC3)
In place image logical Xor.
Declaration
public void Xor(NPPImage_32sC3 src2)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | src2 | 2nd source image |
Xor(NPPImage_32sC3, NPPImage_32sC3)
Image logical Xor.
Declaration
public void Xor(NPPImage_32sC3 src2, NPPImage_32sC3 dest)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | src2 | 2nd source image |
NPPImage_32sC3 | dest | Destination image |
Xor(Int32[])
In place image logical Xor with constant.
Declaration
public void Xor(int[] nConstant)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | nConstant | Value (Array length = 3) |
Xor(Int32[], NPPImage_32sC3)
Image logical Xor with constant.
Declaration
public void Xor(int[] nConstant, NPPImage_32sC3 dest)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | nConstant | Value (Array length = 3) |
NPPImage_32sC3 | dest | Destination image |
Operators
| Improve this Doc View SourceImplicit(CudaPitchedDeviceVariable<int3> to NPPImage_32sC3)
Converts a CudaPitchedDeviceVariable to a NPPImage
Declaration
public static implicit operator NPPImage_32sC3(CudaPitchedDeviceVariable<int3> img)
Parameters
Type | Name | Description |
---|---|---|
CudaPitchedDeviceVariable<int3> | img | CudaPitchedDeviceVariable |
Returns
Type | Description |
---|---|
NPPImage_32sC3 | NPPImage with the same device pointer and size of CudaPitchedDeviceVariable with ROI set to full image |
Implicit(NPPImage_32sC3 to CudaPitchedDeviceVariable<int3>)
Converts a NPPImage to a CudaPitchedDeviceVariable
Declaration
public static implicit operator CudaPitchedDeviceVariable<int3>(NPPImage_32sC3 img)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | img | NPPImage |
Returns
Type | Description |
---|---|
CudaPitchedDeviceVariable<int3> | CudaPitchedDeviceVariable with the same device pointer and size of NPPImage without ROI information |