廖斌 吳文
摘 要:傳統(tǒng)方法在處理自由移動(dòng)相機(jī)捕獲視頻中的陰影時(shí),存在時(shí)空不連貫現(xiàn)象。為解決該問題,提出一種區(qū)域配對(duì)引導(dǎo)的光照傳播陰影去除方法。首先,使用基于尺度不變特征變換(SIFT)特征向量的均值漂移方法分割視頻,通過(guò)支持向量機(jī)(SVM)分類器檢測(cè)出其中的陰影;然后,將輸入視頻幀分解成重疊的二維圖像區(qū)域塊,建立其馬爾可夫隨機(jī)場(chǎng)(MRF),通過(guò)光流引導(dǎo)的區(qū)域塊匹配機(jī)制,為每一個(gè)陰影塊找到最佳匹配的非陰影塊;最后,使用局部光照傳播算子恢復(fù)陰影區(qū)域塊的光照,并對(duì)其進(jìn)行全局光照優(yōu)化。實(shí)驗(yàn)結(jié)果表明,與傳統(tǒng)基于光照傳播方法相比,所提方法在陰影檢測(cè)綜合評(píng)價(jià)指標(biāo)上提升約6.23%,像素均方根誤差(RMSE)減小約30.12%,且大幅度縮短了陰影處理時(shí)間,得到的無(wú)陰影視頻結(jié)果更具時(shí)空連貫性。
關(guān)鍵詞:視頻陰影;區(qū)域配對(duì);光照傳播;陰影去除;光流
中圖分類號(hào): TP391.41
文獻(xiàn)標(biāo)志碼:A
Abstract: In order to solve spatio-temporally incoherent problem of traditional shadow removal methods for videos captured by free moving cameras, a shadow detection and removal approach using region matching guided by illumination transfer was proposed. Firstly, the input video was segmented by using Mean Shift method based on Scale Invariant Feature Transform (SIFT), and the video shadow was detected by Support Vector Machine (SVM) classifier. Secondly, the input video was decomposed into overlapped 2D patches, and a Markov Random Field (MRF) for this video was set up, and the corresponding lit patch for every shadow patch was found via region matching guided by optical flow. Finally, in order to get spatio-temporally coherent results, each shadow patch was processed with its matched lit patch by local illumination transfer operation and global shadow removal. The experimental results show that the proposed algorithm obtains higher accuracy and lower error than the traditional methods based on illumination transfer, the comprehensive evaluation metric is improved by about 6.23%, and the Root Mean Square Error (RMSE) is reduced by about 30.12%. It can obtain better shadow removal results with more spatio-temporal coherence but much less time.
Key words: video shadow; region matching; illumination transfer; shadow removal; optical flow
0 引言
陰影去除在圖像識(shí)別、光照估計(jì)、虛擬現(xiàn)實(shí)場(chǎng)景生成等領(lǐng)域均起到了至關(guān)重要的作用。受陰影檢測(cè)識(shí)別復(fù)雜度的影響,視頻分割與物體檢測(cè)識(shí)別、圖像/視頻本征分解等領(lǐng)域算法的準(zhǔn)確性和效率都會(huì)大大降低。此外,提取到的陰影可用于圖像/視頻場(chǎng)景編輯,從而生成更為生動(dòng)的圖像/視頻效果。因此,視頻陰影去除一直是視頻處理領(lǐng)域的一個(gè)研究熱點(diǎn)。
單幅圖像陰影檢測(cè)以及去除已經(jīng)得到較為深入的研究[1-6]。文獻(xiàn)[1]提出了一個(gè)基于成對(duì)區(qū)域的單幅圖像陰影去除方法,使用自定義的低級(jí)特征檢測(cè)陰影,然后基于物理光照模型去除陰影,但處理高清圖像效率低下;
上述方法均不能建立有效的背景模型,處理后的無(wú)陰影視頻在時(shí)空域上不能保持一致連貫性。為此,本文提出一種視頻陰影去除框架,能夠高效處理靜態(tài)相機(jī)或自由移動(dòng)相機(jī)捕獲到的視頻。首先,使用連貫性的塊匹配機(jī)制和局部光照傳播最優(yōu)化技術(shù)為每個(gè)陰影塊恢復(fù)其光照信息;然后,進(jìn)行全局優(yōu)化和陰影邊界處理。經(jīng)過(guò)一系列實(shí)驗(yàn),與已有的基于光照傳播的視頻陰影去除方法相比,所提方法在效率和效果上均有較大的提升。
1 視頻陰影檢測(cè)
給定輸入視頻V(x,y,t)。其中:x,y為像素點(diǎn)的坐標(biāo);t為時(shí)間分量。首先,基于尺度不變特征變換(Scale Invariant Feature Transform,SIFT)對(duì)視頻進(jìn)行均值漂移(Mean Shift)分割;然后,對(duì)分割后場(chǎng)景陰影圖像的各個(gè)區(qū)域分別提取色彩及紋理信息;最后利用文獻(xiàn)[1]中的支持向量機(jī)(Support Vector Machine,SVM)方法檢測(cè)出視頻中的陰影區(qū)域。
1.1 視頻分割
在陰影檢測(cè)環(huán)節(jié),為了準(zhǔn)確檢測(cè)出陰影的位置,使用對(duì)光照、旋轉(zhuǎn)、縮放魯棒的SIFT特征向量對(duì)視頻進(jìn)行高維Mean Shift分割。
4 結(jié)語(yǔ)
傳統(tǒng)方法處理自由移動(dòng)相機(jī)捕獲到的視頻時(shí),會(huì)出現(xiàn)時(shí)空不連貫現(xiàn)象,為此本文提出了一種區(qū)域配對(duì)引導(dǎo)的光照傳播視頻陰影去除方法。首先,基于SIFT特征向量對(duì)輸入視頻進(jìn)行分割,進(jìn)而使用支持向量機(jī)分類器對(duì)分割區(qū)域進(jìn)行分類,從而得到輸入視頻的陰影檢測(cè)結(jié)果;然后,將輸入視頻分割成重疊的二維圖像塊,為輸入視頻建立馬爾可夫隨機(jī)場(chǎng),基于光流引導(dǎo)的塊匹配機(jī)制完成陰影區(qū)域的標(biāo)號(hào)問題;最后,使用光照傳播技術(shù),先完成圖像塊的局部光照傳播操作,再進(jìn)行全局優(yōu)化,即可得到時(shí)空連貫的無(wú)陰影視頻。實(shí)驗(yàn)結(jié)果表明,本文方法具有較高的陰影檢測(cè)識(shí)別率,與文獻(xiàn)[14]和文獻(xiàn)[17]的方法相比在陰影綜合評(píng)價(jià)指標(biāo)上有一定提升;復(fù)原后的圖像誤差較小,在像素的均方根誤差上有所降低;且具有較高的運(yùn)行效率。未來(lái)的工作將考慮結(jié)合多尺度的方法,進(jìn)一步提高算法在面對(duì)紋理復(fù)雜的視頻時(shí)的效果。
參考文獻(xiàn):
[1] GUO R, DAI Q, HOIEM D. Single-image shadow detection and removal using paired regions [C]// Proceedings of the 2011 IEEE Computer Society Conference on Computer Vision and Pattern Recognition. Washington, DC: IEEE Computer Society, 2011: 2033-2040.
[2] ZHENG C, SUN Z-L, WANG N, et al. Moving cast shadow removal based on texture feature and color space [C]// Proceedings of the 2018 International Symposium on Neural Networks, LNCS 10878. Cham: Springer, 2018: 611-618.
[3] XIAO Y, TSOUGENIS E, TANG C. Shadow removal from single RGB-D images [C] // Proceedings of the 2014 IEEE Computer Society Conference on Computer Vision and Pattern Recognition. Washington, DC: IEEE Computer Society, 2014:3011-3018.
[4] KHAN S H, BENNAMOUN M, SOHEL F, et al. Automatic shadow detection and removal from a single image[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2016, 38(3): 431-446.
[5] QU L, TIAN J, HE S, et al. DeshadowNet: a multi-context embedding deep network for shadow removal [C]// Proceedings of the 2017 IEEE Computer Society Conference on Computer Vision and Pattern Recognition. Washington, DC: IEEE Computer Society, 2017: 2308-2316.
[6] 李鵬偉,葛文英,劉國(guó)英.基于陰影概率模型的遙感影像陰影檢測(cè)方法[J].計(jì)算機(jī)應(yīng)用,2015,35(2):510-514. (LI P W, GE W Y, LIU G Y. Shadow detection method based on shadow probability model for remote sensing images[J].Journal of Computer Applications, 2015, 35(2): 510-514.)
[7] JAYNES C O, WEBB S B, STEELE R M. Dynamic shadow removal from front projection displays: US7133083[P]. 2006-11-07.
[8] LEONE A, DISTANTE C, ANCONA N, et al. Texture analysis for shadow removing in video-surveillance systems [C]// Proceedings of the 2004 IEEE International Conference on Systems, Man and Cybernetics. Piscataway, NJ: IEEE, 2004: 6325-6330.
[9] JUNG C R. Efficient background subtraction and shadow removal for monochromatic video sequences [J]. IEEE Transactions on Multimedia, 2009, 11(3):571-577.
[10] LIU Z, HUANG K, TAN T, et al. Cast shadow removal combining local and global features [C]// Proceedings of the 2007 IEEE Computer Society Conference on Computer Vision and Pattern Recognition. Washington, DC: IEEE Computer Society, 2007: 1-8.
[11] MARTEL-BRISSON N, ZACCARIN A. Learning and removing cast shadows through a multidistribution approach [J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2007, 29(7): 1133-1146.
[12] HUANG J B, CHEN C S. Moving cast shadow detection using physics-based features [C]// CVPR 2009:Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition. Washington, DC: IEEE Computer Society, 2009: 2310-2317.
[13] BENEDEK C, SZIRANYI T. Bayesian foreground and shadow detection in uncertain frame rate surveillance videos [J]. IEEE Transactions on Image Processing, 2008, 17(4): 608-621.
[14] XIAO C, SHE R, XIAO D, et al. Fast shadow removal using adaptive multi-scale illumination transfer [J]. Computer Graphics Forum, 2013, 32(8):207-218.
[15] AMATO A, MOZEROV M G, BAGDANOV A D, et al. Accurate moving cast shadow suppression based on local color constancy detection [J]. IEEE Transactions on Image Processing, 2011, 20(10): 2954-2966.
[16] LIU Z, HUANG K, TAN T. Cast shadow removal in a hierarchical manner using MRF [J]. IEEE Transactions on Circuits & Systems for Video Technology, 2012, 22(1): 56-66.
[17] ZHANG L, ZHANG Q, XIAO C. Shadow remover: image shadow removal based on illumination recovering optimization [J]. IEEE Transactions on Image Processing, 2015, 24(11): 4623-4636.
[18] COMANICIU D, MEER P. Mean Shift: a robust approach toward feature space analysis [J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2002, 24(5): 603-619.
[19] ADAMS A, GELFAND N, DOLSON J, et al. Gaussian KD-trees for fast high-dimensional filtering [J]. ACM Transactions on Graphics, 2009, 28(3): Article No. 21.
[20] MARTIN D R, FOWLKES C C, MALIK J. Learning to detect natural image boundaries using local brightness, color, and texture cues [J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2004, 26(5): 530-549.
[21] NG H-F, CHEN I-C, LIAO H-Y. An illumination invariant image descriptor for color image matching [EB/OL]. [2018-04-11]. http://pdfs.semanticscholar.org/56cb/21b1ff1c82e1fa78ed64e4671 80b858d09c2.pdf.
[22] HUANG J-B, KANG S B, AHUJA N, et al. Temporally coherent completion of dynamic video [J]. ACM Transactions on Graphics, 2016, 35(6): Article No. 196.
[23] SHOR Y, LISCHINSKI D. The shadow meets the mask: pyramid-based shadow removal [J]. Computer Graphics Forum, 2008, 27(2): 577-586.
[24] PRATI A, MIKIC I, TRIVEDI M M, et al. Detecting moving shadows: algorithms and evaluation [J]. IEEE Transactions on Pattern Analysis & Machine Intelligence, 2003, 25(7):918-923.