代碼
1
2
3
4
5
6
7
8
|
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
以上這篇Python imutils 填充圖片周邊為黑色的實現就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持服務器之家。
原文鏈接:https://blog.csdn.net/u011463646/article/details/77429457