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