codecamp

TensorFlow函数:tf.image.total_variation

tf.image.total_variation函数

tf.image.total_variation(
    images,
    name=None
)

定义在:tensorflow/python/ops/image_ops_impl.py.

请参阅指南:图像操作>去噪

计算并返回一个或多个图像的总体变化.

总变化量是输入图像中相邻像素值绝对差值的总和.这测量了图像中有多少噪声量.

这可以在优化期间用作损失函数,以抑制图像中的噪声.如果你有一批图像,那么你应该计算标量损失值作为总和:

loss = tf.reduce_sum(tf.image.total_variation(images))

这实现了这里描述的公式的各向异性2-D版本:https://en.wikipedia.org/wiki/Total_variation_denoising

参数:

  • images:形状为[batch, height, width, channels]的4-D张量,或形状为[height, width, channels]的3-D张量.
  • name:操作的名称(可选).

可能引发的异常:

  • ValueError:如果images.shape不是3-D或4-D矢量.

返回:

images总的变化.

如果images是4-D,则返回[batch]批次中每个图像的总变化形状的一维浮动张量;如果images是3-D,则返回标量浮点图,并显示该图像的总变化量.

TensorFlow函数:tf.image.ssim_multiscale
TensorFlow函数:tf.image.transpose_image
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

TensorFlow 函数介绍

TensorFlow 函数模块:tf

TensorFlow的image模块

TensorFlow使用之tf.io

TensorFlow使用之tf.keras

TensorFlow函数教程:tf.keras.applications

TensorFlow函数教程:tf.keras.backend

TensorFlow使用之tf.metrics

TensorFlow使用之tf.nn

TensorFlow使用之tf.python_io

TensorFlow 功能函数

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }