[英]resizing images in python not actually resizing
我正在读取图像,并使用skimage.transform
调整其大小。 但是当我打印出尺寸时,图像仍然具有相同的尺寸。 我还可以通过仅使用io.imshow()
来看到大小没有变化。
我想将其调整为宽度:60,高度:30。
import numpy as np
from skimage import data, io, filter, color, exposure
from skimage.transform import resize, rescale, rotate, setup, warp, AffineTransform
import matplotlib.pyplot as plt
img = color.rgb2gray(io.imread(path+readfile))
resize(img, (30,60))
print img.shape
io.imshow(img)
io.show()
此代码中缺少什么?
调整大小会返回更改后的图像。 尝试这个?
new_img = resize(img, (30,60))
print new_img.shape
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.