您的位置:首页 > 其它

Tensorflow中图像处理函数

2017-07-30 21:40 204 查看
图像色调调整:

调整图像亮度函数:tf.image.adjust_brightness(img_data,R)     R为调整亮度的参数

                                    tf.image.random_brightness(image,max_delta)  #在[-max_delta,max_delta]的范围随机调整图像的亮度;

调整图像的对比度函数:tf.image.adjust_contrast(img_data,R)  #R为调整对比度的参数;

                                            tf.image.random_constrast(image,lower,upper) # 在[lower,upper]的范围随机调整图的对比度;

调整图像的色相函数:tf.image.adjust_hue(img_data,R) #R为调整色相的参数值

                                        tf.image.random_hue(image,max_delta) #max_delta的取值在[0,0.5]之间;

调整图像的饱和度函数:tf.image.adjust_saturation(img_data,R)

                                             tf.image.random_saturation(image, lowet, upper)  #在[lower,upper]的范围随机调整图的饱和度;

图像标准化操作:将图像上的亮度均值设置为0,方差设置为1;

                                         tf.image.per_image_whitening(img_data)

处理标注框:tf.image.draw_bounding_boses函数;

img_data = tf.image.resize_images(img_data, 180, 267, method=1)                  #先设定图像的大小                                                                batched = tf.expand_dims(tf.image.convert_image_dtype(img_data,tf.float32),0)   #将图像矩阵转化为实数类型                                                    boxes = tf.image.draw_bounding_boxes([[[0.05,0.05,0.9,0.7],[0.35,0.47,0.5,0.56]]])                                                                           result = tf.image.draw_bounding_boxes(batched,boxes)
通过tf.image.sample_distorted_bounding_box函数实现随机截取图像;
  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: