一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

Python imutils填充图片周边为黑色如何实现 Python imutils填充图片周边为黑色实现代码

时间:2020-01-19 编辑:袖梨 来源:一聚教程网

本篇文章小编给大家分享一下Python imutils填充图片周边为黑色实现代码,小编觉得挺不错的,现在分享给大家供大家参考,有需要的小伙伴们可以来看看。

代码

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)

效果

热门栏目