Tensorflow中图像处理函数

图像色调调整:

调整图像亮度函数: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函数实现随机截取图像;

  






评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值