CN105844671A - Rapid background subtraction method under changing illumination conditions - Google Patents
Rapid background subtraction method under changing illumination conditions Download PDFInfo
- Publication number
- CN105844671A CN105844671A CN201610223117.5A CN201610223117A CN105844671A CN 105844671 A CN105844671 A CN 105844671A CN 201610223117 A CN201610223117 A CN 201610223117A CN 105844671 A CN105844671 A CN 105844671A
- Authority
- CN
- China
- Prior art keywords
- image
- background
- illumination
- matrix
- mean
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10016—Video; Image sequence
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20212—Image combination
- G06T2207/20224—Image subtraction
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30232—Surveillance
Landscapes
- Image Analysis (AREA)
Abstract
The invention relates to a rapid background subtraction method under changing illumination conditions. The method is performed through the following steps: learning a background template by comparing the average image difference value and variance between a to-be-detected frame and a precious frame to see if illumination changes or not; relearning the background template if the illumination is found out to have changed; and if the illumination is found out to have remained unchanged, further utilizing the average image difference value between the current frame and the background template, and comparing the average image difference value to a threshold value of background learning to see if there is any foreign object invasion. The algorithm provided by the invention not only achieves a good background subtraction effect, but it is also fast to calculate. The method can be especially suitable for scenarios where illumination changes rapidly. The algorithm of the invention can also rapidly detect the change in illumination to achieve background subtraction and the extraction of relevant invading foreign bodies.
Description
Technical field
The present invention relates to image processing techniques, the fast background relief method under the conditions of shining more particularly to a kind of darkening.
Background technology
In computer vision information extraction technology, moving object detection is one committed step, is also higher level
The important foundation of video image analysis.System motion of interest mesh is extracted the most fast and accurately from sequence of video images
Mark, is many research worker problem of interest.The most conventional moving target detecting method mainly has optical flow method, frame poor
Method and background subtraction method three kinds.Wherein, optical flow method owing to computing is complicated, hardware device is required high and applies less, frame difference method
Due to problems such as Position location accuracy are poor, computationally intensive, apply the most fewer, and background subtraction method owing to amount of calculation is few, realize
Simply, and accurate positioning and do not expand the advantages such as moving region compared with frame difference method, obtained comparing and be widely applied.
Current foreign body based on background subtraction method extract generally by the motor image vegetarian refreshments found in image sequence and
Still image vegetarian refreshments, thus find the region of variation in prospect, and then the foreign body of invasion is extracted from background image.Use
When background subtraction method detection moving target or invasion foreign body, first have to set up background model, and in the method for building up of background model,
Mixed Gauss model method is the more one of application, and the method can adapt to the slowly varying of light and disturbance that some are little,
But it is complicated that it calculates process, choosing the impact of its Detection results of model parameter is relatively big, and it is existing that the background extracted has " ghost "
As, when light changes suddenly (illumination variation caused such as switch lamp), its detection usually makes mistakes.In addition with some based in advance
Survey the background modeling method estimated, such as Kalman filter method, although this method has stronger inhibitory action to noise, but works as
When the change of background is very fast, the probability that this method is made mistakes will be greatly increased.
Summary of the invention
It is an object of the invention to provide the fast background relief method under the conditions of a kind of darkening more quick, simple is shone,
The problem that during to solve that illumination condition conversion is very fast present in existing background subtraction algorithm, detection easily makes mistakes.
The object of the present invention is achieved like this:
Fast background relief method under the conditions of a kind of darkening photograph, its process is: some with continuous print in grayscale image sequence
Two field picture carries out Background learning as background image, then judges the illumination condition of current frame image to be measured and its previous frame image
Whether change, if illumination there occurs change, then re-start Background learning, if illumination does not change, then profit
Compare with the result of Background learning with the average of background template image difference with current frame image to be measured, according to comparative result
Determine whether foreign body intrusion.
Described a kind of darkening according under the conditions of fast background relief method, described process particularly as follows:
1., described grayscale image sequence is: first select sequence of video images, then by all figures in sequence of video images
As being converted to gray level image, thus obtain grayscale image sequence;
2. the process of Background learning, is carried out using the some two field pictures of continuous print in described grayscale image sequence as background image
It is:
First, learn background template image, i.e. calculate average A of these some two field pictures;Ai
(i=1,2 ..., the n) gray level image carrying out Background learning selected by expression, A represents the ash of selected some two field pictures
The average of angle value;
Then, average mean of the Mean Matrix T of the absolute value of the difference of this all adjacent image of some two field pictures is calculated
(|T|);
Wherein, during T represents selected some two field pictures all
The Mean Matrix of the absolute value of adjacent image gray value differences value matrix;Mean (| T |) is for take all elements in Mean Matrix T
The result of value
In this step, the quantity value of described some two field pictures is 5~20;
3., judge whether current frame image to be measured changes with the illumination condition of its previous frame image;
If 4. step judged result 3. is that illumination condition does not change, then to when prior image frame to be measured and the back of the body
Scape template image carries out background subtraction and obtains Matrix C;Pixels all in Matrix C are taken absolute value and obtains matrix | C |, to matrix
The middle all elements of | C | takes average and variance obtains mean (| C |) and std (| C |);
If mean (| C |) > 2T, then it is judged as having foreign body intrusion, then utilizes threshold value M to present frame gray image to be measured
Carry out binaryzation, extract the foreign body of invasion, wherein threshold value
If mean (| C |)≤2T, then it is judged as that foreign is invaded, then continues to judge that the next one is treated by step method 3.
Whether survey current frame image changes with the illumination condition of its previous frame image;
If 5. step judged result 3. is that illumination condition there occurs change, then reselect by step method 2.
Background image carries out Background learning.
Described darkening according under the conditions of fast background relief method in, the most described judgement of step current frame image to be measured and its
The method whether illumination condition of previous frame image changes is:
Calculate present frame gray image A to be measuredjWith its former frame gray level image Aj-1The difference square of each pixel gray value
Battle array B, and the absolute value of matrix B all elements is taken average mean (| B |) and variance std (| B |);
If mean (| B |) < std (| B |), then it is judged as that illumination condition does not change;Otherwise, then light it is judged as
Change is there occurs according to condition.
The described fast background relief method under the conditions of darkening photograph, the quantity value of described some two field pictures is preferably 10.
At present, the darkening that the present invention is the average of gray scale based on image and variance combines according under the conditions of a kind of quickly
Background wipes out method, first passes through the meansigma methods of the study each image intensity value of calculating of multiple image thus obtains background image, then
Obtained average and the variance of absolute difference by background subtracting and frame difference method, by the contrast of average Yu variance, carry out twice
Multilevel iudge, uses background subtraction to obtain the foreign body of invasion, utilizes the contrast of different average to extract foreign body simultaneously.In the present invention
Algorithm not only there is preferable background subtraction effect, and it is fast to calculate speed, is particularly suited for the rapid scene of illumination variation.
Algorithm in the present invention can be the most real-time the detection carrying out illumination variation, thus realize background subtraction, extract relevant invasion
Foreign body.
Accompanying drawing explanation
Fig. 1 is the structured flowchart of the inventive method.
Fig. 2 is the gray level images as background image of 10 frames selected by Step2.
Fig. 3 is the mean value computation result of the gray value of each pixel of 10 two field pictures selected by Step2.
Fig. 4 is the present frame gray image to be measured in the case of illumination condition does not change and its former frame gray scale
Image.
Fig. 5 is that illumination condition there occurs the present frame gray image to be measured in the case of change and its former frame gray-scale map
Picture.
Fig. 6 is to the result extracting invasion foreign body after b figure carries out binaryzation in Fig. 4.
Fig. 7 is to use tradition background subtraction that b figure in Fig. 4 is carried out the result of background subtraction.
Detailed description of the invention
Embodiment 1
The present invention is further detailed explanation below in conjunction with the accompanying drawings, and Fig. 1 is the structured flowchart of the inventive method.
Step1: start:
Wherein 1500 frame continuous print sequence of video images is chosen, then by the institute in sequence of video images from video image
Image is had to be converted into gray level image, it is thus achieved that grayscale image sequence.
The matrix that each two field picture in grayscale image sequence is all constituted with the gray value of its each pixel for element represents.
Step2: select 10 frame suitable continuous print image as Background from this 1500 frame continuous print grayscale image sequence
As (such as Fig. 2) carries out Background learning, Background learning process is:
(1) study background template image, i.e. calculates average A of this 10 two field picture:
Wherein, Ai(i=1,2 ..., 10) be
The gray value matrix of each pixel of the i-th two field picture in 10 selected two field pictures, A represents each picture of 10 selected two field pictures
The matrix that the average of the gray value of vegetarian refreshments is constituted, its result as it is shown on figure 3,
(2) average mean (| T |) of the Mean Matrix of the absolute value of all adjacent image differences in this 10 two field picture is calculated:
Wherein, Ai(i=1,2 ... 10) it is 10 selected frames
The gray value matrix of each pixel of the i-th two field picture in image, T is Mean Matrix, all in 10 two field pictures selected by expression
The average of the absolute value of the matrix of differences of adjacent two width images, mean (| T |) is for take average to all elements in Mean Matrix T
Result.
In this step, carry out when choosing of background image for the first time, using continuous print 10 frame foreign invasion image as the back of the body
Scape image.
Step3: judge whether current frame image to be measured changes with the illumination condition of its previous frame image:
If current frame image to be measured is Aj, its previous frame image is Aj-1;If current frame image to be measured and previous frame image thereof
The average of absolute value of all elements of matrix of differences and variance result of calculation be mean (| B |) < std (| B |), such as Fig. 4
Shown in the result of calculation of image (in Fig. 4, (a) image is the previous frame image of (b) image) be mean (| B |)=0.4004,
Std (| B |)=0.9866, due to 0.4004 < 0.9866, then judged result is that illumination condition does not change,
If in the matrix of differences of current frame image to be measured and previous frame image thereof the average of the absolute value of all elements and
Variance result of calculation is mean (| B |) >=std (| B |), and such as image shown in Fig. 5 is (before in Fig. 5, (a) image is (b) image
One two field picture) result of calculation be mean (| B |)=64.0704, std (| B |)=25.6025, due to 64.0704 >=
25.6025, then judged result is that illumination condition there occurs change.
Step4: do not change if the judged result of Step3 is illumination condition, then to current frame image to be measured (i.e.
(b) image in Fig. 4) the Mean Matrix A that obtains with Background learning carries out background subtraction:
By current frame image A to be measuredjCarry out background subtraction with background template image and obtain Matrix C, be i.e. Matrix C=Aj-A is right
All pixels in Matrix C take absolute value and obtain matrix | C |, and the average and the variance that calculate all pixels in matrix | C | obtain
To mean (| C |) and std (| C |);
If mean (| C |) > 2mean (| T |), then it is judged as having foreign body intrusion, then utilizes threshold value M to present frame to be measured
Image AjCarry out binaryzation, extract invasion foreign body, result as shown in Figure 6, wherein threshold value
If mean (| C |)≤2mean (| T |), be then judged as that foreign is invaded, then the method pressing Step3 continues to judge
Whether next current frame image to be measured changes with the illumination condition of its previous frame image.
Wherein, present frame to be measured be chosen as the image after background image.
Step5: if the judged result of Step3 is illumination condition there occurs change, then restart by the method for Step2
Study background template, 10 frame gray level images adjacent after 10 frame gray level images selected by Step2 are as background template.
Embodiment 2
Compared with Example 1, in the present embodiment Step3 to present frame gray image to be measured and its former frame gray level image
The determination methods whether illumination condition changes is to use Gauss model, and algorithm steps carries out calculating and providing judgement routinely
Result.
Statistical result to embodiment 1 and embodiment 2 method shows, uses the method for Gauss model to change in embodiment 2
The accuracy that the situation of illumination carries out judging is about 50%, and the method for employing average in embodiment 1 and variance is to darkening
According to situation judgment accuracy about 95%, be significantly larger than use Gauss model carry out darkening according to judge time accuracy.
The foregoing describe two kinds of detailed description of the invention of the present invention, it will be appreciated by those of skill in the art that these
Detailed description of the invention is merely illustrative of, those skilled in the art in the case of without departing from the principle of the present invention and essence,
The details of said method and system can be carried out various omissions, substitutions and changes.Such as, merge said method step, thus
Perform substantially identical function according to substantially identical method and then belong to the scope of the present invention to realize substantially identical result.
Comparative example 1
Using Gauss model, calculation procedure carries out background subtraction to selected gray level image Fig. 4 (b) routinely, subduction
Result is as shown in Figure 7.
By the contrast of Fig. 6 Yu Fig. 7, it can be seen that the inventive method is relative to conventionally employed Gauss model method, different
On thing extraction effect more preferably, more accurate.
Claims (4)
1. the fast background relief method under the conditions of darkening is shone, is characterized in that, its process is: with continuous in grayscale image sequence
Some two field pictures carry out Background learning as background image, then judge the light of current frame image to be measured and its previous frame image
Whether change according to condition, if illumination there occurs change, then re-start Background learning, if illumination does not become
Change, then utilize current frame image to be measured to compare with the result of Background learning with the average of background template image difference, according to
Comparative result determines whether foreign body intrusion.
Fast background relief method under the conditions of a kind of darkening the most according to claim 1 photograph, is characterized in that, described process has
Body is:
1., described grayscale image sequence is: first selects sequence of video images, is then turned by all images in sequence of video images
It is changed to gray level image, thus obtains grayscale image sequence;
2., the process carrying out Background learning as background image using the some two field pictures of continuous print in described grayscale image sequence is:
First, learn background template image, i.e. calculate average A of these some two field pictures;
Then, average mean (| T |) of the Mean Matrix of the absolute value of the difference of this all adjacent image of some two field pictures is calculated;
In this step, the quantity value of described some two field pictures is 5~20;
3., judge whether current frame image to be measured changes with the illumination condition of its previous frame image;
If 4. step judged result 3. is that illumination condition does not change, then to when prior image frame to be measured and background mould
Plate image carries out background subtraction and obtains Matrix C;Pixels all in Matrix C are taken absolute value and obtains matrix | C |, to matrix | C |
Middle all elements takes average and variance obtains mean (| C |) and std (| C |);
If mean (| C |) > 2mean (| T |), then it is judged as having foreign body intrusion, then utilizes threshold value M to current frame image to be measured
Carry out binaryzation, extract invasion foreign body, wherein threshold value
If mean (| C |)≤2mean (| T |), then it is judged as that foreign is invaded, then presses step method 3. and continue to judge next
Whether individual current frame image to be measured changes with the illumination condition of its previous frame image;
If 5. step judged result 3. is that illumination condition there occurs change, then reselect background by step method 2.
Image carries out Background learning.
Fast background relief method under the conditions of darkening the most according to claim 2 photograph, is characterized in that:
Step is the most described judges that the method whether illumination condition of current frame image to be measured and its previous frame image changes is:
Calculate present frame gray image A to be measuredjWith its former frame gray level image Aj-1Matrix of differences B of each pixel gray value,
And the absolute value of matrix B all elements is taken average mean (| B |) and variance std (| B |);
If mean (| B |) < std (| B |), then it is judged as that illumination condition does not change;Otherwise, then illumination bar it is judged as
Part there occurs change.
Fast background relief method under the conditions of darkening the most according to claim 2 photograph, is characterized in that, described some two field pictures
Quantity value be preferably 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610223117.5A CN105844671B (en) | 2016-04-12 | 2016-04-12 | A kind of fast background relief method under the conditions of change illumination |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610223117.5A CN105844671B (en) | 2016-04-12 | 2016-04-12 | A kind of fast background relief method under the conditions of change illumination |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105844671A true CN105844671A (en) | 2016-08-10 |
CN105844671B CN105844671B (en) | 2018-06-22 |
Family
ID=56597392
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610223117.5A Active CN105844671B (en) | 2016-04-12 | 2016-04-12 | A kind of fast background relief method under the conditions of change illumination |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105844671B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107798689A (en) * | 2016-08-28 | 2018-03-13 | 淮安信息职业技术学院 | Traffic video image background extracting method |
CN109166261A (en) * | 2018-10-11 | 2019-01-08 | 平安科技(深圳)有限公司 | Image processing method, device, equipment and storage medium based on image recognition |
CN112183337A (en) * | 2020-09-28 | 2021-01-05 | 华北电力大学(保定) | Detection method and device for preventing mechanical invasion of power transmission line |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006042229A (en) * | 2004-07-30 | 2006-02-09 | Nippon Hoso Kyokai <Nhk> | Image object extractor, image object trajetory synthesizer, its method and program |
CN102013022A (en) * | 2010-11-23 | 2011-04-13 | 北京大学 | Selective feature background subtraction method aiming at thick crowd monitoring scene |
CN103077520A (en) * | 2013-01-04 | 2013-05-01 | 浙江大学 | Background deduction method for movable vidicon |
CN104143197A (en) * | 2014-07-31 | 2014-11-12 | 中国科学院自动化研究所 | Detection method for moving vehicles in aerial photography scene |
-
2016
- 2016-04-12 CN CN201610223117.5A patent/CN105844671B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006042229A (en) * | 2004-07-30 | 2006-02-09 | Nippon Hoso Kyokai <Nhk> | Image object extractor, image object trajetory synthesizer, its method and program |
CN102013022A (en) * | 2010-11-23 | 2011-04-13 | 北京大学 | Selective feature background subtraction method aiming at thick crowd monitoring scene |
CN103077520A (en) * | 2013-01-04 | 2013-05-01 | 浙江大学 | Background deduction method for movable vidicon |
CN104143197A (en) * | 2014-07-31 | 2014-11-12 | 中国科学院自动化研究所 | Detection method for moving vehicles in aerial photography scene |
Non-Patent Citations (1)
Title |
---|
孙吉花: "背景减除的算法研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107798689A (en) * | 2016-08-28 | 2018-03-13 | 淮安信息职业技术学院 | Traffic video image background extracting method |
CN109166261A (en) * | 2018-10-11 | 2019-01-08 | 平安科技(深圳)有限公司 | Image processing method, device, equipment and storage medium based on image recognition |
CN112183337A (en) * | 2020-09-28 | 2021-01-05 | 华北电力大学(保定) | Detection method and device for preventing mechanical invasion of power transmission line |
Also Published As
Publication number | Publication date |
---|---|
CN105844671B (en) | 2018-06-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104392468B (en) | Based on the moving target detecting method for improving visual background extraction | |
JP6458734B2 (en) | Passenger number measuring device, passenger number measuring method, and passenger number measuring program | |
CN101236656B (en) | Movement target detection method based on block-dividing image | |
CN105404847B (en) | A kind of residue real-time detection method | |
CN100545867C (en) | Aerial shooting traffic video frequency vehicle rapid checking method | |
CN106600625A (en) | Image processing method and device for detecting small-sized living thing | |
CN106204594A (en) | A kind of direction detection method of dispersivity moving object based on video image | |
Chu et al. | Object tracking algorithm based on camshift algorithm combinating with difference in frame | |
EP2064653A1 (en) | Method and system of identifying one or more features represented in a plurality of sensor acquired data sets | |
CN103530893A (en) | Foreground detection method in camera shake scene based on background subtraction and motion information | |
JP2021082316A5 (en) | ||
JP2013537661A (en) | Automatic detection of moving objects using stereo vision technology | |
EP3241151A1 (en) | An image face processing method and apparatus | |
CN103093458B (en) | The detection method of key frame and device | |
JP5271227B2 (en) | Crowd monitoring device, method and program | |
Langmann et al. | Multi-modal background subtraction using gaussian mixture models | |
CN102610104B (en) | Onboard front vehicle detection method | |
CN105844671A (en) | Rapid background subtraction method under changing illumination conditions | |
CN103516955B (en) | Intrusion detection method in video monitoring | |
CN108985216B (en) | Pedestrian head detection method based on multivariate logistic regression feature fusion | |
CN103473753A (en) | Target detection method based on multi-scale wavelet threshold denoising | |
CN116778410A (en) | Deep learning-based coal mine underground operation personnel detection and tracking method | |
CN103617637B (en) | Dictionary learning-based low-illumination motion detection method | |
CN106951831B (en) | Pedestrian detection tracking method based on depth camera | |
Li et al. | A fog level detection method based on grayscale features |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |