[go: up one dir, main page]

CN110349189A - A kind of background image update method based on continuous inter-frame difference - Google Patents

A kind of background image update method based on continuous inter-frame difference Download PDF

Info

Publication number
CN110349189A
CN110349189A CN201910472023.5A CN201910472023A CN110349189A CN 110349189 A CN110349189 A CN 110349189A CN 201910472023 A CN201910472023 A CN 201910472023A CN 110349189 A CN110349189 A CN 110349189A
Authority
CN
China
Prior art keywords
image
background
foreground
background image
area
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
Application number
CN201910472023.5A
Other languages
Chinese (zh)
Inventor
万燕英
陈泽涛
雷洁
郑乐藩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Railway Polytechnic
Original Assignee
Guangzhou Railway Polytechnic
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangzhou Railway Polytechnic filed Critical Guangzhou Railway Polytechnic
Priority to CN201910472023.5A priority Critical patent/CN110349189A/en
Publication of CN110349189A publication Critical patent/CN110349189A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/215Motion-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/254Analysis of motion involving subtraction of images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20224Image subtraction

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The present invention relates to a kind of background image update method based on continuous inter-frame difference, present invention Fk(x, y) part or all of area update background image, can reduce the sensibility to Changes in weather.B is used when having foreign matterIThe corresponding region (x, y) replaces Fk(x, y) foreground zone, the new background image corresponding region that can guarantee must be clean background.Appropriate to expand foreground zone, when can be imperfect to avoid foreign bodies detection, the prospect that can't detect be treated as FkThe background of (x, y) and be used to update background image, cause the inaccuracy of background image.The present invention realizes the update of background image in the detection process of moving target based on background subtraction, can obtain accurate background image, and influence of the Changes in weather to moving object detection is effectively reduced.

Description

一种基于连续帧间差分的背景图像更新方法A Background Image Update Method Based on Difference Between Continuous Frames

技术领域technical field

本发明涉及背景差分法检测运动目标时背景图像的更新方法,更具体地,涉及一种基于连续帧间差分的背景图像更新方法。The invention relates to a method for updating a background image when a moving target is detected by a background difference method, and more particularly relates to a method for updating a background image based on difference between consecutive frames.

背景技术Background technique

视频监控技术大量应用于政府、金融、公安、交通、电力等领域,比如轨道交通中基于智能视频监控的轨道异物侵限检测。视频监控中运动目标的检测,又称前景提取,指从序列图像中将变化区域从背景图像中提取出来。运动目标的有效检测,对目标分类、跟踪、行为理解等后期处理非常重要。运动目标检测主要方法有光流法、帧间差分法和背景差分法。光流法利用图像序列中的像素在时间域上的变化、相邻帧之间的相关性来找到前一帧与当前帧存在的对应关系,计算出相邻帧之间物体的运动信息,受噪声、遮挡物等影响较大,运算复杂,计算量大。帧间差分法对视频序列图像中相邻两帧图像进行差分运算,通过比较连续帧间的差异来提取运动目标。该方法算法简单,对光线变化不敏感,环境适应能力强,但目标的运动速度和差分帧的时间间隔对检测结果影响较大。背景差分法将当前帧图像与背景图像相减,再二值化得到的差分图像,从而提取不同于背景图像的目标区域。这种方法原理简单,易于实现且检测速度快,但实际场景中背景图像会因天气、光照等动态变化,因此要不断进行背景更新。Video surveillance technology is widely used in government, finance, public security, transportation, electric power and other fields, such as the detection of track foreign object intrusion based on intelligent video surveillance in rail transit. The detection of moving objects in video surveillance, also known as foreground extraction, refers to extracting the changing area from the background image from the sequence image. Effective detection of moving targets is very important for post-processing such as target classification, tracking, and behavior understanding. The main methods of moving target detection are optical flow method, frame difference method and background difference method. The optical flow method uses the changes of pixels in the image sequence in the time domain and the correlation between adjacent frames to find the corresponding relationship between the previous frame and the current frame, and calculate the motion information of objects between adjacent frames. Noise, occluders, etc. have a great influence, and the calculation is complicated and the amount of calculation is large. The inter-frame difference method performs a difference operation on two adjacent frames of images in a video sequence, and extracts moving objects by comparing the differences between consecutive frames. This method has a simple algorithm, is insensitive to light changes, and has strong environmental adaptability, but the moving speed of the target and the time interval of the difference frame have a great influence on the detection results. The background subtraction method subtracts the current frame image from the background image, and then binarizes the resulting difference image to extract the target area different from the background image. This method is simple in principle, easy to implement and fast in detection speed, but the background image in the actual scene will change dynamically due to weather, lighting, etc., so the background image needs to be updated continuously.

