当前位置:主页 > 软件编程 > Python代码 >

Python imutils 填充图片周边为黑色的实现

时间:2021-05-23 08:04:49 | 栏目:Python代码 | 点击:

代码

import imutils
import cv2
image = cv2.imread('') 
# translate the image x=25 pixels to the right and y=75 pixels up
translated = imutils.translate(image, -75, 75)
cv2.imshow('original image',image)
cv2.imshow('translated',translated)
cv2.waitKey(0)

效果

参考:https://github.com/jrosebr1/imutils

您可能感兴趣的文章:

相关文章