EADST

Python: Resize the Image Size

Resize the image size with Python OpenCV.

import cv2

path = 'test.jpg'
img = cv2.imread(path, 1)
img_size = img.shape
height = img_size[0]
width = img_size[1]
resize_height = int(height * 0.5)
resize_width = int(width * 0.5)
new_image = cv2.resize(img, (resize_width, resize_height))
resize_file = 'resize_' + path
cv2.imwrite(resize_file, new_image)
相关标签
About Me
XD
Goals determine what you are going to be.
Category
标签云
站点统计

本站现有博文266篇,共被浏览440676

本站已经建立2019天!

热门文章
文章归档
回到顶部