这三种方法各有优缺点,仅应用其中某一种方法来检测运动目标,并不能得到非常好的检测结果。背景差分法检测结果的准确性,依赖于背景图像。而目前很多基于背景差分法的运动目标检测算法,背景图像都是一成不变的,或是在动态更新背景图像中获取不到准确的背景图像。针对背景差分法更新背景图像时存在的问题,有必要发明一种方法,来获得准确的背景图像以提高检测精度。These three methods have their own advantages and disadvantages, and only using one of them to detect moving targets cannot get very good detection results. The accuracy of the detection results of the background subtraction method depends on the background image. However, in many moving target detection algorithms based on the background subtraction method, the background image is immutable, or an accurate background image cannot be obtained when the background image is dynamically updated. Aiming at the problems existing in updating the background image by the background subtraction method, it is necessary to invent a method to obtain an accurate background image to improve the detection accuracy.

发明内容Contents of the invention

本发明为克服上述现有技术所述的至少一种缺陷,提供一种基于连续帧间差分的背景图像更新方法。In order to overcome at least one defect of the above-mentioned prior art, the present invention provides a background image updating method based on difference between consecutive frames.

为解决上述技术问题,本发明采用的技术方案是:一种基于连续帧间差分的背景图像更新方法,包括以下步骤:In order to solve the above-mentioned technical problems, the technical solution adopted in the present invention is: a method for updating background images based on the difference between consecutive frames, comprising the following steps:

S1.采集视频一段时间内若干帧无前景的图像,对它们求和后取平均值,作为初始背景图像;S1. Collect several frames of images without foreground within a period of time in the video, sum them and take the average value as the initial background image;

S2.读取视频第一帧图像,将当前帧图像与初始背景图像作差得到差分图像;S2. Read the first frame image of the video, and make a difference between the current frame image and the initial background image to obtain a differential image;

S3.对差分图像进行二值化处理,得到二值图像,从而分离出前景与背景;S3. Binarize the differential image to obtain a binary image, thereby separating the foreground and the background;

S4.通过形态学开操作滤去二值图像中孤立的前景点,闭操作获得前景较为完整的轮廓;S4. Filter out the isolated foreground points in the binary image through the morphological opening operation, and obtain a relatively complete outline of the foreground through the closing operation;

S5.当没有分离出前景时,用当前帧图像作为新的背景图像;S5. When the foreground is not separated, use the current frame image as a new background image;

S6.若分离出前景,则在二值图中标记前景的最小外接矩形,并将外接矩形适当扩大;扩大后的矩形区域为前景区,其它为背景区;当前帧图像的前景区用初始背景图像对应区域的像素值替代,背景区保持不变,被替代后的当前帧图像作为新的背景图像;S6. If the foreground is separated, then mark the minimum circumscribed rectangle of the foreground in the binary image, and appropriately expand the circumscribed rectangle; the expanded rectangular area is the foreground area, and the others are the background area; the foreground area of the current frame image uses the initial background The pixel value of the corresponding area of the image is replaced, the background area remains unchanged, and the replaced current frame image is used as the new background image;

S7.读取视频下一帧图像,将下一帧图像与新背景图像作差,重复步骤S3至S7。S7. Read the next frame image of the video, make a difference between the next frame image and the new background image, and repeat steps S3 to S7.

进一步的,所述的S1步骤具体包括:选取视频某段时间内多帧无运动目标的图像,将它们求和后取平均值,得到的均值图像作为初始背景图像,即:Further, the S1 step specifically includes: selecting images of multiple frames without moving objects within a certain period of time in the video, summing them and taking an average value, and the obtained average image is used as the initial background image, namely:

式中,BI(x,y)指初始背景图像,Fi(x,y)代表第i帧无运动目标的图像,N为无运动目标图像的帧数。In the formula, B I (x, y) refers to the initial background image, F i (x, y) represents the image of the i-th frame without moving objects, and N is the number of frames of images without moving objects.

进一步的,所述的S2步骤中求差分图像的公式为:Further, the formula for calculating the differential image in the step S2 is:

