使用bicubic resizing后,像素值大于255(tf.image.resize_images)

时间:2017-01-16 03:24:21

标签: image resize tensorflow

我首先使用tf.image.resize_images将图像下采样2倍,然后使用tf.image.resize_images再次按因子2上采样,对于这两个操作,我使用了bicubic作为内核,但结果图像具有一些像素值大于255或小于0,当我切换到使用双线性内核时,结果图像是好的。谁知道原因?非常感谢你。

1 个答案:

答案 0 :(得分:0)

这里有一个关于这个问题的解释:tensorflow image_resize mess up image on unknown image size

您可以在resize_images的float32输出上使用tf.saturate_cast(image,dtype = tf.uint8)来获取0到255之间的像素。