tensorflow psnr计算 tf.image.psnr

tf.image.psnr

tf.image.psnr(a,b,max_val,name=None)

Defined in tensorflow/python/ops/image_ops_impl.py.

Returns the Peak Signal-to-Noise Ratio between a and b.

This is intended to be used on signals (or images). Produces a PSNR value for each image in batch.

The last three dimensions of input are expected to be [height, width, depth].

Example:

    # Read images from file.

im1= tf.decode_png('path/to/im1.png')

im2= tf.decode_png('path/to/im2.png')# Compute PSNR over tf.uint8 Tensors.

psnr1= tf.image.psnr(im1, im2, max_val=255)

# Compute PSNR over tf.float32 Tensors.

im1= tf.image.convert_image_dtype(im1, tf.float32)

im2= tf.image.convert_image_dtype(im2, tf.float32)

psnr2= tf.image.psnr(im1, im2, max_val=1.0)# psnr1 and psnr2 both have type tf.float32 and are almost equal.

Arguments:

a: First set of images.

b: Second set of images.

max_val: The dynamic range of the images (i.e., the difference between the maximum the and minimum allowed values).

name: Namespace to embed the computation in.

Returns:

The scalar PSNR between a and b. The returned tensor has type tf.float32 and shape [batch_size, 1].

https://tensorflow.google.cn/api_docs/python/tf/image/psnr?hl=zh-cn

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,452评论 0 10
  • 爱情是教你爱一个特别的人,而婚姻是教你爱一个普通人。
    雷剑克鲁斯阅读 121评论 0 0
  • 逸阳 管他谁说的 江山如画 管他谁想要 风云叱咤 你只需 约几个好友 选好时日 月下饮茶
    袁逸阳阅读 296评论 0 0
  • . 1 最近经常看中式台球(China Billiards,之前有的称中式八球)的比赛直播,在弹幕中经常能看到的一...
    王晓明147阅读 1,036评论 0 4
  • 今天我没能实现我的诺言,我终究没能听完音频。 早上起的倒是早,6:30就起了,7点20才出门,然后在食堂学了每日一...
    muziyue阅读 174评论 0 0