CN110580706A - Method and device for extracting video background model - Google Patents

Method and device for extracting video background model Download PDF

Info

Publication number
CN110580706A
CN110580706A CN201810593818.7A CN201810593818A CN110580706A CN 110580706 A CN110580706 A CN 110580706A CN 201810593818 A CN201810593818 A CN 201810593818A CN 110580706 A CN110580706 A CN 110580706A
Authority
CN
China
Prior art keywords
background model
parameter
frame
initial
updating
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
CN201810593818.7A
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.)
Beijing Zhongke Super Media Information Technology Co Ltd
Original Assignee
Beijing Zhongke Super Media Information Technology Co Ltd
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 Beijing Zhongke Super Media Information Technology Co Ltd filed Critical Beijing Zhongke Super Media Information Technology Co Ltd
Priority to CN201810593818.7A priority Critical patent/CN110580706A/en
Publication of CN110580706A publication Critical patent/CN110580706A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • 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

Abstract

The invention relates to a method for extracting a video background library, which comprises the following steps: receiving a video frame image, and executing background model initialization to obtain an initial background model; continuously receiving the video frame image, executing updating extraction on the background model according to a preset updating speed, and simultaneously recording the change state of the video frame image; and adjusting the updating speed of the background model according to the recorded change state, and executing the updating extraction of the background model according to the new updating speed.

Description

method and device for extracting video background model
Technical Field
The invention relates to the technical field of video extraction, in particular to a method and a device for extracting a video background model.
Background
With the progress of science and technology, the development of smart cities is also changing day by day, and artificial intelligence technology has been applied to various industries, for example, in the field of video processing, it has become a current development trend to apply computer vision technology to image processing, target analysis and the like, and particularly, a target identification technology for a video monitoring system is required to ensure that the system can accurately and stably operate in a complex environment and ensure the real-time performance of the system.
In the prior art, methods for identifying an object in a video mainly include an optical flow method, a frame difference method, a background difference method, and the like, where the background difference method is a common object detection method for comparing a current frame in an obtained video sequence with a background model to detect different areas so as to determine an object area. In the target detection process, the accuracy of the background model directly influences the target detection result. For an environment with a complex background, the difficulty of target detection and extraction is increased.
Therefore, there is a need for a method and an apparatus for extracting a background model of a video in a complex environment.
disclosure of Invention
The invention provides a method for extracting a video background library, which comprises the following steps:
step 1) receiving a video frame image, and initializing a background model to obtain an initial background model;
step 2) continuously receiving the video frame image, executing updating extraction on the background model according to a preset initial updating speed, and simultaneously recording the change state of the video frame image;
and 3) adjusting the updating speed of the background model according to the change state recorded in the step 2), and executing the updating and extracting of the background model in the step 2) according to the new updating speed.
Preferably, the step 1) further comprises:
step 11) taking the first frame of the received video frame image as the initial background model;
step 12) modeling the first N frame images of the received video frame images and obtaining an initial standby background model, wherein N is a positive integer greater than 1;
step 13) carrying out similarity judgment on the initial background model of the step 11) and the initial standby background model of the step 12);
under the condition that the initial background model of the step 11) is the same as the initial standby background model of the step 12), continuing to use the first frame of the received video frame image as the initial background model;
Under the condition that the initial background model in the step 11) is different from the initial standby background model in the step 12), replacing the first frame with the current frame of the current initial standby model to be used as an initial background model.
preferably, the step 2) further comprises: representing a change state of the video frame image by using a parameter M1 and a parameter M2; wherein the parameter value M1 is used to represent the possibility that the background image in the video remains stable; the parameter M2 is used to represent the probability of having a target object in the video; m1 and M2 are both positive numbers greater than 0, and the initial value is set to 0.
Preferably, the step 2) further comprises:
Step 21) continuously receiving the video frame image, and carrying out similarity judgment on the current frame and the adjacent frame of the current frame;
In case the current frame is different from the neighboring frame, then the parameter M1 is set to zero and the parameter M2 is increased;
In the case that the current frame is the same as the adjacent frame, then the parameter M1 is increased and the parameter M2 is set to zero;
Step 22) continuing to receive a next frame image as the current frame, and repeating the similarity judgment of the step 21) until the parameter M1 is increased to a threshold value T0, so as to replace the initial background model obtained in the step 1) with the current frame to form a new background model, thereby completing one-time updating and extracting of the background model; wherein the threshold T0 represents that the stability of the background model can meet the threshold for performing the background model update;
Step 23) repeating the step 21) and the step 22), and finishing continuous updating and extracting of the background model.
Preferably, the step 3) further comprises: adjusting the updating speed of the background model by using the parameter M2; increasing the preset threshold T0 when the parameter M2 is set to zero; when the parameter M2 increases to a preset threshold T1, the preset threshold T0 is decreased.
preferably, the step 3) further comprises: calculating the similarity between the current background model and the previous background model and adjusting the preset threshold T0; using a parameter Q to represent the continuous same number of the background models; if the current background model is the same as the previous background model, increasing the parameter Q by 1, and increasing the preset threshold value T0 when the parameter Q is increased to a preset threshold value Q0; if the current background model is different from the previous background model, setting the parameter Q to zero, and decreasing the preset threshold T0.
Preferably, the step 3) further comprises: using the parameter M3 for representing the brightness change speed of the video frame image, when the parameter M3 is increased to the preset threshold T2, the preset threshold T0 does not need to be decreased; wherein M3 is a positive number greater than 0.
Preferably, the similarity determination is performed using a frame difference method.
Preferably, the maximum bounding box is adopted to cover a continuous target area in the binary image for the determination result, a preset threshold T4 is used for screening, and denoising is performed.
according to another aspect of the present invention, there is also provided an apparatus for extracting a video background model, including a capture module for capturing video frame images; the calculation module receives the video frame from the acquisition module and performs background model updating calculation; the control module is respectively connected with the acquisition module and the calculation module and is used for adjusting the updating speed; the computing module is further used for executing initialization of the background model, similarity judgment, denoising processing and updating decision.
compared with the prior art, the invention has the following beneficial technical effects: the method and the device for extracting the video background model select a mode of judging the similarity between N frame images and a first frame image to initialize the extraction of the background model, adopt denoising processing to improve the judgment precision, record the change of a video scene in the updating process by utilizing a parameter representing the possibility that the background image in the video keeps stable, a parameter representing the possibility that a target object exists in the video and a parameter representing the brightness change in the video, adjust the updating speed in real time according to the scene change, slow down the updating speed when the background model keeps stable or has no target object, and improve the updating speed when the background model changes faster or has the target object, thereby reasonably distributing the computing resources for updating the background model and saving the computing cost.
Drawings
fig. 1 is a flowchart of a method for extracting a video background model according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more clearly apparent, the following describes in detail a method and an apparatus for extracting a video background provided in an embodiment of the present invention with reference to the accompanying drawings.
the method mainly comprises the following steps that the current background extraction algorithms are mainly divided into two types based on pixel values and texture changes, wherein the algorithms which are widely applied comprise a weighted average method and a mixed Gaussian modeling algorithm, and through research and analysis, the inventor finds that the algorithms cannot well balance the calculation complexity and the extracted background accuracy, for example, although the calculation principle of the weighted average method is simple, the generated background is easily influenced by targets and noise, and the accuracy is not high; the Gaussian mixture modeling algorithm utilizes a plurality of model characteristics to represent a pixel point, the accuracy is high, but the parameter operation is complex, and a large amount of data needs to be calculated in practical application; meanwhile, in a gradual background updating mode in the prior art, a pseudo background frame image often appears on a daily generated background; in addition, the background update rates in these methods are all fixed thresholds, which are simple but cannot adapt to the scene change, resulting in a waste of unnecessary computing resources and time.
In order to solve the above problems, the inventor provides a method and an apparatus for extracting a video background model through a large number of experiments, which can control the update speed of the background model according to the change of a scene. Fig. 1 is a flowchart of a method for extracting a video background model provided by the present invention, and as shown in fig. 1, the method specifically includes the following steps:
S10 background model initialization
taking the first frame of the received video image as an initial background model, according to an embodiment of the present invention, the initialization method specifically includes the following steps:
S101, reading and storing video images of a first frame to an Nth frame, wherein N is a positive integer greater than 1, modeling the N frame images, for example, dividing the frame images into 16 × 16 image blocks, calculating by using a weighted average algorithm to obtain a pixel point mean value, and performing modeling by using a statistical algorithm to obtain an image model of the previous N frames as an initial standby background model;
S102, carrying out similarity judgment on the obtained initial background model (namely the first frame) and the initial standby model (namely the previous N frames), for example, detecting whether the two image models have different region blocks by using a frame difference method so as to judge;
If the two image models are the same as each other, the first frame is continuously used as an initial background model;
and if the two image models are different as a result of the judgment, replacing the current frame (namely the Nth frame) with the first frame to serve as the initial background model.
Update of S20 background model
after the background model initialization of the above step S10 is completed, the next frame image is continuously read as the current frame, assuming that the parameter value M1 is used to indicate the possibility that the background image in the video remains stable, and M2 is used to indicate the possibility that the video has the target object, where M1 and M2 are both positive numbers greater than 0, and the initial value is set to 0; the threshold T0 represents that the stability of the background model can meet the threshold for performing the background model update, and according to an embodiment of the present invention, the background model update step includes:
S201, carrying out similarity judgment on the current frame image and an adjacent frame thereof, for example, detecting whether different area blocks exist between the current frame and the adjacent frame by using a frame difference method for judging whether the two adjacent frame images or the three adjacent frame images exist;
if the judgment result shows that the current frame is different from the adjacent frame, the parameter M1 is set to zero, and the parameter M2 is increased; indicating that there is an increased likelihood of the target object in the current frame;
If the judgment result shows that the current frame is the same as the adjacent frame, the parameter M1 is increased, and the parameter M2 is set to zero, which indicates that the current frame tends to be stable, namely the possibility of extracting the current frame as a background model is increased;
s202, continuously receiving the next frame image as a current frame, repeating the step of judging the similarity in the step S201 until the parameter M1 is increased to a preset threshold value T0, replacing the initial background model obtained in the step S10 with the current frame to form a new background model, and finishing one-time extraction and updating of the background model;
and S203, repeating the step S201 and the step S202, and finishing continuous updating and extracting of the background model.
in an embodiment of the present invention, the update speed of the background model may be adjusted by using the parameter M2 according to the change of the scene, and the specific method is as follows:
A preset threshold T1, where T1 represents a preset upper limit of the probability judgment criterion of having the target object in the video, that is, an upper limit of the parameter M2;
when the similarity determination in step S20 is performed, the increase and decrease calculation on the parameter M2 is performed at the same time, and when M2 is set to zero, it indicates that there is a low possibility that a target object exists in the video until the current frame, at this time, in order to save the operation resources, the preset threshold T0 may be increased, that is, the update speed of the background model is reduced;
correspondingly, when M2 increases to the threshold T1, it indicates that the probability of having a target object in the video is higher than the preset criterion until the current frame, and at this time, in order to improve the accuracy of target identification, it is necessary to reduce the preset threshold T0, i.e. to increase the update speed of the background model.
in an embodiment of the present invention, the preset threshold T0 may also be adjusted by comparing the similarity between the current background model and the previous background model, and the specific steps are as follows:
Assuming that the same number of continuous background models is represented by the parameter Q, after a new updated background model (i.e., the current background model) is obtained, the similarity of the obtained continuous background model and the previous background model is compared, if the comparison result shows that the current background model is the same as the previous background model, the parameter Q is increased by 1, and when the parameter Q is increased to a preset threshold value Q0, a preset threshold value T0 is increased so as to reduce the updating speed of the background model and save resources; if the comparison result shows that the current background model is different from the previous background model, the parameter Q is set to zero immediately, and the preset threshold T0 is reduced at the same time, so as to increase the updating speed of the background model immediately.
in addition, according to other embodiments of the present invention, it may also be assumed that the parameter M3 is used to represent the luminance change speed of the video frame image, and a constraint is made on the condition of increasing the update speed of the background model, specifically, when the parameter M2 increases to the threshold T1, indicating that the probability of having a target object in the video is above a preset criterion, however, if the factor causing the target object to appear at this time is only due to a sudden change in the brightness of the video background, instead of having a movable target object enter the video range, it can be determined whether the parameter M3 reaches the preset threshold T2, that is, when the parameter M3 reaches the preset threshold T2, even if the parameter M2 increases to the preset threshold T1, the value of T0 does not need to be decreased, the updating speed of the background model does not need to be increased, and the waste of computing resources can be avoided and the cost is saved by utilizing the constraint conditions.
According to other embodiments of the present invention, the parameters M1, M2, M3, and the preset thresholds T0, T1, T2 may be preset for a specific application scenario; the parameter may also be obtained through statistical analysis of a large amount of experimental data, and the increase and decrease widths executed on the parameters M1 and M2 for each determination result may also be set according to application requirements, for example, for an application scenario with a high requirement on accuracy, when performing an increase operation on the parameter M1 or a decrease operation on the parameter M2 (i.e., decreasing the update speed), accumulation or reduction may be adopted, and when performing a decrease operation on the parameter M1 or an increase operation on the parameter M2 (i.e., increasing the update speed), exponential accumulation or reduction may be adopted, so that it may be ensured that the update speed may be decreased slowly when decreasing the update speed, and may be increased rapidly when increasing the update speed, thereby ensuring the accuracy of target identification; correspondingly, for an application scenario with a high calculation cost control requirement, an increase/decrease range calculation method opposite to the above-mentioned method can be adopted.
In an embodiment of the present invention, when performing similarity determination between any two image models, denoising may be performed, which specifically includes: firstly, converting two frames of color images into binary images, covering continuous target areas in the binary images by adopting a maximum external frame according to the characteristic that single individual target is continuous, and screening by using a preset threshold value T4 by taking the external frame as a unit, thereby reducing interference noise caused by unstable factors such as illumination and the like on the images; the threshold T4 may be preset for a specific application scenario; or obtained through a large amount of statistical analysis of experimental data.
The invention also provides a device for extracting the video background model by using the method, which comprises an acquisition module for acquiring the video frame image; the calculation module receives the video frame from the acquisition module and performs background model updating calculation; the control module is respectively connected with the acquisition module and the calculation module and is used for adjusting the updating speed; the computing module is further used for executing initialization of the background model, similarity judgment, denoising processing and updating decision.
although in the above embodiments, the method and the apparatus for extracting a video background model provided by the present invention are described by taking an example of modeling N frame images by using a block weighted average and statistical algorithm and performing similarity determination by using a frame difference method, it should be understood by those skilled in the art that other modeling methods and similarity determination methods may also be used to perform the method for extracting a video background model provided by the present invention, such as a histogram statistical method based on pixel points.
although the present invention has been described by way of preferred embodiments, the present invention is not limited to the embodiments described herein, and various changes and modifications may be made without departing from the scope of the present invention.

Claims (10)

1. a method for extracting a video background library comprises the following steps:
step 1) receiving a video frame image, and initializing a background model to obtain an initial background model;
Step 2) continuously receiving the video frame image, executing updating extraction on the background model according to a preset initial updating speed, and simultaneously recording the change state of the video frame image;
and 3) adjusting the updating speed of the background model according to the change state recorded in the step 2), and executing the updating and extracting of the background model in the step 2) according to the new updating speed.
2. The extraction method according to claim 1, wherein the step 1) further comprises:
Step 11) taking the first frame of the received video frame image as the initial background model;
step 12) modeling the first N frame images of the received video frame images and obtaining an initial standby background model, wherein N is a positive integer greater than 1;
Step 13) carrying out similarity judgment on the initial background model of the step 11) and the initial standby background model of the step 12);
Under the condition that the initial background model of the step 11) is the same as the initial standby background model of the step 12), continuing to use the first frame of the received video frame image as the initial background model;
under the condition that the initial background model in the step 11) is different from the initial standby background model in the step 12), replacing the first frame with the current frame of the current initial standby model to be used as an initial background model.
3. The extraction method according to claim 1, wherein the step 2) further comprises: representing a change state of the video frame image by using a parameter M1 and a parameter M2; wherein the parameter value M1 is used to represent the possibility that the background image in the video remains stable; the parameter M2 is used to represent the probability of having a target object in the video; m1 and M2 are both positive numbers greater than 0, and the initial value is set to 0.
4. the extraction method according to claim 3, wherein the step 2) further comprises:
step 21) continuously receiving the video frame image, and carrying out similarity judgment on the current frame and the adjacent frame of the current frame;
In case the current frame is different from the neighboring frame, then the parameter M1 is set to zero and the parameter M2 is increased;
In the case that the current frame is the same as the adjacent frame, then the parameter M1 is increased and the parameter M2 is set to zero;
Step 22) continuing to receive a next frame image as the current frame, and repeating the similarity judgment of the step 21) until the parameter M1 is increased to a threshold value T0, so as to replace the initial background model obtained in the step 1) with the current frame to form a new background model, thereby completing one-time updating and extracting of the background model; wherein the threshold T0 represents that the stability of the background model can meet the threshold for performing the background model update;
step 23) repeating the step 21) and the step 22), and finishing continuous updating and extracting of the background model.
5. the extraction method according to claim 4, wherein the step 3) further comprises: adjusting the updating speed of the background model by using the parameter M2; increasing the preset threshold T0 when the parameter M2 is set to zero; when the parameter M2 increases to a preset threshold T1, the preset threshold T0 is decreased.
6. The extraction method according to claim 4, wherein the step 3) further comprises: calculating the similarity between the current background model and the previous background model and adjusting the preset threshold T0; using a parameter Q to represent the continuous same number of the background models; if the current background model is the same as the previous background model, increasing the parameter Q by 1, and increasing the preset threshold value T0 when the parameter Q is increased to a preset threshold value Q0; if the current background model is different from the previous background model, setting the parameter Q to zero, and decreasing the preset threshold T0.
7. The extraction method according to claim 6, wherein the step 3) further comprises: using the parameter M3 for representing the brightness change speed of the video frame image, when the parameter M3 is increased to the preset threshold T2, the preset threshold T0 does not need to be decreased; wherein M3 is a positive number greater than 0.
8. the extraction method according to any one of claims 2 or 4, wherein the similarity determination is performed using a frame difference method.
9. The extraction method according to claim 8, wherein a maximum bounding box is used for covering continuous target regions in the binary image for the determination result, and a preset threshold T4 is used for screening to perform denoising processing.
10. the extraction device of the video background model comprises an acquisition module for acquiring video frame images; the calculation module receives the video frame from the acquisition module and performs background model updating calculation; the control module is respectively connected with the acquisition module and the calculation module and is used for adjusting the updating speed; the computing module is further used for executing initialization of the background model, similarity judgment, denoising processing and updating decision.
CN201810593818.7A 2018-06-11 2018-06-11 Method and device for extracting video background model Pending CN110580706A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810593818.7A CN110580706A (en) 2018-06-11 2018-06-11 Method and device for extracting video background model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810593818.7A CN110580706A (en) 2018-06-11 2018-06-11 Method and device for extracting video background model

Publications (1)

Publication Number Publication Date
CN110580706A true CN110580706A (en) 2019-12-17

Family

ID=68809335

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810593818.7A Pending CN110580706A (en) 2018-06-11 2018-06-11 Method and device for extracting video background model

Country Status (1)

Country Link
CN (1) CN110580706A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111199595A (en) * 2019-12-25 2020-05-26 深圳市东仪电子有限公司 Numerical display control method
CN114998897A (en) * 2022-06-13 2022-09-02 北京百度网讯科技有限公司 Method for generating sample image and training method of character recognition model

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102956032A (en) * 2011-08-22 2013-03-06 天津市亚安科技股份有限公司 Target template updating method
US20140132789A1 (en) * 2012-11-12 2014-05-15 Sony Corporation Image processing device, image processing method and program
CN107798689A (en) * 2016-08-28 2018-03-13 淮安信息职业技术学院 Traffic video image background extracting method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102956032A (en) * 2011-08-22 2013-03-06 天津市亚安科技股份有限公司 Target template updating method
US20140132789A1 (en) * 2012-11-12 2014-05-15 Sony Corporation Image processing device, image processing method and program
CN107798689A (en) * 2016-08-28 2018-03-13 淮安信息职业技术学院 Traffic video image background extracting method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
胡佳兵等: "面向视频监控节带传输的背景管理技术研究", 《中国科技论文在线》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111199595A (en) * 2019-12-25 2020-05-26 深圳市东仪电子有限公司 Numerical display control method
CN114998897A (en) * 2022-06-13 2022-09-02 北京百度网讯科技有限公司 Method for generating sample image and training method of character recognition model
CN114998897B (en) * 2022-06-13 2023-08-29 北京百度网讯科技有限公司 Method for generating sample image and training method of character recognition model

