开放科学(资源服务)标志码(OSID):
由于现实场景和普通图像采集设备的动态范围不匹配,获取的图像不能准确地反映场景中的细节信息[1-2],利用多曝光图像融合[3-4]能使一组包含不同程度细节信息的图像表现在一幅图像中。然而,实际场景大部分是动态的,所以摄像机捕获的多帧图像存在移动的物体,比如移动的行人、汽车等。融合图像出现透明的鬼影或产生模糊,严重影响了融合图像的质量并限制了许多融合算法的应用。
为解决动态场景下多曝光图像融合所产生鬼影的问题,GALLO等[5]利用随机样本一致性的异常点检测算法能够有效消除鬼影,但在融合图像中出现色彩失真和块效应的情况,LIU等[6]利用尺度不变特征变换进行多曝光图像融合,可以有效地保存输入图像的细节信息,但融合结果仍存在鬼影现象,PECE等[7]利用中值门限位图进行运动区域检测,随后HO等[8]提出了多级门限位图的运动区域检测算法,但是当图像含有大量的曝光像素时,采用中值门限位图或多级门限位图进行融合的结果存在鬼影、模糊和噪点现象。近年来,深度学习方法[4]被应用到HDR图像去鬼影中,KALANTARI等[9]将CNN合成引入多曝光图像融合中,在鬼影去除方面取得较好的效果,但是在光流法对齐的过程中容易引入伪影和畸变。WU等[10]提出一种ResNet网络,可以将多幅LDR图像转换为无鬼影HDR图像。
为消除多曝光融合图像中因运动物体引入的鬼影现象,本文提出一种基于中值直方图均衡的动态场景多曝光图像融合算法。通过中值直方图均衡得到公共直方图,其对于两幅不同程度曝光的图像能够较好地调整亮度差异。对输入图像和参考图像进行中值直方图均衡处理能够得到亮度分布一致的图像对,通过对图像对做差分,根据差分图进行阈值分割和形态学优化得到运动权重图,以准确地检测运动区域。
1 运动区域检测在多个曝光图像序列中选取过曝光和欠曝光像素最少的图像作为参考图像
$ {D}_{i}^{\mathrm{h}\mathrm{m}}=\left|{I}_{i, \mathrm{g}\mathrm{r}\mathrm{a}\mathrm{y}}^{\mathrm{h}\mathrm{m}}-{I}_{\mathrm{r}\mathrm{e}\mathrm{f}, \mathrm{g}\mathrm{r}\mathrm{a}\mathrm{y}}^{}\right| $ | (1) |
其中:
中值图像均衡(MIE)运动区域检测流程如图 1所示。
![]() |
Download:
|
图 1 直方图处理后的运动区域检测结果 Fig. 1 Motion region detection results after histogram processing |
当输入图像存在大量的曝光像素时,直方图匹配后的输入图像和参考图像整体亮度差异较大,由差分图无法区分输入图像的运动区域与静态区域(见图 1(c)和图 1(f))。针对这一问题,本文提出了中值直方图均衡的图像运动区域检测算法。中值直方图均衡算法是DELON等[12]在2004年提出的,该直方图处理算法可以描述为将两幅图像的直方图调整为其调和平均数,在保持图像原有灰度动态的前提下得到直方图分布相同的两幅图像。因此,通过中值直方图均衡算法处理输入图像与参考图像的直方图,得到曝光基本一致图像对,如图 1(d)、图 1(e)所示。通过计算中值直方图均衡处理后的图像对的差分图达到运动区域检测的目的,再将得到的差分图优化处理得到最终的运动目标。
MIE运动区域检测流程如图 2所示。
![]() |
Download:
|
图 2 MIE运动区域检测流程 Fig. 2 Procedure of MIE motion region detection |
输入图像和参考图像中值直方图均衡的计算过程为:
$ \left\{{I}_{i}^{\mathrm{m}\mathrm{i}\mathrm{e}}, {I}_{\mathrm{r}\mathrm{e}\mathrm{f}, i}^{\mathrm{m}\mathrm{i}\mathrm{e}}\right\}={M}_{\mathrm{M}\mathrm{I}\mathrm{E}}\left({I}_{i}, {I}_{\mathrm{r}\mathrm{e}\mathrm{f}}\right) $ | (2) |
其中:
$ {D}_{i}^{\mathrm{m}\mathrm{i}\mathrm{e}}=\left|{I}_{i, \mathrm{g}\mathrm{r}\mathrm{a}\mathrm{y}}^{\mathrm{m}\mathrm{i}\mathrm{e}}-{I}_{\mathrm{r}\mathrm{e}\mathrm{f}, \mathrm{i}, \mathrm{g}\mathrm{r}\mathrm{a}\mathrm{y}}^{\mathrm{m}\mathrm{i}\mathrm{e}}\right| $ | (3) |
其中:
$ {{W}_{i}^{n}}^{\mathrm{\text{'}}}(i, j)=\left\{\begin{array}{l}1, {D}_{i}^{n}(i, j) > \tau \\ 0, \mathrm{其}\mathrm{他}\end{array}\right., n=\mathrm{h}\mathrm{m}, \mathrm{m}\mathrm{i}\mathrm{e} $ | (4) |
其中:
$ {W}_{i}^{n}=\left(\left({{W}_{i}^{n}}^{\mathrm{\text{'}}}\odot {B}_{1}\right)\mathrm{♁}{B}_{2}\right)\mathrm{♁}{B}_{1}\mathrm{♁}{B}_{2}, n=\mathrm{h}\mathrm{m}, \mathrm{m}\mathrm{i}\mathrm{e} $ | (5) |
其中:
![]() |
Download:
|
图 3 运动权重图 Fig. 3 Motion weight map |
为了得到亮度连续的静态输入图像,本文利用亮度映射函数处理参考图像。根据运动权重图将处理后的参考图像和输入图像进行加权求和,获得同参考图像运动内容相同的静态图像序列。生成静态多曝光图像流程如图 4所示。
![]() |
Download:
|
图 4 静态多曝光图像流程 Fig. 4 Procedure of static multi-exposure images |
由于输入图像与参考图像亮度差异大,将输入图像的运动区域直接替换为参考图像对应的区域会出现图像亮度不连续的情况。为了得到一组自然的静态图像序列,引入IMF[14]处理参考图像,得到与参考图像内容一致且与其余输入图像亮度分布相同的图像序列
$ {\tilde{I}}_{\mathrm{r}\mathrm{e}\mathrm{f}, i}={I}_{\mathrm{I}\mathrm{M}\mathrm{F}}({I}_{i}, {I}_{\mathrm{r}\mathrm{e}\mathrm{f}}) $ | (6) |
其中:
将输入图像序列
$ {\widehat{I}}_{i}^{n}=\left\{\begin{array}{l}(1-{W}_{i}^{n})\cdot {I}_{i}+{W}_{i}^{n}\cdot {\tilde{I}}_{\mathrm{r}\mathrm{e}\mathrm{f}, i}, i\ne \mathrm{r}\mathrm{e}\mathrm{f}\\ {I}_{\mathrm{r}\mathrm{e}\mathrm{f}}, \mathrm{其}\mathrm{他}\end{array}\right., n=\mathrm{h}\mathrm{m}, \mathrm{m}\mathrm{i}\mathrm{e} $ | (7) |
针对获得的静态图像序列融合,本文使用MA等[15]提出的一种结构块分解方法。首先利用滑动窗口技术在图像中获取大小相等的图像块,并将得到的图像块
$ {x}_{k}=‖{x}_{k}-{\mu }_{{x}_{k}}‖\cdot \frac{{x}_{k}-{\mu }_{{x}_{k}}}{‖{x}_{k}-{\mu }_{{x}_{k}}‖}+{\mu }_{{x}_{k}}=‖{\tilde{x}}_{k}‖\cdot \frac{{\tilde{x}}_{k}}{‖{\tilde{x}}_{k}‖}+{\mu }_{{x}_{k}}={c}_{k}\cdot {s}_{k}+{l}_{k} $ | (8) |
其中:
$ \widehat{c}=\underset{1\le k\le K}{\mathrm{m}\mathrm{a}\mathrm{x}}{c}_{k}=\underset{1\le k\le K}{\mathrm{m}\mathrm{a}\mathrm{x}}‖{\tilde{x}}_{k}‖ $ | (9) |
其中:
$ \widehat{s}=\frac{\stackrel{-}{s}}{‖\stackrel{-}{s}‖}, \stackrel{-}{s}=\frac{\sum \limits_{k=1}^{K}S\left({\tilde{x}}_{k}\right){s}_{k}}{\sum \limits_{k=1}^{K}S\left({\tilde{x}}_{k}\right)} $ | (10) |
$ S\left({\tilde{x}}_{k}\right)={‖{\tilde{x}}_{k}‖}^{p} $ | (11) |
其中:
$ \widehat{l}=\frac{\sum \limits_{k=1}^{K}L({\mu }_{k}, {l}_{k}){l}_{k}}{\sum \limits_{k=1}^{K}L({\mu }_{k}, {l}_{k})} $ | (12) |
$ L({\mu }_{k}, {l}_{k})=\mathrm{e}\mathrm{x}\mathrm{p}\left(-\frac{({\mu }_{k}{-0.5)}^{2}}{2{\sigma }_{g}^{2}}-\frac{({l}_{k}{-0.5)}^{2}}{2{\sigma }_{l}^{2}}\right) $ | (13) |
其中:
$ \widehat{x}=\widehat{c}\cdot \widehat{s}+\widehat{l} $ | (14) |
对同一场景下曝光程度不同的图像序列进行融合,将本文算法与DDHR[10]、FMMR[17]、DGF[18]、FMSD[19]、PMF[20] 5种算法进行对比分析。实验环境为Intel Core i5处理器,3 GHz主频,8 GB内存,64位Windows10操作系统,Matlab2016a。
4.1 主观视觉分析为了全面地评价融合结果,图 5~图 10给出了7种不同算法对3组动态多曝光图像序列融合后的结果(彩图效果见《计算机工程》官网HTML版)。由图 5(b)、图 7(b)和图 9(b)可以看出,DDHR算法融合图像能够消除鬼影现象,但是丢失了源图像的色彩信息,融合图像色彩饱和度低。从图 6(b)、图 6(c)、图 8(b)、图 8(c)和图 10(b)、图 10(c)可以看出,FMMR算法和DGF算法的融合结果中仍出现了明显的鬼影,说明这两种算法不能有效地解决运动物体对融合结果产生的影响。FMSD算法和PMF算法的融合结果在图 10(d)和图 10(e)中显示能够有效地去除鬼影,但是FMSD算法在Campus图像序列如图 7(e)所示在天空云的边缘出现了不连续的现象。从3组图像的局部放大图来看,FMSD算法和PMF算法在颜色内容保存方面不如本文算法。PMF算法的融合图像在图 8(e)的路人头部出现透明现象,在图 10(e)中的天空中大面积出现了失真,丢失了源图像的细节信息,在局部细节信息保存方面不如本文算法。根据融合结果总体分析,本文提出的直方图匹配融合算法(Ours1)和中值直方图均衡融合算法(Ours2)的融合结果实现了动态多曝光融合图像鬼影消除,相比于其他5种算法具有一定优势。但是如图 6(f)所示,Ours1在人“手腕”的部位出现了明显的不连续情况。因此,Ours2方法能更大限度地保存源图像的颜色和细节信息,其运动区域更符合人眼视觉感知。
![]() |
Download:
|
图 5 YWFusion图像序列中不同算法融合结果 Fig. 5 Fusion results of different algorithms for YWFusion image sequences |
![]() |
Download:
|
图 6 YWFusion图像序列中融合结果局部放大图 Fig. 6 Drawing of partial enlargement in of YWFusion image sequence fusion results |
![]() |
Download:
|
图 7 Campus图像序列中不同算法融合结果 Fig. 7 Fusion results of different algorithms for Campus image sequences |
![]() |
Download:
|
图 8 Campus图像序列融合结果的局部放大图 Fig. 8 Drawing of partial enlargement in of Campus image sequence fusion results |
![]() |
Download:
|
图 9 Tate3图像序列中不同算法融合结果 Fig. 9 Fusion results of different algorithms for Tate3 image sequences |
![]() |
Download:
|
图 10 Tate3图像序列融合结果的局部放大图 Fig. 10 Drawing of partial enlargement in of Tate3 image sequence fusion results |
为了客观地评估7种算法的融合结果,本文选用标准差(SD)[21]、边缘强度(EI)[22]、相关系数(Corr)[23]和动态场景结构一致(SSIM-d)[24]作为客观评价指标,分别对不同动态场景下3组多曝光图像序列的融合结果进行评价。表 1~表 4是不同算法的3组融合结果在4个客观指标下的实验数据,表中加粗数据表示在同一张图像中取得的最优值。
![]() |
下载CSV 表 1 SD指标对比 Table 1 SD index comparison |
![]() |
下载CSV 表 2 EI指标对比 Table 2 EI index comparison |
![]() |
下载CSV 表 3 Coor指标对比 Table 3 Coor index comparison |
![]() |
下载CSV 表 4 SSIM-d指标对比 Table 4 SSIM-d index comparison |
由表 1~表 4可以看出,本文提出的2种算法在4个客观评价指标下得到的大部分数据处于较高水平。SD指标代表图像的对比度,DGF算法、FMSD算法和本文算法的融合结果相比其他算法处于较高的水平,说明DGF、FMSD和本文算法融合结果的对比度较高。EI指标表示图像边缘信息表达能力,Ours2算法在YWFusion和Campus两组图像中都取得了最优值,说明Ours2算法相比于Ours1算法能更精确地检测到运动区域,使得融合结果更多地保留亮区和暗区边缘信息,融合图像层次清晰。SSIM-d是针对动态场景下多曝光融合图像而设计的结构相似性指标,本文的算法在Corr和SSIM-d 2个指标上相比于其他算法取值较优,说明本文的算法在包含源图像信息方面性能较好。结合主观和客观评价可知,本文基于直方图处理的动态多曝光融合图像去鬼影算法优于其他算法,能够准确地检测出动态多曝光源图像序列的运动区域并生成一幅自然且无鬼影的融合图像,具有更好的融合性能。
5 结束语本文提出一种中值直方图均衡的动态场景多曝光图像融合算法。利用中值直方图均衡算法调整输入图像和参考图像的亮度差异,消除了因背景曝光不同而对运动区域检测产生的影响。根据差分法和阈值分割检测运动区域,采用形态学处理优化运动权重图提高源图像中运动区域检测的准确性。通过IMF调整参考图像的亮度,从而生成一组自然的静态图像序列。实验结果表明,本文算法能够消除传统融合算法所产生的鬼影,得到一幅生动自然的融合图像。虽然本文算法能够产生无鬼影的融合图像,但是算法复杂度高,在运行速度方面不具备优势。下一步将降低算法复杂度,并将算法应用于实时图像和视频处理。
[1] |
ZHANG X C. Benchmarking and comparing multi-exposure image fusion algorithms[J]. Information Fusion, 2021, 74: 111-131. DOI:10.1016/j.inffus.2021.02.005 |
[2] |
NIE T, HUANG L, LIU H X, et al. Multi-exposure fusion of gray images under low illumination based on low-rank decomposition[J]. Remote Sensing, 2021, 13(2): 204. DOI:10.3390/rs13020204 |
[3] |
QI Y, ZHOU S B, ZHANG Z H, et al. Deep unsupervised learning based on color un-referenced loss functions for multi-exposure image fusion[J]. Information Fusion, 2021, 66: 18-39. DOI:10.1016/j.inffus.2020.08.012 |
[4] |
陈扬, 李大威. 基于场景模态深度理解网络的单目图像深度理解[J]. 计算机工程, 2021, 47(2): 268-278. CHEN Y, LI D W. Monocular image depth understanding based on scene modality depth understanding network[J]. Computer Engineering, 2021, 47(2): 268-278. (in Chinese) DOI:10.19678/j.issn.1000-3428.0059554 |
[5] |
GALLO O, GELFANDZ N, CHEN W C, et al. Artifact-free high dynamic range imaging[C]//Proceedings of 2009 IEEE International Conference on Computational Photography. Washington D. C., USA: IEEE Press, 2009: 1-7.
|
[6] |
LIU Y, WANG Z F. Dense SIFT for ghost-free multi-exposure fusion[J]. Journal of Visual Communication and Image Representation, 2015, 31: 208-224. DOI:10.1016/j.jvcir.2015.06.021 |
[7] |
PECE F, KAUTZ J. Bitmap movement detection: HDR for dynamic scenes[C]//Proceedings of 2010 International Conference on Visual Media Production. London, UK: [s. n. ], 2010: 1-8.
|
[8] |
HA H G, YUAN X, FIERRO M, et al. Ghost removal in exposure fusion by temporal consistency assessment[J]. Journal of Imaging Science and Technology, 2016, 60(4): 405-416. |
[9] |
KALANTARI N K, RAMAMOORTHI R. Deep high dynamic range imaging of dynamic scenes[J]. ACM Transactions on Graphics, 2017, 36(4): 1-12. |
[10] |
WU S Z, XU J R, TAI Y W, et al. Deep high dynamic range imaging with large foreground motions[C]//Proceedings of IEEE ECCV'18. Washington D. C., USA: IEEE Press, 2018: 120-135.
|
[11] |
王春智, 牛宏侠. 基于直方图均衡化和MSRCR的沙尘降质图像增强算法[J/OL]. 计算机工程: 1-8. [1-11-02]. https://doi.org/10.19678/j.issn.1000-3428.0062764. WANG C Z, NIU H X. A sand-dust degraded image enhancement algorithm based on histogram equalization and MSRCR[J/OL]. Computer Engineering: 1-8[2021-11-02]. https://doi.org/10.19678/j.issn.1000-3428.0062764. (in Chinese) |
[12] |
DELON J. Midway image equalization[J]. Journal of Mathematical Imaging and Vision, 2004, 21(2): 119-134. DOI:10.1023/B:JMIV.0000035178.72139.2d |
[13] |
OTSU N. A threshold selection method from gray-level histograms[J]. IEEE Transactions on Systems, Man, and Cybernetics, 1979, 9(1): 62-66. DOI:10.1109/TSMC.1979.4310076 |
[14] |
GROSSBERG M D, NAYAR S K. Determining the camera response from images: what is knowable?[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2003, 25(11): 1455-1467. DOI:10.1109/TPAMI.2003.1240119 |
[15] |
MA K D, LI H, YONG H W, et al. Robust multi-exposure image fusion: a structural patch decomposition approach[J]. IEEE Transactions on Image Processing, 2017, 26(5): 2519-2532. DOI:10.1109/TIP.2017.2671921 |
[16] |
LIU S G, ZHANG Y. Detail-preserving underexposed image enhancement via optimal weighted multi-exposure fusion[J]. IEEE Transactions on Consumer Electronics, 2019, 65(3): 303-311. DOI:10.1109/TCE.2019.2893644 |
[17] |
LI S T, KANG X D. Fast multi-exposure image fusion with median filter and recursive filter[J]. IEEE Transactions on Consumer Electronics, 2012, 58(2): 626-632. DOI:10.1109/TCE.2012.6227469 |
[18] |
HAYAT N, IMRAN M. Ghost-free multi exposure image fusion technique using dense SIFT descriptor and guided filter[J]. Journal of Visual Communication and Image Representation, 2019, 62: 295-308. DOI:10.1016/j.jvcir.2019.06.002 |
[19] |
LI H, MA K D, YONG H W, et al. Fast multi-scale structural patch decomposition for multi-exposure image fusion[J]. IEEE Transactions on Image Processing, 2020, 29(2): 5805-5816. |
[20] |
QIN X M, SHEN J B, MAO X Y, et al. Robust match fusion using optimization[J]. IEEE Transactions on Cybernetics, 2015, 45(8): 1549-1560. DOI:10.1109/TCYB.2014.2355140 |
[21] |
LIU Y, LIU S P, WANG Z F. A general framework for image fusion based on multi-scale transform and sparse representation[J]. Information Fusion, 2015, 24: 147-164. DOI:10.1016/j.inffus.2014.09.004 |
[22] |
刘兆栋. 基于稀疏表示理论的图像去噪与融合算法研究[D]. 重庆: 重庆大学, 2016. LIU Z D. Research on image denoising and fusion based on sparse representation[D]. Chongqing: Chongqing University, 2016. (in Chinese) |
[23] |
DESHMUKH M, BHOSALE U. Image fusion and image quality assessment of fused images[J]. International Journal of Image Processing, 2010, 4(5): 484-508. |
[24] |
FANG Y, ZHU H, MA K, et al. Perceptual evaluation for multi-exposure image fusion of dynamic scenes[J]. IEEE Transactions on Image Processing, 2020, 29(5): 1127-1138. |