OpenCvSharp.Cv2.Remap C# (CSharp) Method

Remap() public static method

Applies a generic geometrical transformation to an image.
public static Remap ( InputArray src, OutputArray dst, InputArray map1, InputArray map2, InterpolationFlags interpolation = InterpolationFlags.Linear, BorderTypes borderMode = BorderTypes.Constant, Scalar borderValue = null ) : void
src InputArray Source image.
dst OutputArray Destination image. It has the same size as map1 and the same type as src
map1 InputArray The first map of either (x,y) points or just x values having the type CV_16SC2, CV_32FC1, or CV_32FC2.
map2 InputArray The second map of y values having the type CV_16UC1, CV_32FC1, or none (empty map if map1 is (x,y) points), respectively.
interpolation InterpolationFlags Interpolation method. The method INTER_AREA is not supported by this function.
borderMode BorderTypes Pixel extrapolation method. When borderMode=BORDER_TRANSPARENT, /// it means that the pixels in the destination image that corresponds 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 Remap(
            InputArray src, OutputArray dst, InputArray map1, InputArray map2,
            InterpolationFlags interpolation = 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 (map1 == null)
                throw new ArgumentNullException(nameof(map1));
            if (map2 == null)
                throw new ArgumentNullException(nameof(map2));
            src.ThrowIfDisposed();
            dst.ThrowIfNotReady();
            map1.ThrowIfDisposed();
            map2.ThrowIfDisposed();
            Scalar borderValue0 = borderValue.GetValueOrDefault(Scalar.All(0));
            NativeMethods.imgproc_remap(src.CvPtr, dst.CvPtr, map1.CvPtr, map2.CvPtr, (int)interpolation, (int)borderMode, borderValue0);
            GC.KeepAlive(src);
            dst.Fix();
        }
        #endregion
Cv2