copyMakeBorder function

Mat copyMakeBorder(
  1. InputArray src,
  2. int top,
  3. int bottom,
  4. int left,
  5. int right,
  6. int borderType, {
  7. OutputArray? dst,
  8. Scalar? value,
})

CopyMakeBorder forms a border around an image (applies padding).

For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga2ac1049c2c3dd25c2b41bffe17658a36

Implementation

Mat copyMakeBorder(
  InputArray src,
  int top,
  int bottom,
  int left,
  int right,
  int borderType, {
  OutputArray? dst,
  Scalar? value,
}) {
  dst ??= Mat.empty();
  value ??= Scalar();
  cvRun(
    () => ccore.cv_copyMakeBorder(
      src.ref,
      dst!.ref,
      top,
      bottom,
      left,
      right,
      borderType,
      value!.ref,
      ffi.nullptr,
    ),
  );
  return dst;
}