結構相異性 (structural dissimilarity),有鑑於最小平方誤差(Mean Square error)和 峰值信噪比(Peak signal-to-noise ratio)無法完全反應人類視覺上所感受的誤差,在 2004 年被提出來的新的誤差測量方法。
假設有兩個信號x與y,它們的結構相異性[1] 為
D
S
S
I
M
(
x
,
y
)
=
1
1
−
S
S
I
M
(
x
,
y
)
{\displaystyle DSSIM(x,y)={\frac {1}{1-SSIM(x,y)}}}
其中
S
S
I
M
(
x
,
y
)
{\displaystyle SSIM(x,y)}
為x與y的結構相似性
兩者的結構相似性定義為:
SSIM
(
x
,
y
)
=
[
l
(
x
,
y
)
]
α
[
c
(
x
,
y
)
]
β
[
s
(
x
,
y
)
]
γ
{\displaystyle {\text{SSIM}}(\mathbf {x} ,\mathbf {y} )=[l(\mathbf {x} ,\mathbf {y} )]^{\alpha }[c(\mathbf {x} ,\mathbf {y} )]^{\beta }[s(\mathbf {x} ,\mathbf {y} )]^{\gamma }}
,
l
(
x
,
y
)
=
2
μ
x
μ
y
+
C
1
μ
x
2
+
μ
y
2
+
C
1
{\displaystyle l(\mathbf {x} ,\mathbf {y} )={\frac {2\mu _{x}\mu _{y}+C_{1}}{\mu _{x}^{2}+\mu _{y}^{2}+C_{1}}}}
,
c
(
x
,
y
)
=
2
σ
x
σ
y
+
C
2
σ
x
2
+
σ
y
2
+
C
2
{\displaystyle c(\mathbf {x} ,\mathbf {y} )={\frac {2\sigma _{x}\sigma _{y}+C_{2}}{\sigma _{x}^{2}+\sigma _{y}^{2}+C_{2}}}}
,
s
(
x
,
y
)
=
σ
x
y
+
C
3
σ
x
σ
y
+
C
3
{\displaystyle s(\mathbf {x} ,\mathbf {y} )={\frac {\sigma _{xy}+C_{3}}{\sigma _{x}\sigma _{y}+C_{3}}}}
。
其中,
l
(
x
,
y
)
{\displaystyle l(\mathbf {x} ,\mathbf {y} )}
比較
x
{\displaystyle \mathbf {x} }
和
y
{\displaystyle \mathbf {y} }
的亮度(luminance ),
c
(
x
,
y
)
{\displaystyle c(\mathbf {x} ,\mathbf {y} )}
比較
x
{\displaystyle \mathbf {x} }
和
y
{\displaystyle \mathbf {y} }
的對比度 ,
s
(
x
,
y
)
{\displaystyle s(\mathbf {x} ,\mathbf {y} )}
比較
x
{\displaystyle \mathbf {x} }
和
y
{\displaystyle \mathbf {y} }
的結構(structure),
α
>
0
{\displaystyle \alpha >0}
,
β
>
0
{\displaystyle \beta >0}
,
γ
>
0
{\displaystyle \gamma >0}
,為調整
l
(
x
,
y
)
{\displaystyle l(\mathbf {x} ,\mathbf {y} )}
、
c
(
x
,
y
)
{\displaystyle c(\mathbf {x} ,\mathbf {y} )}
、
s
(
x
,
y
)
{\displaystyle s(\mathbf {x} ,\mathbf {y} )}
相對重要性的參數,
μ
x
{\displaystyle \mu _{x}}
及
μ
y
{\displaystyle \mu _{y}}
、
σ
x
{\displaystyle \sigma _{x}}
及
σ
y
{\displaystyle \sigma _{y}}
分別為
x
{\displaystyle \mathbf {x} }
和
y
{\displaystyle \mathbf {y} }
的平均值 和標準差 ,
σ
x
y
{\displaystyle \sigma _{xy}}
為
x
{\displaystyle \mathbf {x} }
和
y
{\displaystyle \mathbf {y} }
的共變異數 ,
C
1
{\displaystyle C_{1}}
、
C
2
{\displaystyle C_{2}}
、
C
3
{\displaystyle C_{3}}
皆為常數,用以維持
l
(
x
,
y
)
{\displaystyle l(\mathbf {x} ,\mathbf {y} )}
、
c
(
x
,
y
)
{\displaystyle c(\mathbf {x} ,\mathbf {y} )}
、
s
(
x
,
y
)
{\displaystyle s(\mathbf {x} ,\mathbf {y} )}
的穩定。
結構相似性指標的值越大,代表兩個信號的相似性越高。
若使用相同的兩張圖片去做SSIM運算,也就是說
μ
x
=
μ
y
{\displaystyle \mu _{x}=\mu _{y}}
且
σ
x
=
σ
y
{\displaystyle \sigma _{x}=\sigma _{y}}
,可以得到
SSIM
(
x
,
x
)
=
2
μ
x
2
+
C
1
μ
x
2
+
μ
x
2
+
C
1
×
2
σ
x
2
+
C
2
σ
x
2
+
σ
x
2
+
C
2
×
σ
x
x
+
C
3
σ
x
σ
x
+
C
3
=
1
{\displaystyle {\text{SSIM}}(\mathbf {x} ,\mathbf {x} )={\frac {2\mu _{x}^{2}+C_{1}}{\mu _{x}^{2}+\mu _{x}^{2}+C_{1}}}\times {\frac {2\sigma _{x}^{2}+C_{2}}{\sigma _{x}^{2}+\sigma _{x}^{2}+C_{2}}}\times {\frac {\sigma _{xx}+C_{3}}{\sigma _{x}\sigma _{x}+C_{3}}}=1}
實際使用時,簡化起見,一般會將參數設為
α
=
β
=
γ
=
1
{\displaystyle \alpha =\beta =\gamma =1}
及
C
3
=
C
2
/
2
{\displaystyle C_{3}=C_{2}/2}
,得到:
SSIM
(
x
,
y
)
=
(
2
μ
x
μ
y
+
C
1
)
(
2
σ
x
y
+
C
2
)
(
μ
x
2
+
μ
y
2
+
C
1
)
(
σ
x
2
+
σ
y
2
+
C
2
)
{\displaystyle {\text{SSIM}}(\mathbf {x} ,\mathbf {y} )={\frac {(2\mu _{x}\mu _{y}+C_{1})(2\sigma _{xy}+C_{2})}{(\mu _{x}^{2}+\mu _{y}^{2}+C_{1})(\sigma _{x}^{2}+\sigma _{y}^{2}+C_{2})}}}
。
在計算兩張影像的結構相似性指標時,會開一個局部性的視窗,一般為
N
{\displaystyle N}
×
N
{\displaystyle N}
的小區塊,計算出視窗內信號的結構相似性指標,每次以像素為單位移動視窗,直到整張影像每個位置的局部結構相似性指標都計算完畢。將全部的局部結構相似性指標平均起來即為兩張影像的結構相似性指標。
結構相異性(DSSIM)的範圍
编辑
當DSSIM越大時,代表兩張圖片越接近,SSIM越接近1,DSSIM的值也越大,當SSIM=1,也就是DSSIM趨近無限時,和原始視訊檔案完全一致,若SSIM>=0.98就是難以與原始視訊檔案分辨區別,而SSIM=0.95的時候大多數人都會對畫面滿意,這個數值可以認為是及格的畫面。SSIM=0.90的時候意味著瑕疵可能要比0.95多一倍,肉眼就會察覺到明顯的畫面劣化,因此低於這個數值時,就可以判定為沒有實際觀賞價值。
參考資料
编辑
^ Jian-Jiun Ding, Time frequency analysis and wavelet transform class note,the Department of Electrical Engineering, National Taiwan University (NTU), Taipei, Taiwan, 2007.
^ Zhou Wang, Alan C. Bovik, Hamid R. Sheikh, and Eero P. Simoncelli, "Image quality assessment: from error visibility to structural similairty," IEEE Transactions on Image Processing, vol. 13, no. 4, pp. 600−612, Apr. 2004.
外部連結
编辑