﻿ 基于Vibe背景建模的运动目标检测算法
 计算机系统应用  2019, Vol. 28 Issue (4): 183-187 PDF

Moving Target Detection Algorithm Based on Vibe Background Modeling
DING Zhe, LU Wen-Zong
School of Electronic Information Engineering, Xi’an Technology University, Xi’an 710021, China
Foundation item: Natural Science Foundation of Shaanxi Province (2016JM8095)
Abstract: In the process of moving target detection, the traditional algorithm is based on modeling a single feature background, and the background description is not accurate enough. To solve this problem, this study proposes an algorithm based on Vibe background modeling that incorporates color and edge features. The proposed algorithm solves the problem of noise, breakpoints, and internal pores in the moving target detection result of the three-frame difference algorithm, and compensates the image processing results based on the morphological processing algorithm. In order to ensure the accuracy of moving target detection and speed up the elimination of the " ghosting” phenomenon in the first frame of Vibe algorithm, this study combines Vibe algorithm and improved three-frame difference algorithm to realize real-time detection of moving targets. Through research analysis and computational derivation, the detection results of moving targets in the experiment show that the improved three-frame difference algorithm based on Vibe background modeling is better than the three-frame difference algorithm.
Key words: moving target detection     Vibe algorithm     three-frame difference algorithm

1 基于Vibe的背景建模

1.1 融入颜色和边缘特征的Vibe算法

Vibe背景建模算法是一种基于像素特征非参数化聚类的算法, 在模板的初始化阶段, 用视频的第一帧图像为每个像素点建立一个模型, 根据目标的运动和背景的变化, 对应像素的背景模型可以自适应选择, 同时为了避免由于检测的背景与前景相似造成的误检[5], 将目标的颜色和边缘特征加入算法, 改善了基于单一特征背景建模算法对背景描述的不准确现象.

1.2 初始化背景建模

