Ejemplo n.º 1
0
        /// <summary>
        /// image average relative error.
        /// </summary>
        /// <param name="src2">2nd source image</param>
        /// <param name="pError">Pointer to the computed error.</param>
        /// <param name="buffer">Pointer to the user-allocated scratch buffer required for the AverageRelativeError operation.</param>
        /// <param name="nppStreamCtx">NPP stream context.</param>
        public void AverageRelativeError(NPPImage_16sC2 src2, CudaDeviceVariable <double> pError, CudaDeviceVariable <byte> buffer, NppStreamContext nppStreamCtx)
        {
            int bufferSize = AverageRelativeErrorGetBufferHostSize(nppStreamCtx);

            if (bufferSize > buffer.Size)
            {
                throw new NPPException("Provided buffer is too small.");
            }

            status = NPPNativeMethods_Ctx.NPPi.AverageRelativeError.nppiAverageRelativeError_16s_C2R_Ctx(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, _sizeRoi, pError.DevicePointer, buffer.DevicePointer, nppStreamCtx);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiAverageRelativeError_16s_C2R_Ctx", status));
            NPPException.CheckNppStatus(status, this);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// An input color twist matrix with floating-point pixel values is applied
 /// within ROI.
 /// </summary>
 /// <param name="dest">Destination image</param>
 /// <param name="twistMatrix">The color twist matrix with floating-point pixel values [3,4].</param>
 /// <param name="nppStreamCtx">NPP stream context.</param>
 public void ColorTwist(NPPImage_16sC2 dest, float[,] twistMatrix, NppStreamContext nppStreamCtx)
 {
     status = NPPNativeMethods_Ctx.NPPi.ColorProcessing.nppiColorTwist32f_16s_C2R_Ctx(_devPtrRoi, _pitch, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, twistMatrix, nppStreamCtx);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiColorTwist32f_16s_C2R_Ctx", status));
     NPPException.CheckNppStatus(status, this);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// image maximum relative error. User buffer is internally allocated and freed.
        /// </summary>
        /// <param name="src2">2nd source image</param>
        /// <param name="pError">Pointer to the computed error.</param>
        /// <param name="nppStreamCtx">NPP stream context.</param>
        public void MaximumRelativeError(NPPImage_16sC2 src2, CudaDeviceVariable <double> pError, NppStreamContext nppStreamCtx)
        {
            int bufferSize = MaximumRelativeErrorGetBufferHostSize(nppStreamCtx);
            CudaDeviceVariable <byte> buffer = new CudaDeviceVariable <byte>(bufferSize);

            status = NPPNativeMethods_Ctx.NPPi.MaximumRelativeError.nppiMaximumRelativeError_16s_C2R_Ctx(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, _sizeRoi, pError.DevicePointer, buffer.DevicePointer, nppStreamCtx);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiMaximumRelativeError_16s_C2R_Ctx", status));
            buffer.Dispose();
            NPPException.CheckNppStatus(status, this);
        }