我正在尝试使用skimage.transform.resize
函数调整.jpg
图像的大小。函数返回给我奇怪的结果(请参见下面的图片)。我不确定是否是一个错误或只是错误地使用了该函数。
import numpy as np
from skimage import io, color
from skimage.transform import resize
rgb = io.imread("../../small_dataset/" + file)
# show original image
img = Image.fromarray(rgb, 'RGB')
img.show()
rgb = resize(rgb, (256, 256))
# show resized image
img = Image.fromarray(rgb, 'RGB')
img.show()
原始图像:
调整大小后的图像:
我已经查看过skimage resize giving weird output,但我认为我的错误具有不同的特性。
更新:rgb2lab函数也有类似的错误。
matplotlib
也可以。 - Primoz