CN106934819A - A kind of method of moving object segmentation precision in raising image - Google Patents
A kind of method of moving object segmentation precision in raising image Download PDFInfo
- Publication number
- CN106934819A CN106934819A CN201710140027.4A CN201710140027A CN106934819A CN 106934819 A CN106934819 A CN 106934819A CN 201710140027 A CN201710140027 A CN 201710140027A CN 106934819 A CN106934819 A CN 106934819A
- Authority
- CN
- China
- Prior art keywords
- image
- pixel
- frame
- pixels
- improving
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 85
- 230000011218 segmentation Effects 0.000 title abstract 2
- 238000012545 processing Methods 0.000 claims abstract description 16
- 230000008569 process Effects 0.000 claims abstract description 14
- 238000001514 detection method Methods 0.000 claims description 25
- 230000000877 morphologic effect Effects 0.000 claims description 14
- 238000001914 filtration Methods 0.000 claims description 11
- 230000003628 erosive effect Effects 0.000 claims description 10
- 230000010339 dilation Effects 0.000 claims description 7
- 238000005429 filling process Methods 0.000 claims description 4
- 230000000630 rising effect Effects 0.000 claims description 3
- 230000007547 defect Effects 0.000 abstract description 4
- 238000011897 real-time detection Methods 0.000 abstract description 2
- 230000006641 stabilisation Effects 0.000 abstract 1
- 238000011105 stabilization Methods 0.000 abstract 1
- 239000000523 sample Substances 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 5
- 230000008901 benefit Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 238000012544 monitoring process Methods 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 239000011800 void material Substances 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000007797 corrosion Effects 0.000 description 1
- 238000005260 corrosion Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000009499 grossing Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000002245 particle Substances 0.000 description 1
- 238000011160 research Methods 0.000 description 1
Landscapes
- Image Analysis (AREA)
Abstract
Description
技术领域technical field
本发明属于图像处理技术领域,特别涉及一种提高图像中运动物体检测精度的方法。The invention belongs to the technical field of image processing, in particular to a method for improving the detection accuracy of moving objects in images.
背景技术Background technique
当前,智能监控技术无论在公司、企业的安全监控,还是在社会的交通管理,亦或是在人们的生活娱乐中都发挥着越来越重要的作用。At present, intelligent monitoring technology is playing an increasingly important role in the security monitoring of companies and enterprises, in the traffic management of society, and in people's life and entertainment.
智能监控技术在理论与实际应用方面都具备重要的研究意义。例如,从安全角度讲,智能监控视频可以对视频内容进行有效的分析,提取出视频中的潜在危险目标。例如银行里可能的抢劫犯,或监控场所的其他运动目标。把这些警告报告给安全监管人员,可以有效提高视频监控的效率,同时还可以节省安全监管的相关费用。从交通管理角度来看,智能视频技术可以对监视路况进行智能的分析,识别监视道路的堵塞程度,或监视跟踪违章行驶车辆,这些都可以帮助交通管理人员更有效的进行交通管理。在人们的休闲娱乐方面,可以通过智能视频识别人的肢体动作,根据识别出的动作和游戏系统进行交互,通过摄像头拍摄识别人的身体运动,完成对游戏的操控。Intelligent monitoring technology has important research significance in both theory and practical application. For example, from a security point of view, intelligent surveillance video can effectively analyze video content and extract potentially dangerous targets in the video. Examples include possible robbers in a bank, or other moving targets in a surveillance location. Reporting these warnings to security supervisors can effectively improve the efficiency of video surveillance and save costs related to security supervision. From the perspective of traffic management, intelligent video technology can intelligently analyze the monitored road conditions, identify the degree of congestion on the monitored roads, or monitor and track illegal driving vehicles, all of which can help traffic managers to conduct traffic management more effectively. In terms of people's leisure and entertainment, it is possible to recognize human body movements through intelligent video, interact with the game system according to the recognized movements, and recognize human body movements through cameras to complete the control of the game.
智能监控中的运动目标检测,是指在序列图像中检测出变化区域并将运动目标从背景图像中提取出来,智能监控中的运动目标检测是运动图像分析、智能监控、可视人机交互中的关键技术。通过运动目标的检测可以得到图像中的运动信息,提取图像中运动目标并对目标进行定位,从而简化了后续的运动跟踪、识别、分析的难度。The moving target detection in intelligent monitoring refers to detecting the changing area in the sequence image and extracting the moving target from the background image. key technologies. The motion information in the image can be obtained through the detection of the moving object, and the moving object in the image can be extracted and positioned, thus simplifying the difficulty of subsequent motion tracking, identification, and analysis.
传统运动目标检测方法主要包括三种:背景差分法、帧间差分法、光流法。近几年来,背景差分法中Vibe算法逐渐得到重视。Traditional moving target detection methods mainly include three types: background difference method, frame difference method, and optical flow method. In recent years, the Vibe algorithm in the background difference method has been paid more and more attention.
Vibe算法是一种像素级的前景检测(或背景建模)方法,其基本思想包括:为每一个像素存储一个样本集,该样本集包含的是这个像素点过去的像素值和它周围邻居点的像素值;当遇到一个新的像素点时,就将新像素点的像素值和样本集中的采集点进行对比,判断这个新的像素点是否是背景点。该算法是对背景点的分类的过程。Vibe算法有着运算效率高、实现效果好、占用内存少和样本衰减最优等优点。但Vibe算法存在由环境中光照、阴影等因素突变导致的鬼影(将前几帧运动物体所覆盖区域错误检测为运动目标)、漏检(是指在图像采集中有些运动物体并没有检测出来)等问题。并且,Vibe算法在检测运动物体时,会使运动物体的检测出现空洞(是指在检测时物体本身是运动的,但是检测出来后显示运动物体的某些部分却是静止的)。如图3中,整个人原本是运动的,所以整个人都应该是白色的,但是检测时人的头部有部分黑色即为空洞现象。The Vibe algorithm is a pixel-level foreground detection (or background modeling) method. Its basic idea includes: storing a sample set for each pixel, which contains the past pixel values of this pixel and its surrounding neighbors. When a new pixel is encountered, the pixel value of the new pixel is compared with the collection points in the sample set to determine whether the new pixel is a background point. This algorithm is a process of classifying background points. The Vibe algorithm has the advantages of high computing efficiency, good implementation effect, less memory usage and optimal sample attenuation. However, the Vibe algorithm has ghosts caused by sudden changes in factors such as lighting and shadows in the environment (wrongly detecting the area covered by moving objects in the previous few frames as moving objects), and missed detection (meaning that some moving objects are not detected in image acquisition. )And other issues. Moreover, when the Vibe algorithm detects moving objects, the detection of moving objects will appear empty (meaning that the object itself is moving during detection, but some parts of the moving object are still when detected). As shown in Figure 3, the whole person is originally in motion, so the whole person should be white, but the part of the person's head that is black during detection is a hollow phenomenon.
发明内容Contents of the invention
为解决传统Vibe算法的不足,本发明提出一种提高图像中运动检测精度的方法。In order to solve the shortcomings of the traditional Vibe algorithm, the present invention proposes a method for improving the motion detection accuracy in images.
本发明一种提高图像中运动物体检测精度的方法,对采集的每一帧图像进行像素点级图像稳定性判断,若是稳定的,则采用Vibe算法进行图像处理,否则,采用帧间差分法进行图像处理,最后对经过帧间差分法处理后的图像或者Vibe算法处理后的图像进行形态学填充处理。The present invention is a method for improving the detection accuracy of a moving object in an image. The pixel-level image stability is judged for each frame of image collected. If it is stable, the Vibe algorithm is used for image processing; otherwise, the inter-frame difference method is used for image processing. Image processing, and finally perform morphological filling processing on the image processed by the inter-frame difference method or the image processed by the Vibe algorithm.
优选地,所述像素点级图像稳定性判断包括当前帧中的各个像素点的像素值与前一帧相同位置像素点的像素值进行比较,若变化的像素点的个数小于像素点识别阈值,则判断为稳定状态,否则判断为不稳定状态。Preferably, the pixel-level image stability judgment includes comparing the pixel value of each pixel in the current frame with the pixel value of the pixel at the same position in the previous frame, and if the number of changed pixels is less than the pixel identification threshold , it is judged as a stable state, otherwise it is judged as an unstable state.
优选地,所述帧间差分法包括用图像序列中的连续两帧图像进行差分获得灰度差分图,然后二值化该灰度差分图像提取运动信息,由帧间变化区域检测分割得到的图像区分出背景区域和运动物体区域,进而提取要检测的运动目标。Preferably, the inter-frame difference method includes performing difference between two consecutive frames of images in the image sequence to obtain a grayscale difference image, then binarizing the grayscale difference image to extract motion information, and detecting and segmenting the image obtained by inter-frame change regions The background area and the moving object area are distinguished, and then the moving target to be detected is extracted.
优选地,对帧间差分法处理后的图像进行图像滤波处理,具体采用邻域法,即逐个扫描帧间差分法处理后的图像中邻域内的像素点,将该像素点的邻域各像素点的像素值从小到大或从大到小进行排序,求得各像素点的像素值的中间值,将该中间值赋值给帧间差分法处理后的图像中与当前点对应的像素点。Preferably, image filtering is performed on the image processed by the inter-frame difference method, specifically using the neighborhood method, that is, the pixels in the neighborhood in the image processed by the inter-frame difference method are scanned one by one, and each pixel in the neighborhood of the pixel point is The pixel values of the points are sorted from small to large or from large to small, and the intermediate value of the pixel value of each pixel is obtained, and the intermediate value is assigned to the pixel corresponding to the current point in the image processed by the inter-frame difference method.
优选地,所述邻域为以当前像素点为圆心,3个像素点的长度为半径的圆形区域。Preferably, the neighborhood is a circular area with the current pixel as the center and the length of 3 pixels as the radius.
优选地,对帧间差分法处理后的图像进行图像滤波处理,具体采用二维滑动模板法,即将二维模板W内像素按照像素值的大小进行排序,生成单调上升或下降的二维数据序列并计算中间值,二维中值滤波输出g(x,y)=med{f(x-k,y-l),(k,l∈W)},其中,f(x,y)、g(x,y)分别为原始图像像素点和处理后图像像素点,W为二维模板,x、y表示像素点的坐标值,k、l表示为二维模版中的步长值,med{}表示为对二维模版中的像素点的像素值进行排序后的中间值。Preferably, image filtering is performed on the image processed by the inter-frame difference method, specifically using the two-dimensional sliding template method, that is, the pixels in the two-dimensional template W are sorted according to the size of the pixel value, and a monotonically rising or falling two-dimensional data sequence is generated. And calculate the median, two-dimensional median filter output g(x,y)=med{f(x-k,y-l),(k,l∈W)}, where, f(x,y), g(x,y ) are original image pixels and processed image pixels respectively, W is a two-dimensional template, x, y represent the coordinate values of pixel points, k, l represent the step value in the two-dimensional template, med{} represents the pair The median value after sorting the pixel values of the pixels in the 2D template.
优选地,所述形态学填充处理包括开运算,即先腐蚀后膨胀的处理;Preferably, the morphological filling process includes an open operation, that is, the process of first corroding and then expanding;
所述腐蚀包括用一个结构元素扫描图像中的每一个像素,用结构元素中的每一个像素与其覆盖的像素做“与”操作,如果都为1,则该像素为1,否则为0;The erosion includes scanning each pixel in the image with a structural element, and performing an "AND" operation with each pixel in the structural element and the pixels covered by it. If both are 1, the pixel is 1, otherwise it is 0;
所述膨胀包括用一个结构元素扫描图像中的每一个像素,用结构元素中的每一个像素与其覆盖的像素做“与”操作,如果都为0,则该像素为0,否则为1。The dilation includes using a structural element to scan each pixel in the image, and performing an AND operation with each pixel in the structural element and the pixels it covers. If both are 0, the pixel is 0, otherwise it is 1.
优选地,所述形态学填充处理包括闭运算,即先膨胀后腐蚀的处理;Preferably, the morphological filling process includes a closed operation, that is, the process of dilation first and then erosion;
所述腐蚀包括用一个结构元素扫描图像中的每一个像素,用结构元素中的每一个像素与其覆盖的像素做“与”操作,如果都为1,则该像素为1,否则为0;The erosion includes scanning each pixel in the image with a structural element, and performing an "AND" operation with each pixel in the structural element and the pixels covered by it. If both are 1, the pixel is 1, otherwise it is 0;
所述膨胀包括用一个结构元素扫描图像中的每一个像素,用结构元素中的每一个像素与其覆盖的像素做“与”操作,如果都为0,则该像素为0,否则为1。The dilation includes using a structural element to scan each pixel in the image, and performing an AND operation with each pixel in the structural element and the pixels it covers. If both are 0, the pixel is 0, otherwise it is 1.
优选地,对是否结束采集进行判断,若未采集结束,继续进行采集,并将采集的数据保存到缓冲区中,重复整个过程;若采集结束,则将在采集缓冲区的数据保存到内存中,并释放缓冲区内存,结束操作。Preferably, it is judged whether to end the collection, if the collection is not finished, continue to collect, and save the collected data in the buffer, repeat the whole process; if the collection is over, save the data in the collection buffer to the memory , and release the buffer memory, and end the operation.
与现有技术相比,本发明采用帧间差分法和形态学填充来改善Vibe算法存在的缺陷,极大程度提高了图像中运动物体的检测精度。Compared with the prior art, the present invention uses the inter-frame difference method and morphological filling to improve the defects of the Vibe algorithm, and greatly improves the detection accuracy of moving objects in the image.
附图说明Description of drawings
图1是本发明提高图像中运动物体检测精度的方法第一优选实施例流程图;Fig. 1 is the flow chart of the first preferred embodiment of the method for improving the detection accuracy of moving objects in images according to the present invention;
图2是本发明提高图像中运动物体检测精度的方法第二优选实施例流程图;Fig. 2 is a flow chart of the second preferred embodiment of the method for improving the detection accuracy of moving objects in images according to the present invention;
图3是原始图像和帧间差分法处理后的图像对比图;Fig. 3 is the image contrast chart after original image and inter-frame difference method processing;
图4是原始图像和形态学填充处理后的图像对比图。Figure 4 is a comparison of the original image and the image after morphological filling.
具体实施方式detailed description
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图对本发明实施例进一步详细说明。In order to make the object, technical solution and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below in conjunction with the accompanying drawings.
如图1所示,本发明首先进行图像采集,然后对采集的每一帧图像进行像素点级图像稳定性判断,若是稳定的,则采用Vibe算法进行图像处理,否则,采用帧间差分法进行图像处理,最后对经过帧间差分法处理后的图像或者Vibe算法处理后的图像进行形态学填充处理,从而来消除运动检测过程中产生的空洞现象,通过以上的方式提高了检测运动物体的精度。As shown in Fig. 1, the present invention first carries out image acquisition, then carries out pixel-level image stability judgment to each frame image of acquisition, if stable, then adopt Vibe algorithm to carry out image processing, otherwise, adopt inter-frame difference method to carry out Image processing, and finally perform morphological filling processing on the image processed by the inter-frame difference method or the image processed by the Vibe algorithm, so as to eliminate the hole phenomenon generated in the motion detection process, and improve the detection accuracy of moving objects through the above methods .
对于图像采集本发明可以通过摄像头将采集的图像保存到电脑的内存中。在实现时,可以通过使用windows系统提供的摄像头驱动的应用程序编程接口(ApplicationProgramming Interface,简称API)直打开摄像头,进行图像采集。例如,打开摄像头设备并设置摄像头采集图像参数;当程序当打开摄像头后,需要给摄像头设置参数,这里主要是每帧的像素值。由于程序在windows系统上运行的,且所采用的摄像头设备是系统自带驱动的,免去了需要自己编写摄像头驱动代码的时间开销,只需要在程序代码中使用windows系统提供的摄像头驱动的API接口即可。For image collection, the present invention can store the collected images into the internal memory of the computer through the camera. During implementation, the camera can be directly opened for image acquisition by using a camera-driven application programming interface (Application Programming Interface, API for short) provided by the windows system. For example, turn on the camera device and set the image acquisition parameters of the camera; when the program opens the camera, it needs to set the parameters for the camera, here is mainly the pixel value of each frame. Since the program runs on the windows system, and the camera device used is driven by the system, it saves the time overhead of writing the camera driver code by yourself, and only needs to use the camera driver API provided by the windows system in the program code interface.
对于像素点级图像稳定性判断,包括当前帧中的各个像素点的像素值与前一帧相同位置像素点的像素值进行比较,若变化的像素点的个数小于像素点识别阈值,则判断为稳定状态,否则判断为不稳定状态For the pixel-level image stability judgment, the pixel value of each pixel in the current frame is compared with the pixel value of the same position pixel in the previous frame. If the number of changed pixels is less than the pixel recognition threshold, the judgment is a stable state, otherwise it is judged as an unstable state
在重复处理多帧图像时,当检测到运动物体为不稳定状态时,切换到帧间差分法,而后当检测到运动物体已经稳定时,再重新初始化背景样本集并切换到Vibe算法。When repeatedly processing multiple frames of images, when the moving object is detected to be unstable, switch to the inter-frame difference method, and then when the moving object is detected to be stable, re-initialize the background sample set and switch to the Vibe algorithm.
由于Vibe算法是从第一帧图像进行初始化的,刚开始初始化时,会默认整个采集的图像是前景图像即整张图像都是运动的。因此,需要后面几帧图像来比较进行场景的恢复,使其判断整个场景的前景图像与背景图像,并且分离出前景图像与背景图像。当有运动物体进入到采集区后,首先对图像进行像素点级图像稳定性判断。若不稳定则使用帧间差分法,若稳定,则切换到Vibe算法,若判断为稳定,表明此时整个运动的物体已经处于稳定状态,这时使用Vibe算法对运动图像进行检测时将会消除拽影。Since the Vibe algorithm is initialized from the first frame of image, at the beginning of initialization, the entire collected image will be the foreground image by default, that is, the entire image is in motion. Therefore, it is necessary to compare the images of the next few frames to restore the scene, so that it can judge the foreground image and the background image of the entire scene, and separate the foreground image and the background image. When a moving object enters the acquisition area, the pixel-level image stability judgment is first performed on the image. If it is unstable, use the inter-frame difference method. If it is stable, switch to the Vibe algorithm. If it is judged to be stable, it indicates that the entire moving object is already in a stable state. At this time, when using the Vibe algorithm to detect the moving image, it will be eliminated. Drag shadow.
对于帧间差分法,检测出相邻两帧图像中发生变化的区域。该方法是用图像序列中的连续两帧图像进行差分获得灰度差分图,然后二值化该灰度差分图像来提取运动信息,由帧间变化区域检测分割得到的图像,区分出背景区域和运动物体区域,进而提取要检测的运动目标。For the inter-frame difference method, the region that changes in two adjacent frames of images is detected. The method is to use the difference between two consecutive frames of images in the image sequence to obtain a gray-scale difference image, and then binarize the gray-scale difference image to extract motion information. The image obtained by detecting and segmenting the change area between frames is used to distinguish the background area and The moving object area, and then extract the moving target to be detected.
本发明帧间差分法是通过比较图像序列中前后两帧图像对应像素点灰度值,两帧对应像素点灰度值相减,如果差值很小,可以认为该点无运动物体经过,反之灰度变化很大,则认为有物体经过。The inter-frame difference method of the present invention is to compare the gray value of the pixel point corresponding to the two frames of images in the image sequence, and subtract the gray value of the pixel point corresponding to the two frames. If the difference is very small, it can be considered that there is no moving object passing through the point, otherwise If the gray level changes greatly, it is considered that there is an object passing by.
例如,第k帧和k+1帧图像fk(x,y),fk+1(x,y)之间的变化用一个二值差分图像D(x,y)表示,如式(1):For example, the change between the image f k (x, y) and f k+1 (x, y) of the kth frame and the k+1 frame is represented by a binary difference image D(x, y), such as formula (1 ):
T为差分图像二值化阈值,因为不需要更新背景模型,所以运动物体不稳定的时候可以优选考虑采用帧间差分法。T is the difference image binarization threshold, because there is no need to update the background model, so when the moving object is unstable, the inter-frame difference method can be preferably considered.
上述实施例在传统Vibe算法加入帧间差分法,从而改进Vibe算法存在拽影的缺陷。In the above embodiment, the frame difference method is added to the traditional Vibe algorithm, so as to improve the Vibe algorithm which has the defect of dragging shadows.
优选地,作为可选方式,本发明对帧间差分法处理后的图像进行图像滤波处理,如图2所示,可以采用多种方式进行,包括但不限于邻域法、二维滑动模板法等。Preferably, as an optional method, the present invention performs image filtering on the image processed by the inter-frame difference method, as shown in Figure 2, which can be performed in a variety of ways, including but not limited to the neighborhood method and the two-dimensional sliding template method Wait.
所述邻域法,包括以下过程:The neighborhood method includes the following processes:
首先,获得源图像的首地址及图像的宽和高。First, get the first address of the source image and the width and height of the image.
其次,开辟一块内存缓冲区,用以暂存结果图像,并初始化为0。然后,逐个扫描图像中的像素点,将其邻域各元素的从小到大进行排序,将求得的中间值赋值给目标图像中与当前点对应的像素点。所述邻域为以当前像素点为圆心,3个像素点的长度为半径的圆形区域。Secondly, open up a memory buffer to temporarily store the result image, and initialize it to 0. Then, scan the pixels in the image one by one, sort the elements of its neighborhood from small to large, and assign the obtained intermediate value to the pixel corresponding to the current point in the target image. The neighborhood is a circular area with the current pixel as the center and the length of 3 pixels as the radius.
然后循环上一步骤,直到处理完源图像的全部像素点。Then loop the previous step until all the pixels of the source image are processed.
最后,将结果从内存缓冲区复制到源图像的数据缓冲区中。Finally, the result is copied from the memory buffer into the source image's data buffer.
本实施例采用的邻域法是基于空间域的中值滤波手段。中值滤波法是一种非线性平滑技术,它将每一像素点的像素值设置为该点某邻近区域范围内的所有像素点像素值的中值。中值滤波是基于排序统计理论的一种能有效抑制噪声的非线性信号处理技术,中值滤波的基本原理是把数字图像或数字序列中一点的像素值用该点的一个邻域中各像素点的像素值的中值代替,让周围像素点的像素值接近的真实值,从而消除孤立的噪声点。The neighborhood method adopted in this embodiment is a median filtering method based on the spatial domain. The median filtering method is a non-linear smoothing technique, which sets the pixel value of each pixel to the median value of all pixel values within a certain adjacent area of the point. Median filtering is a non-linear signal processing technology that can effectively suppress noise based on sorting statistics theory. The basic principle of median filtering is to use the pixel value of a point in a digital image or digital sequence with each pixel in a neighborhood of the point The median value of the pixel value of the point is replaced, so that the pixel value of the surrounding pixel points is close to the real value, thereby eliminating isolated noise points.
所述二维滑动模板法将模板内像素点按照像素值的大小进行排序,生成单调上升(或下降)的二维数据序列。二维中值滤波输出g(x,y)=med{f(x-k,y-l),(k,l∈W)},其中,f(x,y)、g(x,y)分别为原始图像像素点和处理后图像像素点,W为二维模板,通常为3×3、5×5区域,也可以是不同的形状,如线状,圆形,十字形,圆环形等;x、y表示像素点的坐标值,k、l表示为二维模版中的步长值,med{}表示为对二维模版中的像素点的像素值进行排序后的中间值。The two-dimensional sliding template method sorts the pixel points in the template according to the size of the pixel value, and generates a monotonically rising (or falling) two-dimensional data sequence. Two-dimensional median filtering output g(x,y)=med{f(x-k,y-l),(k,l∈W)}, where f(x,y) and g(x,y) are the original image Pixels and processed image pixels, W is a two-dimensional template, usually 3×3, 5×5 areas, and can also be different shapes, such as linear, circular, cross-shaped, circular, etc.; x, y represents the coordinate value of the pixel, k and l represent the step value in the two-dimensional template, and med{} represents the intermediate value after sorting the pixel values of the pixel in the two-dimensional template.
对于通过改进后的Vibe算法可以检测出运动目标,但是由于Vibe算法自身的特点以及和帧间差分法的特点的缘故,使用Vibe算法检测运动的物体时检测出来的目标往往会出现空洞现象,虽然空洞的现象并不是很明显,但确实存在。如图3是原始图像(左)和采用帧间差分法处理后的图像(右),从整个看轮廓很清晰,处理效果较好,但是还是有空洞现象的存在,特别是头部空洞现象较为严重。于是,有必要对存在的空洞现象做进一步处理。The improved Vibe algorithm can detect moving targets, but due to the characteristics of the Vibe algorithm itself and the characteristics of the frame difference method, when using the Vibe algorithm to detect moving objects, the detected targets often appear hollow, although The void is not very obvious, but it is there. Figure 3 shows the original image (left) and the image processed by the inter-frame difference method (right). The outline is very clear from the whole, and the processing effect is good, but there are still holes, especially the head hole. serious. Therefore, it is necessary to further deal with the existing void phenomenon.
本发明采用形态学填充的方法对对经过帧间差分法处理后的图像或者Vibe算法处理后的图像或者经过滤波处理后的图像进行填充,以消除空洞现象,进一步提高检测运动物体的精度。The present invention uses a morphological filling method to fill the image processed by the inter-frame difference method or the image processed by the Vibe algorithm or the image processed by filtering to eliminate the cavity phenomenon and further improve the accuracy of detecting moving objects.
形态学填充利用一个称作结构元素的“探针”收集图像的信息,当“探针”在图像中不断移动的时候,便可考察图像各个部分之间的关系,从而了解图像的结构特征。其核心思想包括开运算和闭运算。Morphological filling uses a "probe" called a structural element to collect image information. When the "probe" is constantly moving in the image, the relationship between various parts of the image can be examined to understand the structural characteristics of the image. Its core idea includes opening operation and closing operation.
开运算的计算模型为:The calculation model of the opening operation is:
Dst1=open(src,element)=dilate(erode(src,element)) (2)Dst1=open(src,element)=dilate(erode(src,element)) (2)
其中公式(2)中open()代表开运算,src代表原图,element代表处理后的图,dilate()代表腐蚀操作,erode()代表膨胀操作In the formula (2), open() represents the open operation, src represents the original image, element represents the processed image, dilate() represents the erosion operation, and erode() represents the expansion operation
开运算是先腐蚀后膨胀的过程。用来消除小物体、在纤细点处分离物体、平滑较大物体的边界的同时并不明显改变其面积。开运算通常是在需要去除小颗粒噪声,以及断开目标物之间连接时使用,具有可以基本保持目标原有大小不变的优点。The opening operation is a process of erosion first and then dilation. Used to eliminate small objects, separate objects at thin points, and smooth the boundaries of larger objects without significantly changing their area. The opening operation is usually used when it is necessary to remove small particle noise and disconnect the connection between objects, and has the advantage of basically keeping the original size of the object unchanged.
闭运算的计算模型为:The calculation model of the closing operation is:
Dst2=close(src,element)=dilate(erode(src,element)) (3)Dst2=close(src,element)=dilate(erode(src,element)) (3)
其中公式(3)中close()代表闭运算,src代表原图,element代表处理后的图,dilate()代表腐蚀操作,erode()代表膨胀操作Among them, close() in formula (3) represents the closing operation, src represents the original image, element represents the processed image, dilate() represents the erosion operation, and erode() represents the expansion operation
闭运算是先膨胀后腐蚀的过程,可以填充物体内细小的空洞,并平滑物体边界。The closing operation is a process of first dilation and then erosion, which can fill the small holes in the object and smooth the object boundary.
作为优选方式,还可以先进行开运算以后再进行闭运算,每帧图像经过开运算并且闭运算填充后,整个图片中运动物体的空洞现象将会被填充起来。As a preferred method, the opening operation can be performed first and then the closing operation is performed. After each frame of image is opened and filled by the closing operation, the holes of moving objects in the entire picture will be filled.
所述腐蚀的作用是消除物体边界点,使目标缩小,可以消除小于结构元素的噪声点。腐蚀的具体操作是:用一个结构元素(一般是3×3的大小)扫描图像中的每一个像素,用结构元素中的每一个像素与其覆盖的像素做“与”操作,如果都为1,则该像素为1,否则为0。The function of the erosion is to eliminate the boundary points of the object, shrink the target, and eliminate the noise points smaller than the structural elements. The specific operation of corrosion is: scan each pixel in the image with a structural element (generally 3×3 in size), and perform an "AND" operation with each pixel in the structural element and the pixels covered by it. If both are 1, Then the pixel is 1, otherwise it is 0.
所述膨胀的作用是将与物体接触的所有背景点合并到物体中,使目标增大,可添补目标中的空洞。膨胀的具体操作是:用一个结构元素(一般是3×3的大小)扫描图像中的每一个像素,用结构元素中的每一个像素与其覆盖的像素做“与”操作,如果都为0,则该像素为0,否则为1。The effect of the expansion is to merge all the background points in contact with the object into the object, so as to increase the size of the target and fill the holes in the target. The specific operation of expansion is: scan each pixel in the image with a structural element (generally 3×3 in size), and use each pixel in the structural element and the pixels covered by it to perform an "AND" operation. If both are 0, Then the pixel is 0, otherwise it is 1.
图片经过形态学填充处理后整个图像的空洞现象能够被很好的填充,使得整个图片经过本发明处理后,运动物体能够很好的显现出来。如图4是原始图像(左)和经过形态学填充处理后的图像(右),整个运动物体的轮廓非常清楚,而且,空洞现象相对于处理前减少很多,改进效果明显。After the picture is processed by morphological filling, the hollow phenomenon of the whole image can be well filled, so that after the whole picture is processed by the invention, moving objects can be well displayed. As shown in Figure 4, the original image (left) and the image after morphological filling processing (right), the outline of the entire moving object is very clear, and the cavity phenomenon is much reduced compared with that before processing, and the improvement effect is obvious.
最后,对是否采集结束进行判断,若采集未结束,则继续进行采集,并将采集的数据保存到缓冲区中,重复上面的操作;若采集结束,则关闭设备,并将在采集缓冲区的数据保存到内存中,并释放缓冲区内存,结束操作。Finally, judge whether the collection is over, if the collection is not over, continue to collect, save the collected data in the buffer, and repeat the above operation; if the collection is over, turn off the device and save the data in the collection buffer The data is saved to the memory, and the buffer memory is released, and the operation ends.
本发明采用帧间差分法和形态学填充来改善Vibe算法存在的缺陷,可以提高图像中运动物体的实时检测精度。The invention adopts the inter-frame difference method and morphological filling to improve the defects of the Vibe algorithm, and can improve the real-time detection accuracy of the moving object in the image.
以上所举实施例,对本发明的目的、技术方案和优点进行了进一步的详细说明,所应理解的是,以上所举实施例仅为本发明的优选实施方式而已,并不用以限制本发明,凡在本发明的精神和原则之内对本发明所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above examples have further described the purpose, technical solutions and advantages of the present invention in detail. It should be understood that the above examples are only preferred implementations of the present invention and are not intended to limit the present invention. Any modification, equivalent replacement, improvement, etc. made to the present invention within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710140027.4A CN106934819A (en) | 2017-03-10 | 2017-03-10 | A kind of method of moving object segmentation precision in raising image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710140027.4A CN106934819A (en) | 2017-03-10 | 2017-03-10 | A kind of method of moving object segmentation precision in raising image |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106934819A true CN106934819A (en) | 2017-07-07 |
Family
ID=59433563
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710140027.4A Pending CN106934819A (en) | 2017-03-10 | 2017-03-10 | A kind of method of moving object segmentation precision in raising image |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106934819A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107249122A (en) * | 2017-07-26 | 2017-10-13 | 杨建伟 | A kind of moving target monitoring system for intelligent monitoring |
CN108280841A (en) * | 2018-01-16 | 2018-07-13 | 北京联合大学 | A kind of foreground extracting method based on neighborhood territory pixel intensity correction |
CN108303745A (en) * | 2018-03-19 | 2018-07-20 | 贵州电网有限责任公司 | A kind of inversion method of the buried cable detection based on electromagnetic wave saturating ground technology |
CN109934870A (en) * | 2019-01-30 | 2019-06-25 | 西安天伟电子系统工程有限公司 | Object detection method, device, equipment, computer equipment and storage medium |
CN110599523A (en) * | 2019-09-10 | 2019-12-20 | 江南大学 | ViBe ghost suppression method fused with interframe difference method |
CN113570578A (en) * | 2021-07-29 | 2021-10-29 | 歌尔光学科技有限公司 | Lens ghost phenomenon detection method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101621615A (en) * | 2009-07-24 | 2010-01-06 | 南京邮电大学 | Self-adaptive background modeling and moving target detecting method |
CN103824070A (en) * | 2014-03-24 | 2014-05-28 | 重庆邮电大学 | A Fast Pedestrian Detection Method Based on Computer Vision |
CN104331905A (en) * | 2014-10-31 | 2015-02-04 | 浙江大学 | Surveillance video abstraction extraction method based on moving object detection |
-
2017
- 2017-03-10 CN CN201710140027.4A patent/CN106934819A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101621615A (en) * | 2009-07-24 | 2010-01-06 | 南京邮电大学 | Self-adaptive background modeling and moving target detecting method |
CN103824070A (en) * | 2014-03-24 | 2014-05-28 | 重庆邮电大学 | A Fast Pedestrian Detection Method Based on Computer Vision |
CN104331905A (en) * | 2014-10-31 | 2015-02-04 | 浙江大学 | Surveillance video abstraction extraction method based on moving object detection |
Non-Patent Citations (1)
Title |
---|
谢红等: "一种基于改进三帧差分和ViBe算法的运动目标检测算法", 《应用科技》 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107249122A (en) * | 2017-07-26 | 2017-10-13 | 杨建伟 | A kind of moving target monitoring system for intelligent monitoring |
CN108280841A (en) * | 2018-01-16 | 2018-07-13 | 北京联合大学 | A kind of foreground extracting method based on neighborhood territory pixel intensity correction |
CN108280841B (en) * | 2018-01-16 | 2022-03-29 | 北京联合大学 | Foreground extraction method based on neighborhood pixel intensity correction |
CN108303745A (en) * | 2018-03-19 | 2018-07-20 | 贵州电网有限责任公司 | A kind of inversion method of the buried cable detection based on electromagnetic wave saturating ground technology |
CN109934870A (en) * | 2019-01-30 | 2019-06-25 | 西安天伟电子系统工程有限公司 | Object detection method, device, equipment, computer equipment and storage medium |
CN110599523A (en) * | 2019-09-10 | 2019-12-20 | 江南大学 | ViBe ghost suppression method fused with interframe difference method |
CN113570578A (en) * | 2021-07-29 | 2021-10-29 | 歌尔光学科技有限公司 | Lens ghost phenomenon detection method and device |
CN113570578B (en) * | 2021-07-29 | 2024-05-17 | 歌尔光学科技有限公司 | Method and device for detecting lens ghost phenomenon |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022027931A1 (en) | Video image-based foreground detection method for vehicle in motion | |
CN106934819A (en) | A kind of method of moving object segmentation precision in raising image | |
CN104978567B (en) | Vehicle checking method based on scene classification | |
CN103729858B (en) | A kind of video monitoring system is left over the detection method of article | |
CN107169985A (en) | A kind of moving target detecting method based on symmetrical inter-frame difference and context update | |
CN107067002A (en) | Road licence plate recognition method in a kind of dynamic video | |
JP2007510993A (en) | Object detection in images | |
CN107895492A (en) | A kind of express highway intelligent analysis method based on conventional video | |
CN107833242A (en) | One kind is based on marginal information and improves VIBE moving target detecting methods | |
CN110910420A (en) | Moving target detection tracking method based on image stream | |
CN102034240A (en) | Method for detecting and tracking static foreground | |
CN105160297A (en) | Masked man event automatic detection method based on skin color characteristics | |
CN108198208B (en) | Movement detection method based on target tracking | |
CN107909599A (en) | A kind of object detecting and tracking system | |
CN107103303A (en) | A kind of pedestrian detection method based on GMM backgrounds difference and union feature | |
CN111383244A (en) | Target detection tracking method | |
CN104537688A (en) | Moving object detecting method based on background subtraction and HOG features | |
CN103577832B (en) | A kind of based on the contextual people flow rate statistical method of space-time | |
CN107767404A (en) | A kind of remote sensing images sequence moving target detection method based on improvement ViBe background models | |
CN109035296A (en) | A kind of improved moving objects in video detection method | |
CN105405153B (en) | Intelligent mobile terminal anti-noise jamming Extracting of Moving Object | |
CN1266656C (en) | Intelligent alarming treatment method of video frequency monitoring system | |
CN115937237A (en) | Local feature extraction method based on edge transform domain | |
Su et al. | A new local-main-gradient-orientation HOG and contour differences based algorithm for object classification | |
CN105447489A (en) | Character and background adhesion noise elimination method for image OCR system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170707 |
|
RJ01 | Rejection of invention patent application after publication |