ΔF(x,y)=F1(x,y)-BI(x,y)ΔF(x,y)=F 1 (x,y)-B I (x,y)

式中,式中ΔF(x,y)为差分图像,F1(x,y)为视频第一帧图像。In the formula, ΔF(x, y) is the difference image, and F 1 (x, y) is the first frame image of the video.

进一步的,所述的S3步骤具体包括:二值化ΔF(x,y),得到二值图像,即:Further, the step S3 specifically includes: binarizing ΔF(x, y) to obtain a binary image, namely:

式中,B_ΔF(x,y)为二值图像,T为像素点灰度值的阈值;二值图像B_ΔF(x,y)=255的像素点代表前景,B_ΔF(x,y)=0的像素点代表背景。In the formula, B_ΔF(x, y) is a binary image, and T is the threshold value of the pixel gray value; the pixel of the binary image B_ΔF(x, y)=255 represents the foreground, and the pixel of B_ΔF(x,y)=0 The pixels represent the background.

进一步的,所述的S4步骤具体包括:Further, the S4 step specifically includes:

S41.通过形态学开操作消除小对象;对二值图像进行开操作,滤去图像中孤立的前景点;开操作:X1为原图像,X2为开操作后的图像,B1为结构元素;S41. Eliminate small objects through morphological opening operations; perform opening operations on binary images, and filter out isolated foreground points in images; opening operations: X 1 is the original image, X 2 is the image after the opening operation, and B 1 is the structural element;

S42.通过形态学闭操作填充小对象;对S41步骤中处理后的二值图像X2进行闭操作,得到轮廓完整的前景;闭操作:X3为闭操作后的图像,B2为结构元素。S42. Fill the small object by morphological closing operation; perform closing operation on the binary image X 2 processed in the step S41 to obtain a foreground with complete outline; closing operation: X 3 is the image after the closing operation, and B 2 is the structural element.

进一步的,所述的S6步骤具体包括:Further, the S6 step specifically includes:

S61.在二值图B_ΔF(x,y)中标记各个前景区的外接矩形;S61. Mark the circumscribed rectangles of each foreground area in the binary image B_ΔF(x, y);

S62.将外接矩形适当扩大,扩大后的矩形区域视为前景区,其他区域为背景区;S62. Appropriately expand the circumscribed rectangle, the enlarged rectangular area is regarded as the foreground area, and other areas are regarded as the background area;

S63.当前帧图像Fk(x,y)对应于前景的区域,用初始背景图像BI(x,y)所对应区域代替当前帧图像的前景区;S63. The current frame image F k (x, y) corresponds to the foreground area, and replaces the foreground area of the current frame image with the area corresponding to the initial background image B I (x, y);

S64.当前帧图像Fk(x,y)对应于背景的区域保持不变,S64. The area corresponding to the background of the current frame image F k (x, y) remains unchanged,

S65.经过S63、S64处理后的当前帧图像,作为新的背景图像。S65. The current frame image processed in S63 and S64 is used as a new background image.

进一步的,所述的S7步骤具体为:继续读取视频下一帧图像,将下一帧图像与新背景图像作差,再重复步骤S3至S7,实现基于背景差分法的运动目标检测过程中背景图像的更新。Further, the step S7 is specifically as follows: continue to read the next frame image of the video, make a difference between the next frame image and the new background image, and then repeat steps S3 to S7 to realize the moving target detection process based on the background difference method Background image updates.

与现有技术相比,有益效果是:本发明用Fk(x,y)部分或全部区域更新背景图像,能降低对天气变化的敏感性;有异物时用BI(x,y)对应区域代替Fk(x,y)前景区,能够保证得到的新背景图像对应区域一定是干净的背景。适当扩大前景区,可以避免异物检测不完整时,检测不到的前景被当成Fk(x,y)的背景而用于更新背景图像,造成背景图像的不准确。本发明实现了基于背景差分法的运动目标检测过程中背景图像的更新,能得到准确的背景图像,有效降低天气变化对运动目标检测的影响。Compared with the prior art, the beneficial effect is: the present invention uses F k (x, y) to update part or all of the background image, which can reduce the sensitivity to weather changes; when there are foreign objects, use B I (x, y) to correspond The area replaces the F k (x, y) foreground area, which can ensure that the corresponding area of the obtained new background image must be a clean background. Appropriately expanding the foreground area can prevent the undetected foreground from being used as the background of F k (x, y) to update the background image when foreign object detection is incomplete, resulting in inaccurate background images. The invention realizes the update of the background image in the moving target detection process based on the background difference method, can obtain accurate background images, and effectively reduces the influence of weather changes on the moving target detection.

附图说明Description of drawings

图1是本发明的方法流程图。Fig. 1 is a flow chart of the method of the present invention.

具体实施方式Detailed ways

附图仅用于示例性说明,不能理解为对本发明的限制;为了更好说明本实施例,附图某些部件会有省略、放大或缩小,并不代表实际产品的尺寸;对于本领域技术人员来说,附图中某些公知结构及其说明可能省略是可以理解的。附图中描述位置关系仅用于示例性说明,不能理解为对本发明的限制。The accompanying drawings are for illustrative purposes only, and should not be construed as limiting the present invention; in order to better illustrate this embodiment, certain components in the accompanying drawings will be omitted, enlarged or reduced, and do not represent the size of the actual product; for those skilled in the art It is understandable that some well-known structures and descriptions thereof may be omitted in the drawings. The positional relationship described in the drawings is for illustrative purposes only, and should not be construed as limiting the present invention.

如图1所示,一种基于连续帧间差分的背景图像更新方法,包括以下步骤:As shown in Figure 1, a background image update method based on the difference between consecutive frames includes the following steps:

步骤1.采集视频一段时间内若干帧无前景的图像,对它们求和后取平均值,作为初始背景图像;Step 1. Collect several frames of images without foreground within a period of time in the video, sum them and take the average value as the initial background image;

选取视频某段时间内多帧无运动目标的图像,将它们求和后取平均值,得到的均值图像作为初始背景图像,即:Select multiple frames of images without moving objects within a certain period of time in the video, sum them and take the average value, and the obtained average image is used as the initial background image, namely:

式中,BI(x,y)指初始背景图像,Fi(x,y)代表第i帧无运动目标的图像,N为无运动目标图像的帧数。In the formula, B I (x, y) refers to the initial background image, F i (x, y) represents the image of the i-th frame without moving objects, and N is the number of frames of images without moving objects.

步骤2.读取视频第一帧图像,将当前帧图像与初始背景图像作差得到差分图像;差分图像的公式为:Step 2. Read the first frame image of the video, and make a difference between the current frame image and the initial background image to obtain a difference image; the formula for the difference image is:

ΔF(x,y)=F1(x,y)-BI(x,y)ΔF(x,y)=F 1 (x,y)-B I (x,y)

式中,式中ΔF(x,y)为差分图像,F1(x,y)为视频第一帧图像。In the formula, ΔF(x, y) is the difference image, and F 1 (x, y) is the first frame image of the video.

步骤3.对差分图像进行二值化处理,得到二值图像,从而分离出前景与背景;Step 3. Binarize the differential image to obtain a binary image, thereby separating the foreground and background;

首先二值化ΔF(x,y),得到二值图像,即:First binarize ΔF(x,y) to obtain a binary image, namely:

式中,B_ΔF(x,y)为二值图像,T为像素点灰度值的阈值;二值图像B_ΔF(x,y)=255的像素点代表前景,B_ΔF(x,y)=0的像素点代表背景。In the formula, B_ΔF(x, y) is a binary image, and T is the threshold value of the pixel gray value; the pixel of the binary image B_ΔF(x, y)=255 represents the foreground, and the pixel of B_ΔF(x,y)=0 The pixels represent the background.

步骤4.通过形态学开操作滤去二值图像中孤立的前景点,闭操作获得前景较为完整的轮廓;Step 4. Filter out the isolated foreground points in the binary image through the morphological opening operation, and obtain a relatively complete outline of the foreground through the closing operation;

S41.通过形态学开操作消除小对象;对二值图像进行开操作,滤去图像中孤立的前景点;开操作:X1为原图像,X2为开操作后的图像,B1为结构元素;S41. Eliminate small objects through morphological opening operations; perform opening operations on binary images, and filter out isolated foreground points in images; opening operations: X 1 is the original image, X 2 is the image after the opening operation, and B 1 is the structural element;

