目的 目标检测在智能交通、自动驾驶以及安防监控中有重要的地位，ViBe算法是常用的运动目标检测算法，它主要由背景模型初始化，前景检测，背景模型更新三部分组成，其思想简单，易于实现，运算效率高，但当初始帧有运动目标时，检测结果会出现“鬼影”现象，且易受噪声和光照变化影响，不能适应动态场景。同时，其逐帧逐像素进行前景检测，在计算复杂度方面有较大提升空间。为解决这些问题，提出一种改进的ViBe算法，称为ViBeImp算法。方法 在背景模型初始化时，用多帧平均法给出初始背景，采用该初始背景构建初始背景样本模型。在前景检测过程中，采用背景差分法、帧差法与OTSU算法相结合给出半径阈值的自适应计算方法。同时，根据背景差分法找出运动区域，只对运动区域进行前景判断和模型更新，降低算法的计算复杂度。结果 对25个不同场景视频分别给出ViBeImp算法在初始化背景、自适应半径阈值和计算复杂度方面改进的结果及有效性指标，实验结果表明，与ViBe算法、ViBeDiff2算法和ViBeIniR 算法，以及Surendra算法和高斯混合模型相比，ViBeImp算法对噪声，光照和背景动态变化有较好的鲁棒性，检测结果更完整，且实时性较好。同时，ViBeImp算法将ViBe算法的查准率、查全率以及F1值分别提高了17.98%、11.40%和15.96%。结论 ViBeImp算法采用多帧平均法构建初始背景可有效地消除“鬼影”，并给出半径阈值的自适应计算方法，使ViBe算法更快适应视频环境变化，准确且完整地检测出运动目标，具有较低的误检率和漏检率。该方法克服了ViBe算法对初始背景以及视频环境的依赖，很大程度上提高了运算速度，具有很好的鲁棒性和适用性。
Improved ViBe Algorithm for Moving Objects Detection
Yang Dan,Dai Fang(Xi''an University of Technology)
Objective Effective detection of moving objects is a prerequisite for real-time tracking, behavior analysis, and behavioral judgment. Moving objects detection has been widely applied in fields of security, intelligent transportation, military, medical and aerospace, etc. It is a key issue in the field of computer vision. Common methods of moving objects detection include optical flow method, frame difference method, background subtraction method, etc. Optical flow method detect the moving region in the image sequence by using the vector feature of the moving objects. It works well in the case of background motion, but the computation is complex and time-consuming. Frame difference method take the absolute value of difference between two adjacent frames to detect moving objects. The algorithm is simple, and has good robustness, but its detection results are easily affected by the noise, and it is easy to produce "void". In contrast, the background subtraction method is the most common method of moving objects detection, in which the moving region is detected by the difference between the current frame and background. It is simple and easy to implement, besides, it can extract the object more completely. ViBe algorithm is one of the commonly used background subtraction method. It is mainly composed of background model initialization, foreground detection, and background model update, which idea is simple, and easy to implement with highly efficient. However, when the initial frame contains moving objects, the "ghost" phenomenon occurs, and it has the poor adaptability to noise, illumination and dynamic environment. At the same time, the ViBe algorithm conduct foreground detection on each frame pixel-by-pixel, which has a large room for improvement regarding computational complexity. So in this paper, we improve the ViBe algorithm and propose the ViBeImp algorithm. Method For the ViBe algorithm construct the background sample with the first frame of the video which contains the moving objects will lead to the appearance of "ghost", there are currently three solutions, one is to change the way of the background model initialization, one is to speed up the elimination of the "ghost" , and the third is to combine with other methods to detect the "ghost" areas, then deal with them. Accelerating the elimination of "ghost" does not fundamentally eliminate "ghost" and it will still lead to false detection in the initial part of the "ghost". Combined with other methods to detect the "ghost" , it will increase the complexity of the algorithm and the amount of calculation of the algorithm. Therefore, we use the method of changing the initialization of the background model to eliminate "ghost". In ViBeImp algorithm the initial background used for initial background sample model is given by the Multi-frame average method, which can eliminate "ghost" to some extent. Different calculation methods of radius threshold will directly affect the performance of foreground detection. An suitable radius threshold can adapt to changes in light and dynamic scenes in the video, which can effectively reduce the occurrence of missed detection and false detection. So in the process of foreground detection, a self-adaptive calculation method of radius threshold is given by combining background subtraction method, frame difference method, and OTSU algorithm. At the same time, the foreground detection and model update is conducted only in the motion area which is obtained according to the background difference method to reduce the computational complexity of the algorithm. Result Firstly, the detection results of the ViBeImp algorithm, ViBe algorithm, ViBeDiff2 algorithm and the ViBeIniR algorithm in 25 different scenes which are selected from several public datasets such as MOTChallenge，CDNET, and ViSOR et al are given, along with their corresponding precision, recall and F1 values. Secondly, the improved detection results and effectiveness of the ViBeImp algorithm in the initialization background, the adaptive radius threshold and the computational complexity are given respectively. When only the background initialization method is different from the ViBe algorithm, the ViBeImp algorithm improves the precision, recall, and F1 value of the ViBe algorithm by 13.73%, 3.15%, and 9.44%, respectively. Only when the radius threshold calculation method is different from the ViBe algorithm, the ViBeImp algorithm improves ViBe algorithm the precision, recall, and F1 value by 11.14%, 10.09%, and 12.35%, respectively. In terms of computational complexity, the average processing time per frame of the four methods is given, and in the 25 videos there are 19 videos’ average processing time per frame of the ViBeImp algorithm is lower than the ViBe algorithm, which shows the effectiveness of our improvement in the computational complexity. Finally, the comparison between the ViBeImp algorithm, Surendra algorithm and Gaussian mixture model which are commonly used in moving objects detection is given. Experimental results shows that compared with ViBe algorithm, ViBeDiff2 algorithm, ViBeIniR algorithm, Surendra algorithm and Gaussian Mixture Model, the ViBeImp algorithm is robust to noise, illumination and dynamic environment with complete detection results and better performance in real-time. Simultaneously, the ViBeImp algorithm improves the precision, recall and F1 of the ViBe algorithm by 17.98%, 11.40% and 15.96% respectively. Conclusion The ViBeImp algorithm uses multi-frame average method to construct the initial background, which can effectively eliminate the “ghost”. And the self-adaptive calculation method of radius threshold is given, which can make the ViBe algorithm adapt to the change of video environment more quickly and detect the moving objects accurately and completely. It is a kind of algorithm with low false alarm rate and missed detection rate. The method overcomes the dependence of ViBe algorithm on the initial background and the video environment, and reduces the computational complexity to a great extent, with a good robustness and applicability.