public static void warpAffine(Mat src, Mat dst, System.Numerics.Matrix3x2 trans, Size dSize, Interpolation inter = Interpolation.INTER_LINEAR, bool inverseMap = false, BorderMode borderMode = BorderMode.BORDER_CONSTANT, double[] borderValue = null) { Mat transMat = trans; int flags = inverseMap ? ((int)InverseMap.WARP_INVERSE_MAP | (int)inter) : (int)inter; Mat matBorderValue = null; IntPtr ptrBorderValue = IntPtr.Zero; if (borderMode == BorderMode.BORDER_CONSTANT && borderValue != null && borderValue.Length > 0) { matBorderValue = new Mat(1, borderValue.Length, Mat.makeType(1, Mat.MatDepth.CV_64F)); if (matBorderValue.Valid && matBorderValue.copyAll(borderValue, 0, borderValue.Length)) { ptrBorderValue = matBorderValue.Data; } } NativeInvoker.coreCvWarpAffine(src.MatObj, dst.MatObj, transMat.MatObj, (int)dSize.w, (int)dSize.h, flags, (int)borderMode, ptrBorderValue); }
public static void resize(Mat src, Mat dst, Size dSize, double fx = 0.0, double fy = 0.0, Interpolation inter = Interpolation.INTER_LINEAR) { NativeInvoker.coreCvResize(src.MatObj, dst.MatObj, (int)dSize.w, (int)dSize.h, fx, fy, (int)inter); }