codecamp

TensorFlow函数:tf.image.resize_area

tf.image.resize_area函数

tf.image.resize_area(
    images,
    size,
    align_corners=False,
    name=None
)

请参阅指南:图像操作>调整大小

使用区域插值调整images的大小.

输入图像可以是不同的类型,但输出图像总是浮点型的.

由于数值精度有限,输出图像的像素值范围可能与输入图像的范围稍有不同.保证输出范围,例如,[0.0, 1.0],将tf.clip_by_value应用于输出.

每个输出像素都是通过首先将像素的足迹转换成输入张量然后将与足迹相交的像素平均计算出来的.输入像素对平均值的贡献通过与足迹相交的面积比例来加权.这与OpenCV的INTER_AREA相同.

参数:

  • images:一个Tensor,必须是下列类型之一:int8,uint8,int16,uint16,int32,int64,half,float32,float64,是4维的,并且具有形状[batch, height, width, channels].
  • size:2个元素(new_height, new_width)的1-D int32张量,表示图像的新的大小.
  • align_corners:可选的bool,默认为False,如果为True,则输入和输出张量的4个角像素的中心对齐,保留角落像素处的值.
  • name:操作的名称(可选).

返回值:

函数返回float32类型的Tensor.

TensorFlow函数:tf.image.ResizeMethod
TensorFlow函数:tf.image.resize_bicubic
温馨提示
下载编程狮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; }