OpenCvSharp.Cv2.WarpAffine C# (CSharp) Method

WarpAffine() public static method

Applies an affine transformation to an image.
public static WarpAffine ( InputArray src, OutputArray dst, InputArray m, Size dsize, InterpolationFlags flags = InterpolationFlags.Linear, BorderTypes borderMode = BorderTypes.Constant, Scalar borderValue = null ) : void
src InputArray input image.
dst OutputArray output image that has the size dsize and the same type as src.
m InputArray 2x3 transformation matrix.
dsize Size size of the output image.
flags InterpolationFlags combination of interpolation methods and the optional flag /// WARP_INVERSE_MAP that means that M is the inverse transformation (dst -> src) .
borderMode BorderTypes pixel extrapolation method; when borderMode=BORDER_TRANSPARENT, /// it means that the pixels in the destination image corresponding to the "outliers" /// in the source image are not modified by the function.
borderValue Scalar value used in case of a constant border; by default, it is 0.
return void
        public static void WarpAffine(
            InputArray src, OutputArray dst, InputArray m, Size dsize,
            InterpolationFlags flags = InterpolationFlags.Linear, 
            BorderTypes borderMode = BorderTypes.Constant, Scalar? borderValue = null)
        {
            if (src == null)
                throw new ArgumentNullException(nameof(src));
            if (dst == null)
                throw new ArgumentNullException(nameof(dst));
            if (m == null)
                throw new ArgumentNullException(nameof(m));
            src.ThrowIfDisposed();
            dst.ThrowIfDisposed();
            m.ThrowIfDisposed();
            Scalar borderValue0 = borderValue.GetValueOrDefault(Scalar.All(0));
            NativeMethods.imgproc_warpAffine(src.CvPtr, dst.CvPtr, m.CvPtr, dsize, (int)flags, (int)borderMode, borderValue0);
            GC.KeepAlive(src);
            dst.Fix();
        }
        #endregion
Cv2