S42.通过形态学闭操作填充小对象;对S41步骤中处理后的二值图像X2进行闭操作,得到轮廓完整的前景;闭操作:X3为闭操作后的图像,B2为结构元素。S42. Fill the small object by morphological closing operation; perform closing operation on the binary image X 2 processed in the step S41 to obtain a foreground with complete outline; closing operation: X 3 is the image after the closing operation, and B 2 is the structural element.

S5.当没有分离出前景时,用当前帧图像作为新的背景图像;即:S5. When the foreground is not separated, use the current frame image as a new background image; namely:

BN(x,y)=Fk(x,y)B N (x, y) = F k (x, y)

式中Fk(x,y)当前帧图像,BN(x,y)为新的背景图像。In the formula, F k (x, y) is the current frame image, and B N (x, y) is the new background image.

步骤6.若分离出前景,则在二值图中标记前景的最小外接矩形,并将外接矩形适当扩大;扩大后的矩形区域为前景区,其它为背景区;当前帧图像的前景区用初始背景图像对应区域的像素值替代,背景区保持不变,被替代后的当前帧图像作为新的背景图像;Step 6. If the foreground is separated, then mark the minimum circumscribed rectangle of the foreground in the binary image, and appropriately expand the circumscribed rectangle; the enlarged rectangular area is the foreground area, and the others are the background area; the foreground area of the current frame image uses the initial The pixel value of the corresponding area of the background image is replaced, the background area remains unchanged, and the replaced current frame image is used as the new background image;

S61.在二值图B_ΔF(x,y)中标记各个前景区的外接矩形;S61. Mark the circumscribed rectangles of each foreground area in the binary image B_ΔF(x, y);

S62.将外接矩形适当扩大,扩大后的矩形区域视为前景区,其他区域为背景区;S62. Appropriately expand the circumscribed rectangle, the enlarged rectangular area is regarded as the foreground area, and other areas are regarded as the background area;

S63.当前帧图像Fk(x,y)对应于前景的区域,用初始背景图像BI(x,y)所对应区域代替当前帧图像的前景区;S63. The current frame image F k (x, y) corresponds to the foreground area, and replaces the foreground area of the current frame image with the area corresponding to the initial background image B I (x, y);

S64.当前帧图像Fk(x,y)对应于背景的区域保持不变,S64. The area corresponding to the background of the current frame image F k (x, y) remains unchanged,

S65.经过S63、S64处理后的当前帧图像Fk(x,y),作为新的背景图像BN(x,y)。S65. The current frame image F k (x, y) processed by S63 and S64 is used as a new background image B N (x, y).

步骤7.读取视频下一帧图像,将下一帧图像与新背景图像作差,重复步骤S3至S7。即:Step 7. Read the next frame image of the video, make a difference between the next frame image and the new background image, and repeat steps S3 to S7. which is:

继续读取视频下一帧图像,将下一帧图像与新背景图像作差,再重复步骤S3至S7,实现基于背景差分法的运动目标检测过程中背景图像的更新。Continue to read the next frame image of the video, make a difference between the next frame image and the new background image, and then repeat steps S3 to S7 to realize the update of the background image during the moving target detection process based on the background difference method.

显然,本发明的上述实施例仅仅是为清楚地说明本发明所作的举例,而并非是对本发明的实施方式的限定。对于所属领域的普通技术人员来说,在上述说明的基础上还可以做出其它不同形式的变化或变动。这里无需也无法对所有的实施方式予以穷举。凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明权利要求的保护范围之内。Apparently, the above-mentioned embodiments of the present invention are only examples for clearly illustrating the present invention, rather than limiting the implementation of the present invention. For those of ordinary skill in the art, other changes or changes in different forms can be made on the basis of the above description. It is not necessary and impossible to exhaustively list all the implementation manners here. All modifications, equivalent replacements and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the claims of the present invention.

Claims (7)

1.一种基于连续帧间差分的背景图像更新方法,其特征在于,包括以下步骤:1. A background image updating method based on difference between consecutive frames, is characterized in that, comprises the following steps: S1.采集视频一段时间内若干帧无前景的图像,对它们求和后取平均值,作为初始背景图像;S1. Collect several frames of images without foreground within a period of time in the video, sum them and take the average value as the initial background image; S2.读取视频第一帧图像,将当前帧图像与初始背景图像作差得到差分图像;S2. Read the first frame image of the video, and make a difference between the current frame image and the initial background image to obtain a differential image; S3.对差分图像进行二值化处理,得到二值图像,从而分离出前景与背景;S3. Binarize the differential image to obtain a binary image, thereby separating the foreground and the background; S4.通过形态学开操作滤去二值图像中孤立的前景点,闭操作获得前景较为完整的轮廓;S4. Filter out the isolated foreground points in the binary image through the morphological opening operation, and obtain a relatively complete outline of the foreground through the closing operation; S5.当没有分离出前景时,用当前帧图像作为新的背景图像;S5. When the foreground is not separated, use the current frame image as a new background image; S6.若分离出前景,则在二值图中标记前景的最小外接矩形,并将外接矩形适当扩大;扩大后的矩形区域为前景区,其它为背景区;当前帧图像的前景区用初始背景图像对应区域的像素值替代,背景区保持不变,被替代后的当前帧图像作为新的背景图像;S6. If the foreground is separated, then mark the minimum circumscribed rectangle of the foreground in the binary image, and appropriately expand the circumscribed rectangle; the expanded rectangular area is the foreground area, and the others are the background area; the foreground area of the current frame image uses the initial background The pixel value of the corresponding area of the image is replaced, the background area remains unchanged, and the replaced current frame image is used as the new background image; S7.读取视频下一帧图像,将下一帧图像与新背景图像作差,重复步骤S3至S7。S7. Read the next frame image of the video, make a difference between the next frame image and the new background image, and repeat steps S3 to S7. 2.根据权利要求1所述的一种基于连续帧间差分的背景图像更新方法,其特征在于,所述的S1步骤具体包括:选取视频某段时间内多帧无运动目标的图像,将它们求和后取平均值,得到的均值图像作为初始背景图像,即:2. A kind of background image update method based on continuous inter-frame difference according to claim 1, it is characterized in that, described S1 step specifically comprises: select the image of multiple frames without moving target in a certain period of time of the video, and convert them After the summation, the average value is taken, and the obtained average image is used as the initial background image, that is: 式中,BI(x,y)指初始背景图像,Fi(x,y)代表第i帧无运动目标的图像,N为无运动目标图像的帧数。In the formula, B I (x, y) refers to the initial background image, F i (x, y) represents the i-th image without moving objects, and N is the number of frames without moving objects. 3.根据权利要求2所述的一种基于连续帧间差分的背景图像更新方法,其特征在于,所述的S2步骤中求差分图像的公式为:3. a kind of background image update method based on difference between continuous frames according to claim 2, is characterized in that, in the described S2 step, the formula for seeking difference image is: ΔF(x,y)=F1(x,y)-BI(x,y)ΔF (x, y) = F 1 (x, y) - B I (x, y) 式中,式中ΔF(x,y)为差分图像,F1(x,y)为视频第一帧图像。In the formula, ΔF(x, y) is the difference image, and F 1 (x, y) is the first frame image of the video. 4.根据权利要求3所述的一种基于连续帧间差分的背景图像更新方法,其特征在于,所述的S3步骤具体包括:二值化ΔF(x,y),得到二值图像,即:4. A kind of background image update method based on continuous inter-frame difference according to claim 3, it is characterized in that, described S3 step specifically comprises: Binarization ΔF (x, y), obtains binary image, namely : 式中,B_ΔF(x,y)为二值图像,T为像素点灰度值的阈值;二值图像B_ΔF(x,y)=255的像素点代表前景,B_ΔF(x,y)=0的像素点代表背景。In the formula, B_ΔF(x, y) is a binary image, and T is the threshold value of the pixel gray value; the pixel of the binary image B_ΔF(x, y)=255 represents the foreground, and the pixel of B_ΔF(x, y)=0 The pixels represent the background. 5.根据权利要求4所述的一种基于连续帧间差分的背景图像更新方法,其特征在于,所述的S4步骤具体包括:5. A kind of background image updating method based on difference between continuous frames according to claim 4, characterized in that, described S4 step specifically comprises: S41.通过形态学开操作消除小对象;对二值图像进行开操作,滤去图像中孤立的前景点;开操作:X1为原图像,X2为开操作后的图像,B1为结构元素;S41. Eliminate small objects through morphological opening operations; perform opening operations on binary images, and filter out isolated foreground points in images; opening operations: X 1 is the original image, X 2 is the image after the opening operation, and B 1 is the structural element; S42.通过形态学闭操作填充小对象;对S41步骤中处理后的二值图像X2进行闭操作,得到轮廓完整的前景;闭操作:X3为闭操作后的图像,B2为结构元素。S42. Fill the small object by morphological closing operation; perform closing operation on the binary image X 2 processed in the step S41 to obtain a foreground with complete outline; closing operation: X 3 is the image after the closing operation, and B 2 is the structural element. 6.根据权利要求5所述的一种基于连续帧间差分的背景图像更新方法,其特征在于,所述的S6步骤具体包括:6. A kind of background image update method based on continuous interframe difference according to claim 5, is characterized in that, described S6 step specifically comprises: S61.在二值图B_ΔF(x,y)中标记各个前景区的外接矩形;S61. Mark the circumscribed rectangles of each foreground area in the binary image B_ΔF(x, y); S62.将外接矩形适当扩大,扩大后的矩形区域视为前景区,其他区域为背景区;S62. Appropriately expand the circumscribed rectangle, the enlarged rectangular area is regarded as the foreground area, and other areas are regarded as the background area; S63.当前帧图像Fk(x,y)对应于前景的区域,用初始背景图像BI(x,y)所对应区域代替当前帧图像的前景区;S63. The current frame image F k (x, y) corresponds to the foreground area, and replaces the foreground area of the current frame image with the area corresponding to the initial background image B I (x, y); S64.当前帧图像Fk(x,y)对应于背景的区域保持不变,S64. The area corresponding to the background of the current frame image F k (x, y) remains unchanged, S65.经过S63、S64处理后的当前帧图像Fk(x,y),作为新的背景图像BN(x,y)。S65. The current frame image F k (x, y) processed in S63 and S64 is used as a new background image B N (x, y). 7.根据权利要求6所述的一种基于连续帧间差分的背景图像更新方法,其特征在于,所述的S7步骤具体为:继续读取视频下一帧图像,将下一帧图像与新背景图像作差,再重复步骤S3至S7,实现基于背景差分法的运动目标检测过程中背景图像的更新。7. A method for updating background images based on continuous inter-frame differences according to claim 6, wherein the step S7 is specifically: continue to read the next frame image of the video, and combine the next frame image with the new The background image is subtracted, and then steps S3 to S7 are repeated to realize updating of the background image during the moving target detection process based on the background subtraction method.
CN201910472023.5A 2019-05-31 2019-05-31 A kind of background image update method based on continuous inter-frame difference Pending CN110349189A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910472023.5A CN110349189A (en) 2019-05-31 2019-05-31 A kind of background image update method based on continuous inter-frame difference

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910472023.5A CN110349189A (en) 2019-05-31 2019-05-31 A kind of background image update method based on continuous inter-frame difference

