﻿ 基于暗原色先验的低照度视频增强算法
 计算机系统应用  2019, Vol. 28 Issue (6): 165-171 PDF

1. 中国科学院大学, 北京 100049;
2. 中国科学院 沈阳计算技术研究所, 沈阳 110168

Low Lighting Video Enhancement Algorithm Based on Dark Channel Prior
LIU Feng, WANG Xin-Jia, YU Bo, XU Fu-Long
University of Chinese Academy of Sciences, Beijing 100049, China;
Shenyang Institute of Computing Technology, Chinese Academy of Sciences, Shenyang 110168, China
Abstract: The quality of video with low lighting is always pessimistic. Many images have low contrast, blurry edges, and low brightness. These situations will bring inconvenience to subsequent processing. For solving these problems, an improved algorithm named low lighting video enhancement algorithm based on dark channel prior is presented. Firstly, the input image is inverted, and then dehazed. Atmospheric light is estimated by the maximum value of dark channel in input image. At the same time, the refractive index t is calculated and optimized with fast guided filter, which help realizing edge-ware and denoising. Finally, the image is inverted again. The result shows that the proposed algorithm can enhance the contrast of low lighting image, improve the brightness, and highlight the details of the edges of the image.
Key words: low lighting video     dark channel prior     fast guider filter     denoising

1 研究 1.1 暗原色先验理论

He等人[6]通过对大量真实环境下的照片进行分析和比对, 发现在无雾条件下, 绝大多数有效场景区域, 某些像素点总会至少有一个颜色通道具有极低的值, 例如游人, 建筑, 植物的颜色构成, 都会包含红色, 蓝色, 绿色等带有低通道的色彩. 利用这个先验建立的去雾模型, 能够估算出雾的浓度并且复原得到高质量的去雾干扰的图像. 对于任意的真实图像J, 它的暗原色可以表示为:

 ${{J}^{{dark}}}{(x) = }\mathop {{min}}\limits_{{c} \in {\{ r,g,b\} }} {(}\mathop {{min}}\limits_{{y} \in {\mathit{\Omega} (x)}} {(}{{J}^{c}}{(y)))}$ (1)

Dong等人[3]在He等人[6]工作的基础上, 发现低照度图像在求反之后, 图像表征及直方图表征与去雾之前的图像具有很高的相似度. 并且求反后的图像, 背景区域的像素至少在一个通道内强度很低. 这说明该理论同样适用于低照度的图像.

1.2 快速导向滤波简介

2 改进的基于暗原色先验的低照度图像增强算法

 图 1 本文算法流程图

2.1 低照度图像增强

 ${{R}^{c}}{(x) = 255 - }{{I}^{c}}{(x)}$ (2)

 ${R(x) = J(x)t(x) + A(1 - t(x))}$ (3)

 ${J}\left( {x} \right){ = }\frac{{{R}\left( {x} \right){ - A}}}{{{t}\left( {x} \right)}}{ + A}$ (4)

 ${t}\left( {x} \right){ = 1 - \omega }\mathop {{min}}\limits_{{c} \in {\{ r,g,b\} }} \left( {\mathop {{min}}\limits_{{y} \in {\mathit{\Omega} (x)}} \left( {\frac{{{{R}^{c}}{(y)}}}{{{{A}^{c}}}}} \right)} \right)$ (5)

2.2 快速导向滤波详解

 ${{q}_{i}}{ = }\sum\limits_{{j} \in {{W}_{i}}} {{{W}_{{ij}}}{(I)*}{{p}_{j}}}$ (6)

 ${{q}_{i}}{ = }{{a}_{k}}{{I}_{i}}{ + }{{b}_{k}}{,}\forall {i} \in {{\omega }_{k}}$ (7)

ab是当窗口中心位于k时该线性函数的系数.

 ${{q}_{i}}{ = }{{p}_{i}}{ - }{{n}_{i}}$ (8)

 ${E}\left( {{{a}_{i}}{,}{{b}_{k}}} \right){ = }\sum\limits_{{i} \in {{\omega }_{k}}} {{{\left( {{{a}_{k}}{{I}_{k}}{ + }{{b}_{k}}{ - }{{p}_{i}}} \right)}^{2}}}$ (9)

 ${E}\left( {{{a}_{i}}{,}{{b}_{k}}} \right){ = }\sum\limits_{{i} \in {{\omega }_{k}}} {\left( {{{\left( {{{a}_{k}}{{I}_{k}}{ + }{{b}_{k}}{ - }{{p}_{i}}} \right)}^{2}}{ + } \in {a}_{k}^{2}} \right)}$ (10)

 ${{a}_{k}}{ = }\frac{{\frac{{1}}{{\left| {\omega } \right|}}\sum\nolimits_{{i} \in {{\omega }_{k}}} {{{I}_{i}}{{p}_{i}}{ - }{{\mu }_{k}}{{\overline {p} }_{k}}} }}{{{\sigma }_{k}^{2}{ + } \in }}$ (11)
 ${{b}_{k}}{ = }{\overline {p} _{k}}{ - }{{a}_{k}}{{\mu }_{k}}$ (12)
 ${{q}_{i}}{ = }{\overline {a} _{i}}{\overline {I} _{i}}{ + }{\overline {b} _{i}}$ (13)

3 实验结果与分析 3.1 实验数据

 图 2 A图的处理结果

 图 3 YCbCr色彩空间下各图亮度直方图

 图 4 B图的处理结果

 图 5 YCbCr色彩空间下各图亮度直方图

 图 6 C图的处理结果

 图 7 YCbCr色彩空间下各图亮度直方图

4 结语

 [1] Guo XJ. LIME: A method for low-light image enhancement. Proceedings of the 24th ACM International Conference on Multimedia. Amsterdam, the Netherlands. 2016. 87–91. [2] 程芳瑾, 杜晓骏, 马丽, 等. 基于Retinex的低照度图像增强. 电视技术, 2013, 37(15): 4-6, 10. DOI:10.3969/j.issn.1002-8692.2013.15.002 [3] Dong X, Wang G, Pang Y, et al. Fast efficient algorithm for enhancement of low lighting video. ACM SIGGRAPH 2010 Posters. Los Angeles, CA, USA. 2010. 69. [4] 刘洋, 潘静, 庞彦伟. 一种基于暗原色先验的低照度视频增强算法. 电子测量技术, 2013, 36(10): 55-57, 77. DOI:10.3969/j.issn.1002-7300.2013.10.015 [5] 黄勇, 孙兴波, 袁文林, 等. 基于暗原色先验的低照度图像增强. 四川理工学院学报(自然科学版), 2015, 28(3): 42-45. [6] He KM, Sun J, Tang XO. Single image haze removal using dark channel prior. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2011, 33(12): 2341-2353. DOI:10.1109/TPAMI.2010.168 [7] He KM, Sun J, Tang XO. Guided image filtering. Proceedings of the 11th European Conference on Computer Vision. Heraklion, Crete, Greece. 2010. 1–14. [8] 翟佳. 基于暗原色先验的低照度视频快速增强算法[硕士学位论文]. 天津: 天津大学, 2014. [9] He K, Sun J. Fast guided filter. arXiv:1505.00996. 2015.