Optimized contrast enhancement for real-time image and video dehazing

来源:互联网 发布:js替换file属性input 编辑:程序博客网 时间:2024/05/16 07:06

【摘要】本文提出了一种针对含有雾的图像和视频快速、完善的去雾算法。观察发现有雾的图像普遍具有低对比度,我们通过增强对比度来修复图像。然后多度的增强这些低对比度会截断像素值以及导致信息丢失。因此,我们引入一个包含对比项以及信息丢失项的损失函数。通过最小化损失函数,该算法不仅增强了对比度而且有效的保留了图像信息。另外,我们将图片去雾算法扩展到视频去雾。我们通过计算透射率的相关性减少对视频去雾时的闪烁程度。实验证明该算法去雾的有效性以及快速地进行实时去雾。


Hazing modeling

解决问题之前,通常要对研究的问题建立数学模型。大气散射模型描述了雾化图像的退化过程,下述方程所描述的雾图形成模型被广泛使用。

I(p)=t(p)J(p)+(1t(p)A)

其中,I代表已经有的图像(待去雾的图像),J代表恢复的无雾图像,A是全球大气光成分,t为透射率, p为像素在图片的位置。现在的已知条件就是I,要求目标J,显然,这是个有无数解的方程。因此还需要求出其它未知量,我们顺着论文往下看。
t(p)[0,1] 为反射光的传输率,由景物点与相机的距离决定t(p)=epd(p) 。静态图片去雾算法框架如下:
这里写图片描述
Fig.1 Block diagram of the proposed static image dehazing algorithm.

Static image dehazing

Atmospheric light estimation

与其它大气光A通常取图像中最大值不同。本人提出一个更具有鲁棒性的大气光估计方法。

  1. 我们将图片分为四个矩形区域。
  2. 我们将每个区域的平均像素值减去该区域的标准差,得到该区域的得分score。
  3. 将score最高的区域划分为四个小区域。
  4. 重复2~3步骤,直到最高score区域的size小于预先设定的阈值。
  5. 取该区域的最亮点。

如图所示。
这里写图片描述
Fig. 2. Atmospheric light estimation. By recursively dividing an image into four smaller regions and selecting the region with the highest score, we determine the region that is hazed most densely and then choose the atmospheric light within the region. In this example, the red block is the selected region. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)

Optimal transmission estimation

我们给出了三个恢复块对比的定义。它们分别为:

  • Mean squared error (MSE) contrast
  • Michelson contrast
  • Weber contrast
    这里写图片描述
    Fig. 3. 比较三个对比定义在去雾的效果。(a)输入图像.去雾图像和与其对应的转换映射表 (b) the MSE contrast, (c) the Michelson contrast, (d) the Weber contrast. 在转换映射表中,黄色和红色像素分别表示近、远景点。(For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)

我们注意到fig.3的三个去雾结果非常接近。所以在后续的去雾工作中,采用MSE contrast。当然其它两个和MSE contrast一样有效。

J(p)=1t(I(p)A)+A)

CMSE=p=1N(Ic(p)I¯c)2t2N

上式可知,t越小,还原图片的对比度越高,反之越低。Fig.4 表明如果输入像素值在[α,β]范围可以映射到[0, 255]的输出。红色部分为阶段区域,t越小[α,β]范围越小。在图像中,对于有雾的部分减少t获取较高的对比度,对无雾的部分增加t减少图像信息损失。Fig.5 显示了不同的t值对还原图像的效果。
这里写图片描述
Fig. 4. An example of the transformation function. Input pixel values are mapped to output pixel values according to the transformation function, depicted by the black line. The red regions represent the information loss due to the truncation of output pixel values. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)
这里写图片描述
Fig. 5. Relationship between the transmission value and the information loss. A smaller transmission value causes more severe truncation of pixel values and a larger amount of information loss. (a) An input hazy image. The restored dehazed images with transmission values of (b) t=0.1, (c) t=0.3, (d)t=0.5, and (e) t=0.7.