Publications (1)

Publication Number Publication Date
CN110349189A true CN110349189A (en) 2019-10-18

Family

ID=68174569

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910472023.5A Pending CN110349189A (en) 2019-05-31 2019-05-31 A kind of background image update method based on continuous inter-frame difference

Country Status (1)

Country Link
CN (1) CN110349189A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111260695A (en) * 2020-01-17 2020-06-09 桂林理工大学 A kind of debris identification algorithm, system, server and medium
CN112036254A (en) * 2020-08-07 2020-12-04 东南大学 Moving vehicle foreground detection method based on video image
CN113487639A (en) * 2021-07-14 2021-10-08 北京金山云网络技术有限公司 Image processing method and device, electronic equipment and storage medium
CN113780113A (en) * 2021-08-25 2021-12-10 廊坊中油朗威工程项目管理有限公司 Pipeline violation behavior identification method

Citations (7)

* Cited by examiner, † Cited by third party
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
CN103164855A (en) * 2013-02-26 2013-06-19 清华大学深圳研究生院 Bayesian Decision Theory foreground extraction method combined with reflected illumination
CN103325112A (en) * 2013-06-07 2013-09-25 中国民航大学 Quick detecting method for moving objects in dynamic scene
CN104463795A (en) * 2014-11-21 2015-03-25 高韬 Processing method and device for dot matrix type data matrix (DM) two-dimension code images
US20150117761A1 (en) * 2013-10-29 2015-04-30 National Taipei University Of Technology Image processing method and image processing apparatus using the same
CN107169985A (en) * 2017-05-23 2017-09-15 南京邮电大学 A kind of moving target detecting method based on symmetrical inter-frame difference and context update
CN109145736A (en) * 2018-07-18 2019-01-04 南京行者易智能交通科技有限公司 A kind of detection method that the subway station pedestrian based on video analysis inversely walks

