import cv2
import numpy as np
import matplotlib.pylab as plt
import scipy.misc as misc
'''
src - input image
top, bottom, left, right - border width in number of pixels in corresponding directions
borderType - Flag defining what kind of border to be added. It can be following types:
cv2.BORDER_CONSTANT - Adds a constant colored border. The value should be given as next argument.
cv2.BORDER_REFLECT - Border will be mirror reflection of the border elements, like this : fedcba|abcdefgh|hgfedcb
cv2.BORDER_REFLECT_101 or cv2.BORDER_DEFAULT - Same as above, but with a slight change, like this : gfedcb|abcdefgh|gfedcba
cv2.BORDER_REPLICATE - L
opencv学习——padding扩充边界
最新推荐文章于 2025-03-27 21:17:07 发布