You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
365 B
20 lines
365 B
import sys
|
|
import cv2
|
|
import numpy as np
|
|
import matplotlib.pyplot as plt
|
|
|
|
|
|
def resize(img_path, shape):
|
|
img = cv2.imread(img_path, 1)
|
|
img = cv2.resize(img, shape)
|
|
cv2.imwrite('./output/reshape.jpg', img)
|
|
|
|
|
|
'''
|
|
输入:一张图片,图片大小
|
|
输出:对应大小的图片
|
|
'''
|
|
if __name__ == '__main__':
|
|
resize(sys.argv[1], eval(sys.argv[2]))
|
|
|