【发布时间】:2018-08-07 01:11:09
【问题描述】:
我正在随机调整图像的亮度、饱和度等。但是调整后img_data的值超过了0-1,这样imshow就不起作用了。
tf.InteractiveSession()
image_raw_data=tf.read_file('C:/Users/User/PycharmProjects/Neural_Network\\cat.jpg')
sess=tf.Session()
img_data=tf.image.decode_jpeg(image_raw_data,channels=3)
img_data=tf.image.convert_image_dtype(img_data,dtype=tf.float32)
img_data=tf.image.resize_images(img_data,[300,300],method=0)
img_data=tf.image.random_brightness(img_data,max_delta=32/255)
plt.imshow(img_data.eval())
错误是:
ValueError: Floating point image RGB values must be in the 0..1 range.
我可以知道我应该如何正确转换图像以便显示吗?
【问题讨论】:
标签: python image-processing tensorflow deep-learning