#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 19-7-14 下午4:54 # @Author : RongT import cv2 import os if __name__ == '__main__': img = cv2.imread("data/membrane/test4/1.jpg", -1) print('Original Dimensions : ', img.shape) img2 = cv2.resize(img, (512, 512), interpolation = cv2.INTER_AREA) print('Resized Dimensions : ', img2.shape) cv2.imwrite("data/membrane/test4/2.png", img2) # cv2.imshow("img2", img2) # cv2.waitKey(0)