W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
tf.image.ssim(
img1,
img2,
max_val
)
定義在:tensorflow/python/ops/image_ops_impl.py.
計算img1和img2之間的SSIM索引.
該功能基于標準的SSIM實現(xiàn)的:Wang,Z.,Bovik,AC,Sheikh,HR和Simoncelli,EP(2004).圖像質(zhì)量評價:從錯誤可見性到結(jié)構(gòu)相似性.IEEE圖像處理事物.
注意:真正的SSIM僅在灰度上定義.此功能不執(zhí)行任何色彩空間轉(zhuǎn)換.(如果輸入已經(jīng)是YUV,那么它將計算平均YUV SSIM.)
由于過濾器尺寸的原因,圖像尺寸必須至少為11x11.
示例:
# Read images from file.
im1 = tf.decode_png('path/to/im1.png')
im2 = tf.decode_png('path/to/im2.png')
# Compute SSIM over tf.uint8 Tensors.
ssim1 = tf.image.ssim(im1, im2, max_val=255)
# Compute SSIM over tf.float32 Tensors.
im1 = tf.image.convert_image_dtype(im1, tf.float32)
im2 = tf.image.convert_image_dtype(im2, tf.float32)
ssim2 = tf.image.ssim(im1, im2, max_val=1.0)
# ssim1 and ssim2 both have type tf.float32 and are almost equal.
參數(shù):
返回:
一個包含批處理中每個圖像的SSIM值的張量.返回的SSIM值在范圍(-1,1)中,當像素值非負時返回形狀為:broadcast(img1.shape [: - 3],img2.shape [: - 3])的張量.
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: