OpenCvSharp.Cv2.CopyMakeBorder C# (CSharp) Method

CopyMakeBorder() public static method

Forms a border around the image
public static CopyMakeBorder ( InputArray src, OutputArray dst, int top, int bottom, int left, int right, BorderTypes borderType, Scalar value = null ) : void
src InputArray The source image
dst OutputArray The destination image; will have the same type as src and /// the size Size(src.cols+left+right, src.rows+top+bottom)
top int Specify how much pixels in each direction from the source image rectangle one needs to extrapolate
bottom int Specify how much pixels in each direction from the source image rectangle one needs to extrapolate
left int Specify how much pixels in each direction from the source image rectangle one needs to extrapolate
right int Specify how much pixels in each direction from the source image rectangle one needs to extrapolate
borderType BorderTypes The border type
value Scalar The border value if borderType == Constant
return void
        public static void CopyMakeBorder(InputArray src, OutputArray dst, int top, int bottom, int left, int right, BorderTypes borderType, Scalar? value = null)
        {
            if (src == null)
                throw new ArgumentNullException(nameof(src));
            if (dst == null)
                throw new ArgumentNullException(nameof(dst));
            src.ThrowIfDisposed();
            dst.ThrowIfNotReady();
            Scalar value0 = value.GetValueOrDefault(new Scalar());
            NativeMethods.imgproc_copyMakeBorder(src.CvPtr, dst.CvPtr, top, bottom, left, right, (int)borderType, value0);
            GC.KeepAlive(src);
            dst.Fix();
        }
        #endregion
Cv2