Similar Documents

Publication Publication Date Title
CN107872644B (en) Video monitoring method and device
EP1975879B1 (en) Computer implemented method for tracking object in sequence of frames of video
CN1875378B (en) Object detection in images
CN111062974B (en) Method and system for extracting foreground target by removing ghost
CN111260684A (en) Foreground pixel extraction method and system based on combination of frame difference method and background difference method
CN110913243B (en) Video auditing method, device and equipment
EP2959454A1 (en) Method, system and software module for foreground extraction
CN106327488B (en) Self-adaptive foreground detection method and detection device thereof
US20230334235A1 (en) Detecting occlusion of digital ink
US11107237B2 (en) Image foreground detection apparatus and method and electronic device
US20140056519A1 (en) Method, apparatus and system for segmenting an image in an image sequence
CN110060278B (en) Method and device for detecting moving target based on background subtraction
CN112966654B (en) Lip movement detection method, lip movement detection device, terminal equipment and computer readable storage medium
KR20180109658A (en) Apparatus and method for image processing
CN109255799B (en) Target tracking method and system based on spatial adaptive correlation filter
CN103729828A (en) Video rain removing method
CN110580706A (en) Method and device for extracting video background model
CN111723634A (en) Image detection method and device, electronic equipment and storage medium
CN113379789B (en) Moving target tracking method in complex environment
CN111625683B (en) Automatic video abstract generation method and system based on graph structure difference analysis
Xie et al. Robust vehicles extraction in a video-based intelligent transportation systems
CN114663347B (en) Unsupervised object instance detection method and unsupervised object instance detection device
CN112950652B (en) Robot and hand image segmentation method and device thereof
CN114298992A (en) Video frame duplication removing method and device, electronic equipment and storage medium
CN113034387A (en) Image denoising method, device, equipment and medium

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
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20191217

WD01 Invention patent application deemed withdrawn after publication