def pad_height(image):
height, width, _ = image.shape
border_x = 0
border_y = int(round(1080-height)/2.)
image = cv2.copyMakeBorder(image, border_y, border_y,
border_x, border_x,
cv2.BORDER_CONSTANT, value=[0,0,0,0])
return image
评论列表
文章目录