iCAM06: A refifined image appearance model for HDR image rendering
Mark D Fairchild是图像颜色方面的大家,虽然不是本篇论文的第一作者,但他对色貌模型的发展有着举足轻重的作用,他在图像颜色处理方面的论文可以参见MDF,之后在关于图像颜色方面的论文中也会对这个List中比较重要的论文进行解读。色貌模型在1997年被CIE技术委员会所采纳 为CIECAM97s标准的原文,发展至当前在图像处理领域被广泛应用是iCAM06经历了多次的迭代,如果对色貌模型的发展历程感兴趣可以继续阅读下列论文,在撰写这篇关于iCAM06的文章的过程中也参考到了这几篇论文中的内容:
- 1977:The CIE 1976 Color-Difference Formulae
- 1993:Image Color-Appearance Specification Through Extension of CIELAB
- 1997:The Structure of the CIE 1997 Colour Appearance Model (CIECAM97s)
- 2001:A Revision of CIECAM97s for Practical Applications
- 2002:Meet iCAM: A Next-Generation Color Appearance Model
- 2002:The CIECAM02 color appearance model
- 2004:iCAM framework for image appearance,differences, and quality
- 2007:iCAM06, HDR, and Image Appearance
文章目录
- iCAM06: A refifined image appearance model for HDR image rendering
-
- Framework of the iCAM06 model
-
- sRGB to CIEXYZ
- Image decomposition
- White
- Chromatic adaptation
- Tone compression
- IPT transformation
Framework of the iCAM06 model
色貌模型发展至今,已经成为颜色认知领域重要的国际标准,由von Kries提出的颜色自适应(Chromatic Adaptation)和Munsell发展起来的颜色空间(Color Space)为基础,于1976年建立了CIELAB颜色空间,在这些工作的基础上于1997年制定了CIECAM97s。用iCAM06做高动态范围图像的动态范围压缩的目的是通过色貌模型预测人眼在高动态范围场景中的自适应过程,其流程图如下图所示:
sRGB to CIEXYZ
假设需要处理的HDR图像数据已经是sRGB数据,首先需要将sRGB颜色空间转换为CIEXYZ颜色空间:
[XYZ]=MsRGB[RGB],MsRGB=[0.41240.21270.01930.35760.71520.11920.18050.07220.9504]\left[\begin{array}{c} X \\ Y \\ Z \end{array}\right]=M_{\mathrm{sRGB}}\left[\begin{array}{c} R \\ G \\ B \end{array}\right], \quad M_{\mathrm{sRGB}}=\left[\begin{array}{lll} 0.4124 & 0.2127 & 0.0193 \\ 0.3576 & 0.7152 & 0.1192 \\ 0.1805 & 0.0722 & 0.9504 \end{array}\right] ???XYZ????=MsRGB????RGB????,MsRGB?=???0.41240.35760.1805?0.21270.71520.0722?0.01930.11920.9504????
Image decomposition
与其他基于Retinex的Tone Mapping算法一样,基于iCAM06的Tone Mapping算法也将输入图像分解为基础层(Base Layer)和细节层(Detail Layer),只对基础层进行色度自适应和亮度映射,为避免产生过重的Halo Artifacts,同论文《Fast bilateral fifiltering for the display of high dynamic range image》一样,本文也采用BLF(Bilateral Filter)来计算图像的基础层:
Js=1k(s)∑p∈Ωf(p?s)g(Ip?Is)Ipk(s)=∑p∈Ωf(p?s)g(Ip?Is)J_{s}=\frac{1}{k(s)} \sum_{p \in \Omega} f(p-s) g\left(I_{p}-I_{s}\right) I_{p}\\ k(s)=\sum_{p \in \Omega} f(p-s) g\left(I_{p}-I_{s}\right) Js?=k(s)1?p∈Ω∑?f(p?s)g(Ip??Is?)Ip?k(s)=p∈Ω∑?f(p?s)g(Ip??Is?)
其中IpI_{p}Ip?为原图,JsJ_{s}Js?为经过BLF的基础层。需要注意的是需要分别对[X,Y,Z][X,Y,Z][X,Y,Z]进行BLF得到基础层,然后用原图除以基础层得到对应的细节层:
XYZ=XYZdetail ??XYZbase X Y Z=X Y Z_{\text {detail }} \cdot * X Y Z_{\text {base }} XYZ=XYZdetail ???XYZbase ?
White
在XYZbaseXYZ_{base}XYZbase?基础White层,此处的White层即是图像的亮度层,主要的作用是用于后续色度自适应和亮度自适应的控制当中,通过XYZbaseXYZ_{base}XYZbase?和一个图像尺寸1/21/21/2大小的高斯滤波器卷积得到:
White =XYZbase ?G\text { White }=X Y Z_{\text {base }} \otimes G White =XYZbase ??G
Chromatic adaptation
首先将CIEXYZ颜色空间中的基础层转回至RGB颜色空间:
[RGB]=MCAT02[XYZ],MCAT02=[0.73280.4296?0.1624?0.70361.69750.00610.00300.01360.9834]\left[\begin{array}{l} R \\ G \\ B \end{array}\right]=M_{C A T 02}\left[\begin{array}{l} X \\ Y \\ Z \end{array}\right], M_{C A T 02}=\left[\begin{array}{lll} 0.7328 & 0.4296 & -0.1624 \\ -0.7036 & 1.6975 & 0.0061 \\ 0.0030 & 0.0136 & 0.9834 \end{array}\right] ???RGB????=MCAT02????XYZ????,MCAT02?=???0.7328?0.70360.0030?0.42961.69750.0136??0.16240.00610.9834????
注:CAT02颜色空间是一种符合人眼视椎细胞响应的RGB颜色空间
计算自适应亮度函数:
D=0.3F[1?(13.6)e(?(LA?42)92)]D=0.3 F\left[1-\left(\frac{1}{3.6}\right) \mathrm{e}^{\left(\frac{-\left(L_{A}-42\right)}{92}\right)}\right] D=0.3F[1?(3.61?)e(92?(LA??42)?)]
其中LAL_{A}LA?为WhiteWhiteWhite的YYY通道的2020%20,F=0.3F=0.3F=0.3,然后对RGBRGBRGB三通道分别进行颜色自适应:
Rc=[(RD65DRW)+(1?D)]RGc=[(GD65DGW)+(1?D)]GBc=[(BD65DBW)+(1?D)]B\begin{array}{l} R_{c}=\left[\left(R_{D 65} \frac{D}{R_{W}}\right)+(1-D)\right] R\\ G_{c}=\left[\left(G_{D 65} \frac{D}{G_{W}}\right)+(1-D)\right] G \\ B_{c}=\left[\left(B_{D 65} \frac{D}{B_{W}}\right)+(1-D)\right] B \end{array} Rc?=[(RD65?RW?D?)+(1?D)]RGc?=[(GD65?GW?D?)+(1?D)]GBc?=[(BD65?BW?D?)+(1?D)]B?
其中[RW,GW,BW]=CAT02×White[R_{W},G_{W},B_{W}]=CAT02×White[RW?,GW?,BW?]=CAT02×White,[RD65,GD65,BD65][R_{D65},G_{D65},B_{D65}][RD65?,GD65?,BD65?]为D65D65D65照明条件下CAT02CAT02CAT02颜色空间的白色值。
Tone compression
将色度自适应后的结果从CAT02CAT02CAT02颜色空间转化至HPEHPEHPE颜色空间(Hunt-Pointer-Estevez):
[R′G′B′]=MHPEMCAT02?1[RCGCBC];MHPE=[0.389710.68898?0.07868?0.229811.183400.046410.00.01.0];MCAT02?1=[1.096124?0.2788690.1827450.4543690.4735330.072098?0.009628?0.0056981.015326]\begin{array}{l} {\left[\begin{array}{c} R^{\prime} \\ G^{\prime} \\ B^{\prime} \end{array}\right]=M_{H P E} M_{C A T 02}^{-1}\left[\begin{array}{c} R_{C} \\ G_{C} \\ B_{C} \end{array}\right]}; M_{H P E}=\left[\begin{array}{lll} 0.38971 & 0.68898 & -0.07868 \\ -0.22981 & 1.18340 & 0.04641 \\ 0.0 & 0.0 & 1.0 \end{array}\right]; M_{C A T 02}^{-1}=\left[\begin{array}{lll} 1.096124 & -0.278869 & 0.182745 \\ 0.454369 & 0.473533 & 0.072098 \\ -0.009628 & -0.005698 & 1.015326 \end{array}\right] \end{array} ???R′G′B′????=MHPE?MCAT02?1????RC?GC?BC?????;MHPE?=???0.38971?0.229810.0?0.688981.183400.0??0.078680.046411.0????;MCAT02?1?=???1.0961240.454369?0.009628??0.2788690.473533?0.005698?0.1827450.0720981.015326?????
随后采用如下非线性函数进行动态范围压缩:
Ra′=400(FLR′/YW)p27.13+(FLR′/YW)p+0.1Ga′=400(FLG′/YW)p27.13+(FLG′/YW)p+0.1Ba′=400(FLB′/YW)p27.13+(FLB′/YW)p+0.1FL=0.2k4(5LA)+0.1(1?k4)2(5LA)1/3k=1/(5LA+1))\begin{array}{l} R_{a}^{\prime}=\frac{400\left(F_{L} R^{\prime} / Y_{W}\right)^{p}}{27.13+\left(F_{L} R^{\prime} / Y_{W}\right)^{p}}+0.1 \\ G_{a}^{\prime}=\frac{400\left(F_{L} G^{\prime} / Y_{W}\right)^{p}}{27.13+\left(F_{L} G^{\prime} / Y_{W}\right)^{p}}+0.1 \\ B_{a}^{\prime}=\frac{400\left(F_{L} B^{\prime} / Y_{W}\right)^{p}}{27.13+\left(F_{L} B^{\prime} / Y_{W}\right)^{p}}+0.1 \\ F_{L}=0.2 k^{4}\left(5 L_{A}\right)+0.1\left(1-k^{4}\right)^{2}\left(5 L_{A}\right)^{1 / 3} \\ \left.k=1 /\left(5 L_{A}+1\right)\right) \end{array} Ra′?=27.13+(FL?R′/YW?)p400(FL?R′/YW?)p?+0.1Ga′?=27.13+(FL?G′/YW?)p400(FL?G′/YW?)p?+0.1Ba′?=27.13+(FL?B′/YW?)p400(FL?B′/YW?)p?+0.1FL?=0.2k4(5LA?)+0.1(1?k4)2(5LA?)1/3k=1/(5LA?+1))?
此非线性函数由总结三种视椎细胞响应的实验数据得到,对上式公式的具体描述可以参考论文Dynamic cone response functions for models of colour appearance,其中函数FLF_{L}FL?是在iCAM2中给出的亮度相关的色貌自适应函数,[XW,YW,ZW][X_{W},Y_{W},Z_{W}][XW?,YW?,ZW?]是高斯滤波器尺寸为原图像1/31/31/3的WhiteWhiteWhite图像中的YYY通道,参数ppp一般设置在0.6?0.850.6-0.850.6?0.85的区间内,默认值设为0.75,值越大图像局部对比度越高,下图对应不同ppp值的响应曲线。
注:HPEHPEHPE依旧是一种RGB颜色空间,关于HPEHPEHPE颜色空间可以阅读论文A nonlinear color‐appearance model using estévez‐hunt‐pointer primaries
以上非线性映射过程模拟的是人眼视椎细胞的响应过程,接下来采用Hunt在The Reproduction of Colour中给出的视杆细胞响应模型来模拟人眼视杆细胞的响应:
As=3.05Bs[400(FLSS/Sw)p27.13+(FLSS/Sw)p]+0.3FLS=3800j2(5LAS/2.26)+0.2(1?j2)4(5LAS/2.26)1/6LAS=2.26LAj=0.00001/[(5LAS/2.26)+0.00001]BS=0.5/{1+0.3[(5LAS/2.26)(S/Sw)]0.3}+0.5/{1+5[5LAS/2.26]}\begin{array}{l} A_{s}=3.05 B_{s}\left[\frac{400\left(F_{L S} S / S_{w}\right)^{p}}{27.13+\left(F_{L S} S / S_{w}\right)^{p}}\right]+0.3 \\ F_{L S}=3800 j^{2}\left(5 L_{A S} / 2.26\right)+0.2\left(1-j^{2}\right)^{4}\left(5 L_{A S} / 2.26\right)^{1 / 6} \\ L_{A S}=2.26 L_{A} \\ j=0.00001 /\left[\left(5 L_{A S} / 2.26\right)+0.00001\right] \\ B_{S}=0.5 /\left\{1+0.3\left[\left(5 L_{A S} / 2.26\right)\left(S / S_{w}\right)\right]^{0.3}\right\}+0.5 /\left\{1+5\left[5 L_{A S} / 2.26\right]\right\} \end{array} As?=3.05Bs?[27.13+(FLS?S/Sw?)p400(FLS?S/Sw?)p?]+0.3FLS?=3800j2(5LAS?/2.26)+0.2(1?j2)4(5LAS?/2.26)1/6LAS?=2.26LA?j=0.00001/[(5LAS?/2.26)+0.00001]BS?=0.5/{
1+0.3[(5LAS?/2.26)(S/Sw?)]0.3}+0.5/{
1+5[5LAS?/2.26]}?
下图给出了不同参数ppp对应的人眼视杆细胞响应函数。
需要注意的是由于人眼视杆细胞不具备颜色分辨能力,所以模拟的人眼视杆细胞响应AsA_{s}As?只有一个通道,最后合并人眼视椎细胞响应和人眼视杆细胞响应即是人眼对最终的动态范围颜色结果:
RGBTC=RGBa′+AsRGB_{TC}=RGB_{a}^{'}+A_{s} RGBTC?=RGBa′?+As?
IPT transformation
将图像由HPEHPEHPE颜色空间转至XYZXYZXYZ颜色空间:
[XcYcZc]=MHPE?1RGBTC\left[\begin{array}{l} X_{c} \\ Y_{c} \\ Z_{c} \end{array}\right]=M_{H P E}^{-1} R G B_{T C} ???Xc?Yc?Zc?????=MHPE?1?RGBTC?
为避免Hunt效应,根据亮度对图像的细节层进行修正,再结合调整过后的基础层:
[XdYdZd]=[XYZdetail(FL+0.8)0.25]T.?[XcYcZc]\begin{bmatrix} X_{d}\\ Y_{d}\\ Z_{d} \end{bmatrix}=\begin{bmatrix} XYZ_{detail}^{(F_{L}+0.8)^{0.25}} \end{bmatrix}^{T}.*\begin{bmatrix} X_{c}\\ Y_{c}\\ Z_{c} \end{bmatrix} ???Xd?Yd?Zd?????=[XYZdetail(FL?+0.8)0.25??]T.????Xc?Yc?Zc?????
注:Hunt效应即是图像对比度随亮度而增加
将色度、亮度均调整后的图像转至LMSLMSLMS颜色空间:
[LMS]=MHD65[XcYcZc],MHD65=[0.40020.7075?0.0807?0.22801.15000.06120.00000.00000.9184]\left[\begin{array}{l} L \\ M \\ S \end{array}\right]=M_{H}^{D 65}\left[\begin{array}{c} X_{c} \\ Y_{c} \\ Z_{c} \end{array}\right], M_{H}^{D 65}=\left[\begin{array}{lll} 0.4002 & 0.7075 & -0.0807 \\ -0.2280 & 1.1500 & 0.0612 \\ 0.0000 & 0.0000 & 0.9184 \end{array}\right] ???LMS????=MHD65????Xc?Yc?Zc?????,MHD65?=???0.4002?0.22800.0000?0.70751.15000.0000??0.08070.06120.9184????
注:LMSLMSLMS颜色空间是模拟三种视椎细胞响应的一种RGBRGBRGB颜色空间
在LMSLMSLMS颜色空间对对每个通道进行gamma校正:
[L′M′S′]=[L0.43M0.43S0.43]\left[\begin{array}{c} \mathrm{L}^{\prime} \\ \mathrm{M}^{\prime} \\ S^{\prime} \end{array}\right]=\left[\begin{array}{c} \mathrm{L}^{0.43} \\ \mathrm{M}^{0.43} \\ S^{0.43} \end{array}\right] ???L′M′S′????=???L0.43M0.43S0.43????
将校正后的结果转至IPTIPTIPT颜色空间:
[IPT]=MIPT[L′M′S′],MIPT=[0.40000.40000.20004.4550?4.85100.39600.80560.3572?1.1628]\left[\begin{array}{l} I \\ P \\ T \end{array}\right]=M_{\mathrm{IPT}}\left[\begin{array}{l} L^{\prime} \\ M^{\prime} \\ S^{\prime} \end{array}\right], M_{\mathrm{IPT}}=\left[\begin{array}{lll} 0.4000 & 0.4000 & 0.2000 \\ 4.4550 & -4.8510 & 0.3960 \\ 0.8056 & 0.3572 & -1.1628 \end{array}\right] ???IPT????=MIPT????L′M′S′????,MIPT?=???0.40004.45500.8056?0.4000?4.85100.3572?0.20000.3960?1.1628????
注:IPTIPTIPT为对立色颜色空间(uniform opponent color space),其中III为表示亮度,PPP表示红-绿通道,TTT表示蓝-绿通道
在IPTIPTIPT颜色空间中对P、TP、TP、T通道进行一定程度的正确增强:
P=P?[(FL+1)0.2(1.29C2?0.27C+0.42C2?0.31C+0.42)]T=T?[(FL+1)0.2(1.29C2?0.27C+0.42C2?0.31C+0.42)]\begin{array}{l} P=P \cdot\left[\left(F_{L}+1\right)^{0.2}\left(\frac{1.29 C^{2}-0.27 C+0.42}{C^{2}-0.31 C+0.42}\right)\right] \\ T=T \cdot\left[\left(F_{L}+1\right)^{0.2}\left(\frac{1.29 C^{2}-0.27 C+0.42}{C^{2}-0.31 C+0.42}\right)\right] \end{array} P=P?[(FL?+1)0.2(C2?0.31C+0.421.29C2?0.27C+0.42?)]T=T?[(FL?+1)0.2(C2?0.31C+0.421.29C2?0.27C+0.42?)]?
最后再根据当个观看环境对III通道进行校正:
I={I1.5Dark Surround I1.25Dim Surround I1.0Average Surround I=\left\{\begin{array}{cc} I^{1.5} & \text { Dark Surround } \\ I^{1.25} & \text { Dim Surround } \\ I^{1.0} & \text { Average Surround } \end{array}\right. I=????I1.5I1.25I1.0? Dark Surround Dim Surround Average Surround ?
最后再将图像 由IPTIPTIPT颜色空间转回至RGBRGBRGB颜色空间:
LMS′=MIPT?1IPTXYZ′=MHD65?1LMS′RGB′=MsRGB?1LMS′\begin{array}{l} L M S^{\prime}=M_{I P T}^{-1} I P T \\ X Y Z^{\prime}=M_{H}^{D 65^{-1}} L M S^{\prime} \\ R G B^{\prime}=M_{s R G B}^{-1} L M S^{\prime} \end{array} LMS′=MIPT?1?IPTXYZ′=MHD65?1?LMS′RGB′=MsRGB?1?LMS′?