为了解决在增强对比度的同时尽可能保留原图像信息。我们定义了两个损失函数,分别为对比度,信息丢失函数:

Econtrast=cr,g,bpB(Jc(p)J¯c)2Nb=cr,g,bpB(Ic(p)I¯c)2t2Nb

Eloss=cr,g,bpB{(min{0,J(p)})2+(max{0,J(p))255})2}=cr,g,b{i=0αc(iAct+Ac)2hc(i)+i=βc255(iAct+Ac255)2hc(i)}

E=Econtrast+λEloss

上式中,hc(i)为图像颜色c像素i所在的直方图值。λ为权重因子。t的取值如下。
这里写图片描述

Transmission refinement

这部分有迷糊。我讲讲我的理解。和何凯明的基于暗通道去雾的透射率t一样,为了恢复原图像更多细节,对t进行优化。
这里写图片描述
之前我们针对整幅图提出了透射率t,考虑到图像每个点的景深不一同,我们提取了基于图像块的透射率,来获取更多图像细节。将t进行导向滤波求出t^,设t^I如上式。尺度s和偏移量ψ由当前大小为41 x 41的窗口决定。
这里写图片描述
窗口每间隔一个像素滑动整幅图像,这就就会有多个窗口重叠在每个像素点。在每个像素点,我们取该点所有相关透射率的平均值作为该点的最终透射率。我们称这种方法为中心窗口方案(方法)。但是这个方法带来的问题会对图像边缘进行平滑。为了解决这个问题,提出了可移动的窗口来代替中心窗口。
这里写图片描述
Fig. 6. Illustration of the shiftable window scheme: (a) centered window and (b) shiftable window

After obtaining the pixel-based transmission map, we dehaze the input image based on (1). However, as suggested in [11], we constrain the minimum transmission value to be greater than 0.1, since a smaller value tends to amplify noise. Furthermore, the restored hazy image often has darker pixel values than the input image. Thus, we apply the gamma correction [1] to the restored image with an empirically selected gamma of 0.8.
这里写图片描述
Fig. 7. Transmission map refinement: (a) Input hazy images, (b) the block-based transmission maps, and the pixel-based transmission maps using (c) the centered window scheme and (d) the shiftable window scheme. In the transmission maps, yellow and red colors represent near and far scene points, respectively. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)

Video dehazing

Temporal coherence

上面怎么翻译,叫“临时的一致性”?姑且就这么叫吧。

对于视频去雾,我们需要将原视频变换到YUV,然后仅对Y分量进行计算,以减少算法复杂度。我们假设帧于帧之间的原图像具有如下性质:
这里写图片描述
Y为通道,J为原图像,P为像素点,K为帧。同时假设大气光A在整个视频中的值不变,当然有可以重新计算。我们也能够轻易获取透射率之间的关系。
这里写图片描述
τ为临时一致性因子,其取值如下
这里写图片描述
但问题在于我比较两个像素点是在K、K-1帧相同的位置,而物体又是移动的以及相同的景深指向不同的像素点,为了解决这个问题,我们需要对像素点进行跟踪。但跟踪算法太费时了,所以我们又引入了一个概率模型。
这里写图片描述
这里写图片描述
σ在本文中去10。最后文章也引入了个损失函数:

E=Econtrast+λLEloss+λTEtemporal

Fast transmission refinement

we use a Gaussian window pixels around the window center have higher weights, whereas pixels farther from the center have lower weights. Then, we obtain the final optimal transmission value for each pixel, by computing the Gaussian weighted sum of the transmission values associated with the overlapping windows.

尾巴

鲁棒性不错的去雾算法,较何凯明的基于暗通道的去雾算法在对天空处理上的效果要好。
论文及原作者的代码下载地址:http://mcl.korea.ac.kr/projects/dehazing/#userconsent#

0 0