cv.copyMakeBorder - MATLAB File Help
cv.copyMakeBorder

Forms a border around an image

dst = cv.copyMakeBorder(src, top, bottom, left, right)
dst = cv.copyMakeBorder(src, [top, bottom, left, right])
[...] = cv.copyMakeBorder(..., 'OptionName', optionValue, ...)

Input

Output

Options

The function copies the source image into the middle of the destination image. The areas to the left, to the right, above and below the copied source image will be filled with extrapolated pixels. This is not what filtering functions based on it do (they extrapolate pixels on-fly), but what other more complex functions, including your own, may do to simplify image boundary handling.

See also