【发布时间】:2019-12-28 07:22:23
【问题描述】:
我有 GAN 生成的 float64 类型的图像,我通过skimage.io.imsave 保存它们。该过程运行良好,保存的图像看起来不错,但我收到如下警告消息:
从 float64 到 uint8 的有损转换。范围 [-0.9999998807907104, 0.9999175071716309]。在保存之前将图像转换为 uint8 以抑制此警告。
然后我尝试通过在使用函数skimage.img_as_ubyte 保存之前将图像转换为 uint8 来消除此警告。这给了我一个明显更暗的图像并带有警告
用户警告:从 float64 转换为 uint8 时可能会丢失精度 .format(dtypeobj_in, dtypeobj_out))
我还尝试在保存之前使用其他功能,例如来自 tensorflow tf.image.convert_image_dtype 的功能。它们都返回比我直接调用 skimage.io.imsave 更暗的图像。这里有什么问题?
【问题讨论】:
标签: python image tensorflow image-processing scikit-image