cv.copyMakeBorder - MATLAB File Help |
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, ...)
top=1
, bottom=1
, left=1
, right=1
mean that 1
pixel-wide border needs to be built.src
and the size
[size(src,1)+top+bottom, size(src,2)+left+right, size(src,3)]
.iiiiii|abcdefgh|iiiiiii
with some specified i
aaaaaa|abcdefgh|hhhhhhh
fedcba|abcdefgh|hgfedcb
gfedcb|abcdefgh|gfedcba
cdefgh|abcdefgh|abcdefg
BorderType
is 'Constant'. default zerosThe 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.