用imwrite函数保存图像时发现是全黑色图片。可以输出 image的内容看看。实际上很大部分像素点值为0-1之间。所以需要*255
而用plt的imshow和savefig函数则能显示0-1之间像素点,应该是线性变换到了0-255.
plt.figure()
plt.imshow(image,cmap='Greys_r')
plt.savefig(os.path.join('/home/plasmabubble/2013/junheng/',file), dpi = 300)
用imwrite函数保存图像时发现是全黑色图片。可以输出 image的内容看看。实际上很大部分像素点值为0-1之间。所以需要*255
而用plt的imshow和savefig函数则能显示0-1之间像素点,应该是线性变换到了0-255.
plt.figure()
plt.imshow(image,cmap='Greys_r')
plt.savefig(os.path.join('/home/plasmabubble/2013/junheng/',file), dpi = 300)