Patent Citations (7)

* Cited by examiner, † Cited by third party
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
CN103164855A (en) * 2013-02-26 2013-06-19 清华大学深圳研究生院 Bayesian Decision Theory foreground extraction method combined with reflected illumination
CN103325112A (en) * 2013-06-07 2013-09-25 中国民航大学 Quick detecting method for moving objects in dynamic scene
US20150117761A1 (en) * 2013-10-29 2015-04-30 National Taipei University Of Technology Image processing method and image processing apparatus using the same
CN104463795A (en) * 2014-11-21 2015-03-25 高韬 Processing method and device for dot matrix type data matrix (DM) two-dimension code images
CN107169985A (en) * 2017-05-23 2017-09-15 南京邮电大学 A kind of moving target detecting method based on symmetrical inter-frame difference and context update
CN109145736A (en) * 2018-07-18 2019-01-04 南京行者易智能交通科技有限公司 A kind of detection method that the subway station pedestrian based on video analysis inversely walks

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
屠礼芬: "自然场景下运动目标检测关键问题研究", 《中国博士学位论文全文数据库 信息科技辑》 *
徐志刚: "《路面破损图像自动识别技术》", 30 September 2018, 西安电子科技大学出版社 *
樊晓亮 等: "基于帧间差分的背景提取与更新算法", 《计算机工程》 *
霍富功 等: "基于对称差分的背景减法运动目标检测", 《传感器世界》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111260695A (en) * 2020-01-17 2020-06-09 桂林理工大学 A kind of debris identification algorithm, system, server and medium
CN112036254A (en) * 2020-08-07 2020-12-04 东南大学 Moving vehicle foreground detection method based on video image
WO2022027931A1 (en) * 2020-08-07 2022-02-10 东南大学 Video image-based foreground detection method for vehicle in motion
CN112036254B (en) * 2020-08-07 2023-04-18 东南大学 Moving vehicle foreground detection method based on video image
CN113487639A (en) * 2021-07-14 2021-10-08 北京金山云网络技术有限公司 Image processing method and device, electronic equipment and storage medium
CN113780113A (en) * 2021-08-25 2021-12-10 廊坊中油朗威工程项目管理有限公司 Pipeline violation behavior identification method

Similar Documents

Publication Publication Date Title
CN110349189A (en) A kind of background image update method based on continuous inter-frame difference
WO2022027931A1 (en) Video image-based foreground detection method for vehicle in motion
Hu et al. Robust real-time ship detection and tracking for visual surveillance of cage aquaculture
Kumar et al. An efficient approach for detection and speed estimation of moving vehicles
Desa et al. Image subtraction for real time moving object extraction
CN101315701B (en) Moving Target Image Segmentation Method
Kaur et al. An efficient approach for number plate extraction from vehicles image under image processing
CN104616290A (en) Target detection algorithm in combination of statistical matrix model and adaptive threshold
CN106548488A (en) It is a kind of based on background model and the foreground detection method of inter-frame difference
Huang et al. Motion detection with pyramid structure of background model for intelligent surveillance systems
El Harrouss et al. Motion detection based on the combining of the background subtraction and spatial color information
CN101715070A (en) Method for automatically updating background in specifically monitored video
Hou et al. A background reconstruction algorithm based on pixel intensity classification in remote video surveillance system
Angelo A novel approach on object detection and tracking using adaptive background subtraction method
CN103336965B (en) Based on profile difference and the histogrammic prospect of block principal direction and feature extracting method
Yao et al. An improved mixture‐of‐Gaussians background model with frame difference and blob tracking in video stream
CN103209321B (en) A kind of video background Rapid Updating
CN114419069A (en) SAR moving target shadow detection method adopting threshold segmentation and multi-frame association
Rout et al. A novel five-frame difference scheme for local change detection in underwater video
Kaur et al. An Efficient Method of Number Plate Extraction from Indian Vehicles Image
Djalalov et al. An algorithm for vehicle detection and tracking
CN112634299B (en) A method for detecting residues without interference from flying insects
Vinary et al. Object tracking using background subtraction algorithm
Fadhel et al. Real-Time detection and tracking moving vehicles for video surveillance systems using FPGA
Yang et al. Dual frame differences based background extraction algorithm

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: 20191018

RJ01 Rejection of invention patent application after publication