Python 图片Resize.py

 

 

#!/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)

 

上一篇:我需要在Java / Struts上传后调整图像大小.这该怎么做?


下一篇:Oracle中如何判断一个字符串是否含有汉字(2)