Vibe模型的初始化只需要一帧图像就能实现[6], 但像素点的时空分布信息不能在单帧图像中显现出来, 为了得到初始化模型像素点的时空分布信息, 需要随机选择一个像素点, 然后把它的领域像素点作为模型样本集的初始值, 可用式(1)表示.

 ${P_1}\left( x \right) = \left\{ {{V_1}} \right.\left. {(y|y \in K'\left( x \right))} \right\}$ (1)

 图 1 Vibe背景模型

1.3 前景检测

 $r\left( {x,y} \right) = \left\{ \begin{array}{l} 255,\;\;Q\left\{ {M\left( {x,y} \right) \cap {C_R}\left( {V\left( x \right)} \right)} \right\} < {Q_{\min }}\\ 0,\;\;{\rm{other}} \end{array} \right.$ (2)

 $\begin{array}{l} Q\left\{ {\left( {x,y} \right) \cap {C_R}\left( {V\left( x \right)} \right)} \right\} = \\ \left\{ \begin{array}{l} Q + 1,\;\;{{dist}}\left\{ {\left\{ {{v_i}\left( {x,y} \right)|{v_i}\left( {x,y} \right) \in M\left( {x,y} \right)} \right\},{{v}}\left( {{{x}},{{y}}} \right)} \right\} < R\\ Q,\;\;{{dist}}\left\{ {\left\{ {{v_i}\left( {x,y} \right)|{v_i}\left( {x,y} \right) \in M\left( {x,y} \right)} \right\},{{v}}\left( {{{x}},{{y}}} \right)} \right\} \ge R \end{array} \right. \end{array}$

1.4 背景模型自适应更新

 ${L_k}({V_x}) = {\min _k}\;\;\;{{dist}}(D({V_X}),{V_X})$ (3)

 ${\overline d _{\min }}({P_x}) = \frac{1}{k}\sum\limits_{t = 1}^k {{L_k}({V_x})}$ (4)

 $U'({V_x}) = \left\{ \begin{gathered} U({V_{x1}}) + \frac{1}{{{{\overline d }_{\min }}({V_{x1}})}} \\ U({V_{x2}}) - \frac{1}{{{{\overline d }_{\min }}({V_{x2}})}} \\ \end{gathered} \right.$ (5)

 $R({V_x}) = \left\{ \begin{gathered} R({V_x})*(1 - {{a}}),\;\;R({V_x}) > b*{\overline d _{\min }} \\ R({V_x})*(1 + a),\;\;R({V_x}) < b*{\overline d _{\min }} \\ \end{gathered} \right.$ (6)

 图 2 改进前后Vibe算法去除鬼影仿真效果图

2 改进的三帧差分法

 ${q_1}(x,y) = \left\{ \begin{gathered} 255,\;\;\left| {{f_k}(x,y) - {f_{k - 1}}(x,y)} \right| > T \\ 0,\;\;\left| {{f_k}(x,y) - {f_{k - 1}}(x,y)} \right| \leqslant T \\ \end{gathered} \right.$ (7)
 图 3 改进的三帧差分流程

 ${q_2}(x,y) = \left\{ \begin{gathered} 255,\;\;\left| {{f_{k + 1}}(x,y) - {f_k}(x,y)} \right| > T \\ 0,\;\;\left| {{f_{k + 1}}(x,y) - {f_k}(x,y)} \right| \leqslant T \\ \end{gathered} \right.$ (8)

 $\left\{\begin{array}{l} {q_3}\left( {x,y} \right) = {q_1}\left( {x,y} \right) \cap {q_2}\left( {x,y} \right)\\ {q_3} = \left\{ \begin{array}{l} 255,\;\;{\rm{if}}({q_1}(x,y) = 255,{q_{\rm{2}}}(x,y) = 255)\\ 0,\;\;{\rm{other}} \end{array} \right. \end{array}\right.$ (9)

 $\left\{\begin{array}{l} {q_4}(x,y) = {q_1}(x,y) \otimes {q_3}(x,y)\\ {q_4}(x,y) = \left\{ \begin{array}{l} 255,\;\;{\rm{if}}({q_1}(x,y)! = {q_3}(x,y))\\ 0,\;\;{\rm{other}} \end{array} \right. \end{array}\right.$ (10)

 $dst(x,y) = \left\{ \begin{gathered} \\ \\ \end{gathered} \right.\begin{array}{*{20}{c}} {\max \;\;\;src(x + x',y + y')} \\ {(x',y'):element(x',y') \ne 0} \end{array}$ (11)

 $\left\{\begin{array}{l} q(x,y) = {q_3}(x,y) \cap {q_4}(x,y)\\ q = \left\{ \begin{array}{l} 255,\;\;{\rm{if}}({q_3}(x,y) = 255,{q_4}(x,y) = 255)\\ 0,\;\;{\rm{other}} \end{array} \right. \end{array}\right.$ (12)

3 基于Vibe背景建模的三帧差分法

 图 4 基于Vibe建模的三帧差分法流程图

4 实验分析

 图 5 文中算法-传统算法仿真对比效果图

5 结论与展望

 [1] 朱虹. 数字图像处理基础. 北京: 科学出版社, 2005. [2] 王伟. 复杂环境下移动机器人的动态目标检测与跟踪控制研究[硕士学位论文]. 西安: 西安建筑科技大学, 2015. [3] 罗鸿斌. 基于Vibe的改进运动目标检测算法. 自动化与仪器仪表, 2018(3): 51-54. [4] 孟琦. Vibe和多特征提取相结合的微动目标检测算法研究[硕士学位论文]. 重庆: 重庆邮电大学, 2017. [5] 程武. 基于OpenCV运动目标检测与跟踪方法研究[硕士学位论文]. 沈阳: 沈阳航空航天大学, 2017. [6] Barnich O, Van Droogenbroeck M. ViBe: A universal background subtraction algorithm for video sequences. IEEE Transactions on Image Processing, 2011, 20(6): 1709-1724. DOI:10.1109/TIP.2010.2101613 [7] 张晓伟. 视频中运动目标的检测与跟踪算法研究及应用[硕士学位论文]. 济南: 山东师范大学, 2013. [8] 赵建. 基于三帧差法的运动目标检测方法研究[硕士学位论文]. 西安: 西安电子科技大学, 2013. 2–4. [9] Betke M, Haritaoglu E, Davis LS. Real-time multiple vehicle detection and tracking from a moving vehicle. Machine Vision and Applications, 2000, 12(2): 69-83. DOI:10.1007/s001380050126 [10] Sharma L, Yadav DK, Bharti SK. An improved method for visual surveillance using background subtraction technique. Proceedings of the 2nd International Conference on Signal Processing and Integrated Networks. Noida, India. 2015. 421–426. [11] 薛丽霞, 罗艳丽, 王佐成. 基于帧间差分的自适应运动目标检测方法. 计算机应用研究, 2011, 28(4): 1551-1552, 1559. DOI:10.3969/j.issn.1001-3695.2011.04.098 [12] 谢红, 原博, 解武. 一种基于改进三帧差分和ViBe算法的运动目标检测算法. 应用科技, 2016, 43(6): 46-52. [13] Ekpar F. A framework for intelligent video surveillance. Proceedings of the IEEE 8th International Conference on Computer and Information Technology Workshops. Sydney, QLD, Australia. 2008. 421–426.