CN108648463A - Vehicle checking method and system in a kind of crossing traffic video - Google Patents
Vehicle checking method and system in a kind of crossing traffic video Download PDFInfo
- Publication number
- CN108648463A CN108648463A CN201810455711.6A CN201810455711A CN108648463A CN 108648463 A CN108648463 A CN 108648463A CN 201810455711 A CN201810455711 A CN 201810455711A CN 108648463 A CN108648463 A CN 108648463A
- Authority
- CN
- China
- Prior art keywords
- current slot
- period
- video frame
- gauss
- pixel
- 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
- 238000000034 method Methods 0.000 title claims abstract description 50
- 238000001514 detection method Methods 0.000 claims abstract description 85
- 238000009825 accumulation Methods 0.000 claims description 18
- 238000007689 inspection Methods 0.000 claims description 3
- 230000008569 process Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 3
- 102100037651 AP-2 complex subunit sigma Human genes 0.000 description 2
- 101000806914 Homo sapiens AP-2 complex subunit sigma Proteins 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 230000008030 elimination Effects 0.000 description 2
- 238000003379 elimination reaction Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000011159 matrix material Substances 0.000 description 2
- 238000012805 post-processing Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000001052 transient effect Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/01—Detecting movement of traffic to be counted or controlled
- G08G1/04—Detecting movement of traffic to be counted or controlled using optical or ultrasonic detectors
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/40—Scenes; Scene-specific elements in video content
- G06V20/41—Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/50—Context or environment of the image
- G06V20/56—Context or environment of the image exterior to a vehicle by using sensors mounted on the vehicle
- G06V20/58—Recognition of moving objects or obstacles, e.g. vehicles or pedestrians; Recognition of traffic objects, e.g. traffic signs, traffic lights or roads
- G06V20/584—Recognition of moving objects or obstacles, e.g. vehicles or pedestrians; Recognition of traffic objects, e.g. traffic signs, traffic lights or roads of vehicle lights or traffic lights
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V2201/00—Indexing scheme relating to image or video recognition or understanding
- G06V2201/08—Detecting or categorising vehicles
Abstract
Vehicle checking method and system in a kind of crossing traffic video of present invention offer, the method includes:For carrying out the current slot of vehicle detection in target crossing traffic video, Background learning is carried out to the corresponding video frame of the current slot, obtains the corresponding background model of the current slot;Obtain the latter period corresponding video frame of current slot in the target crossing traffic video, vehicle detection is carried out to the latter period corresponding video frame using the current slot corresponding background model, and using the latter period as next current slot for carrying out vehicle detection;Wherein, the current slot and the duration of the latter period are respectively greater than twice of the default red light waiting time at target crossing.The present invention avoids the scene for waiting for vehicle from being mistakenly detected as background, improves the correctness of background detection and vehicle detection.
Description
Technical field
The invention belongs to background detection technical fields, more particularly, to vehicle detection side in a kind of crossing traffic video
Method and system.
Background technology
The first step main task of moving object detection and tracking is to extract moving target from video image and obtain
The characteristic information of moving target, such as position, shape, profile and color, that is, carry out moving object detection.Moving object detection is
Initialized target template model is established in subsequent motion target following.Therefore, it can correctly detect moving target to subsequent fortune
Tracking of maneuvering target has significant impact.
Currently, generally detecting moving target with background null method, background null method is using the present frame in sequence image
With reference background model be compared to complete detection, wherein the background frames used be not directly obtained from video it is original
Frame, but be updated by algorithm.Under normal circumstances, background null method includes background modeling, context update, background
Several steps such as elimination and post-processing.The process initialized to background model is known as background modeling, it essentially dictates the back of the body
Scape null method response speed in subsequent processing and dynamic range etc..The process of context update is with every frame video image to the back of the body
The process that parameter in scape model is modified, it has reacted the variation of environment, i.e., with the presence or absence of movement in background.By present frame
It is compared with the background model corrected, the process for extracting moving target is known as background elimination.The process of post-processing is pair
The moving target extracted is accurately corrected, and the step carries out subsequent processing according to the requirement of Video Applications.Background disappears
The key of division application does not lie in the process being compared with background model with current video frame, and is the maintenance and more of background
Newly.
The background null method of multi-model can more react the objective reality world than the background null method of single model.In the overwhelming majority
In Video Applications, each background pixel can use one or more Gaussian Profiles approximate.Therefore mixed Gaussian background is eliminated
Model is the basic model that most of moving target detecting methods use, it can effectively adapt to background dynamics variation.For
Each pixel of multimodal Gaussian distribution model, image is modeled by the superposition of multiple Gaussian Profiles of different weights, each
Gaussian Profile corresponds to one there may be the state of the presented color of pixel, the weights and distributed constant of each Gaussian Profile with
Time updates.When handling coloured image, it is assumed that tri- chrominance channels image slices vegetarian refreshments R, G, B are mutual indepedent and side having the same
Difference.For the observation data set { x of stochastic variable X1,x2,…,xN, xt=(rt,gt,bt) be t moment pixel sample, then it is single
A sampled point xtThe Gaussian mixtures probability density function of obedience is:
Wherein, k is distribution pattern sum, η (xt,μi,t,τi,t) it is i-th of Gaussian Profile of t moment, μi,tFor its mean value,
τi,tFor its covariance matrix, δi,tFor variance, I is three-dimensional unit matrix, ωi,tFor the weight of i-th of Gaussian Profile of t moment.
Always ceaselessly changing mainly due to the variation of light, background in actual scene.Therefore, above-mentioned Gauss model
It is also required to be continuously updated.Newer purpose is to reflect nearest scene changes, scene of this mode to gradual change
It is suitable.But daily crossing road traffic is really a kind of progressive light variation along with periodically variation, such as
Shown in Fig. 1.If using current gradual update mode, after scene Fig. 1 c are continued for some time, the background that learns
The background being actually needed when inciting somebody to action also as shown in Fig. 1 c, and being detected to the vehicle in Fig. 1 b is as shown in Figure 1a, to cause
Mistake occurs for next vehicle detection.
Invention content
To overcome the problems, such as vehicle detection mistake in above-mentioned crossing traffic video or solving the above problems at least partly,
Vehicle checking method and system in a kind of crossing traffic video of present invention offer.
According to the first aspect of the invention, vehicle checking method in a kind of crossing traffic video is provided, including:
It is corresponding to the current slot for carrying out the current slot of vehicle detection in target crossing traffic video
Video frame carries out Background learning, obtains the corresponding background model of the current slot;
The latter period corresponding video frame for obtaining current slot in the target crossing traffic video, uses institute
It states current slot corresponding background model and vehicle detection is carried out to the latter period corresponding video frame, and will be described
The latter period is as next current slot for carrying out vehicle detection;
Wherein, the current slot and the duration of the latter period are respectively greater than the default red light at target crossing
Twice of waiting time.
Specifically, the step of carrying out Background learning to the corresponding video frame of the current slot specifically includes:
Background learning is carried out to the corresponding video frame of the current slot using gauss hybrid models.
Specifically, the step of Background learning being carried out to the current slot corresponding video frame using gauss hybrid models
It specifically includes:
For any Gauss layer in the newest background model got before current slot, if current slot corresponds to
Each video frame in the characteristic value of each pixel be less than the preset multiple of the Gauss layer mean value, then each pixel and the Gauss layer
Match, the average value of the Gauss layer, variance and weight are updated according to each pixel;
If the characteristic value of each pixel is greater than or equal to the institute of the Gauss layer mean value in the corresponding each video frame of current slot
Preset multiple is stated, then each pixel is mismatched with the Gauss layer, is updated to the weight of the Gauss layer;
If in the corresponding video frame of current slot there is no with the matched pixel of Gauss layer, to the Gauss layer carry out
Resetting.
Specifically, the average value of the Gauss layer, variance and weight are updated and are specifically included:
If each pixel is matched with the Gauss layer, the pre- of the characteristic value of each pixel and the Gauss layer mean value is obtained
If the difference between multiple;
According to each difference and and square the sum of, obtain new average value and new variance;It wherein, will be with the Gauss
The number of the matched pixel of layer is as new weight;
According to the new average value, new variance and new weight, which is updated.
Specifically, the new average value mu and new variances sigma2It is obtained by the following formula:
Wherein, p be each difference sum, q for each difference the sum of square, n for the matched institute of the Gauss layer
State the number of pixel.
Specifically, Background learning is carried out to the corresponding video frame of the current slot, obtains the current slot pair
The step of background model answered, specifically includes:
The current slot is divided into multiple sub- periods, is got for newest before any sub- period
Background model in any Gauss layer, if each pixel is matched with the Gauss layer in sub- period corresponding each video frame,
Obtain difference between the characteristic value of each pixel and the preset multiple of the Gauss layer mean value and each difference and and
The sum of square;
By the corresponding difference of each sub- period and and square the sum of add up respectively;
According to the accumulation result of the accumulation result of the sum of the difference and the sum of square of the difference, new be averaged is obtained
Value and new variance;Wherein, using in all sub- periods with the number of the matched pixel of Gauss layer as new weight;
According to the new average value, new variance and new weight, which is updated.
Specifically, the new average value mu and new variances sigma2It is obtained by the following formula:
Wherein, P is the accumulation result of the sum of the difference, and Q is the accumulation result of the sum of square of the difference, and N is institute
There is the number with the matched pixel of Gauss layer in the sub- time section.
Specifically, Chong Die one or more between the current slot and the previous period of the current slot
The sub- period;Chong Die one or more institute between the current slot and the latter period of the current slot
State the sub- period.
Specifically, using the corresponding background model of the current slot to the latter period corresponding video frame
The step of carrying out vehicle detection specifically includes:
Using the corresponding background model of the current slot to not having in the latter period corresponding video frame
The video frame for carrying out vehicle detection carries out vehicle detection.
Vehicle detecting system in a kind of crossing traffic video is provided according to a further aspect of the invention, including:
Acquiring unit is worked as the current slot for carrying out vehicle detection in target crossing traffic video to described
Preceding period, corresponding video frame carried out Background learning, obtained the corresponding background model of the current slot;
Detection unit, the latter period for obtaining current slot in the target crossing traffic video are corresponding
Video frame carries out vehicle using the corresponding background model of the current slot to the latter period corresponding video frame
Detection, and using the latter period as next current slot for carrying out vehicle detection;
Wherein, the current slot and the duration of the latter period are respectively greater than the default red light at target crossing
Twice of waiting time.
Vehicle checking method and system in a kind of crossing traffic video of present invention offer, this method is by handing over target crossing
The time shaft of intervisibility frequency is divided into multiple periods, learns to background in each period, need not be established within each period
Background model, the only last time in each period calculate corresponding background model of each period, use each period
The background model learnt to the latter period of each period corresponding video frame carry out vehicle detection, each period when
Twice of the long default red light waiting time more than target crossing, to avoid mistakenly being detected as carrying on the back by the scene that vehicle waits for
Scape improves the correctness of background detection and vehicle detection.
Description of the drawings
Fig. 1 is three kinds of pavement behaviors in crossing traffic video;Wherein, Fig. 1 a for no vehicle when scene, Fig. 1 b be vehicle
By when scene, Fig. 1 c be vehicle queue wait for scene;
Fig. 2 is vehicle checking method overall flow schematic diagram in crossing traffic video provided in an embodiment of the present invention;
Fig. 3 is background model update signal in vehicle checking method in crossing traffic video provided in an embodiment of the present invention
Figure;
Fig. 4 is that background model update is shown in vehicle checking method in the crossing traffic video that another embodiment of the present invention provides
It is intended to;
Fig. 5 is vehicle detecting system overall structure diagram in crossing traffic video provided in an embodiment of the present invention;
Fig. 6 is vehicle equipment overall structure diagram in crossing traffic video provided in an embodiment of the present invention.
Specific implementation mode
With reference to the accompanying drawings and examples, the specific implementation mode of the present invention is described in further detail.Implement below
Example is not limited to the scope of the present invention for illustrating the present invention.
Vehicle checking method in a kind of crossing traffic video is provided in one embodiment of the invention, and Fig. 2 is the present invention
Vehicle checking method overall flow schematic diagram in the crossing traffic video that embodiment provides, this method include:S101, to target road
The current slot that vehicle detection is carried out in mouth traffic video carries out Background learning to the corresponding video frame of current slot, obtains
Take the corresponding background model of current slot;
Wherein, target crossing traffic video refers to the video of the target traffic intersection of shooting.Target crossing traffic video can
Think the video of the video of the target traffic intersection of history or the target traffic intersection of captured in real-time.Due to the situation of crossing traffic
The actual conditions that traffic can preferably be reacted, mouthful traffic video that usually satisfies the need carries out vehicle detection, and then it is logical to calculate crossing vehicle
Rate and occupation rate are crossed, foundation is provided for traffic programme and adjustment.Due to carrying out real-time update to background, it is easy to cause red light feelings
The scene that vehicle waits under condition is mistakened as making background, so as to cause vehicle detection mistake.The present embodiment is by target crossing traffic video
Time shaft be divided into multiple periods, background is learnt in each period.Background mould need not be established within each period
Type only just needs the video frame one-time calculation according to each period to go out the corresponding back of the body of each period in the last of each period
Scape model.Current slot is a period in destination path traffic video.To the corresponding video frame of current slot into
Row Background learning refers to the background model using the feature and foundation before current slot of the corresponding video frame of current slot
It is compared, background model is updated according to comparison result, obtain the corresponding background model of current slot.The present embodiment
The algorithm of Background learning is not limited.
S102 obtains the latter period corresponding video frame of current slot in target crossing traffic video, uses
The corresponding background model of current slot carries out vehicle detection to the latter period corresponding video frame, and by the latter time
The next current slots for carrying out vehicle detection of Duan Zuowei;Wherein, current slot and the duration of the latter period difference
More than twice of the default red light waiting time at target crossing.
Specifically, the latter period corresponding video of the background model learnt using each period to each period
Frame carries out vehicle detection.The duration of each period can be the same, can not also be the same.There can be overlapping between each period,
It can not be overlapped.As shown in Figure 3, it is assumed that the duration of each period is identical, is all A.Do not have between time period t, t+1 and t+2
There is overlapping.Background learning is carried out to time period t, t+1 and the corresponding video frame of t+2 respectively, obtains corresponding background model Mt、
Mt+1And Mt+2.In the t periods, the background model M obtained using the t-1 periodst-1Carry out vehicle detection;In the t+1 periods, make
The background model M obtained with the t periodstCarry out vehicle detection;In the t+2 periods, the background model obtained using the t+1 periods
Mt+1Carry out vehicle detection.The method that the present embodiment is not limited to vehicle detection.In the background model learnt using current slot
After carrying out vehicle detection to the latter period of current slot corresponding video frame, by the latter time of current slot
The step of Duan Zuowei current slots, iteration executes Background learning and vehicle detection, to realize real-time learning and the vehicle of background
Detection real-time progress.
The default red light waiting time be preset red light in the case of need the duration waited for.It is each in order to ensure
In period, each vehicle do not occupy crossing time occupy than each vehicle crossing time it is long, the duration of each period is set
It is set to twice of the default red light waiting time more than target crossing.Occupy crossing time be stoppage of vehicle crossing when
Between.Vehicle may rest on crossing when red light starts, it is also possible to the time before green light starts after red light starts
Point rests on crossing.In the case of traffic not congestion, the time that vehicle at most rests on crossing is the default waiting time,
Then vehicle sails out of crossing.But in the case of traffic congestion, vehicle still rests on crossing in next red light, next
A red light can just leave later, and the duration of each period needs to be more than twice of duration between two red lights at this time.
The present embodiment by the time shaft of target crossing traffic video by being divided into multiple periods, in each period to background
Learnt, background model need not be established within each period, when only the last time in each period calculates each
Between the corresponding background model of section, the background model learnt using each period is corresponding to the latter period of each period
Video frame carries out vehicle detection, and the duration of each period is more than twice of the default red light waiting time at target crossing, to keep away
Exempt from the scene that vehicle waits for mistakenly being detected as background, improves the correctness of background detection and vehicle detection.
On the basis of the above embodiments, to the corresponding video frame of current slot in step S101 described in the present embodiment
The step of carrying out Background learning specifically includes:Background is carried out to the corresponding video frame of current slot using gauss hybrid models
It practises.
Specifically, gauss hybrid models are accurately to quantify things with Gaussian probability-density function, and a things is decomposed
For several models formed based on Gaussian probability-density function.Gauss hybrid models characterize image using multiple Gauss models
In each pixel feature, carried out with each pixel and the gauss hybrid models in the corresponding video frame of current slot
Match.If successful match, each pixel is background dot, is otherwise foreground point.Gauss hybrid models are carried out according to matching result
Update, to obtain the corresponding background model of current slot.
On the basis of the above embodiments, background is carried out to the corresponding video frame of current slot using gauss hybrid models
The step of study, specifically includes:For any Gauss layer in the corresponding background model of previous period of current slot,
If the characteristic value of each pixel is less than the preset multiple of the Gauss layer mean value in the corresponding each video frame of current slot, each described
Pixel is matched with the Gauss layer, is updated to the average value of the Gauss layer, variance and weight according to each pixel;If current
The characteristic value of each pixel is greater than or equal to the preset multiple of the Gauss layer mean value in period corresponding each video frame, then each pixel
It is mismatched with the Gauss layer, the weight of the Gauss layer is updated;If in the corresponding video frame of current slot there is no with
The matched pixel of Gauss layer, then reset the Gauss layer.
Specifically, when not being overlapped between each period, the newest background model got is before current slot
The previous period of current slot learns the background model got.When having overlapping between each period, current time
Study, the i.e. previous period of current slot has not been completed not yet in the period being overlapped in the previous period of section
Background modeling is completed, the newest background model got is not learned for the previous period of current slot before current slot
Practise the background model got.Assuming that indicating each pixel of each frame in target crossing traffic video at any time with each Gauss models of K
Between the appearance that changes.Each Gauss is by average μ, variances sigma2It is described with weight w, preset multiple 2.5.If the pixel I of inputt
Less than 2.5 times of Gaussian mean σ, then pixel ItIt is matched with the Gauss layer.The Gauss layer is updated to:
μt=(1- α) * μt-1+α*It;
σt 2=(1- α) * σt-1 2+α*(1-α)*(It-μt-1)T(It-μt-1);
wt=(1- α) * wt-1+α*1.0;
Wherein, α is learning rate.If the pixel I of inputtMore than or equal to 2.5 times of Gaussian mean σ, then pixel ItWith this
Gauss layer mismatches, and unmatched Gauss layer only updates weight, i.e., weight is updated to wt=(1- α) * wt-1.If there is no with
The matched pixel of Gauss layer, then reset the Gauss layer, i.e. σ=σbig, σbigFor preset maximum value, for rgb format,
σbig=144, w=0, μ=It.The present embodiment is not limited to the mode being updated to Gauss layer.When initialization, all Gausses
Layer is initialized to an impossible state, i.e. σ=σbig, w=0, μ=[- 2* σ -2* σ -2* σ]T.In fact, μ can be with
It is initialized to arbitrarily small negative value, as long as meeting μTμ>6.25*σ2。
On the basis of the above embodiments, the average value of the Gauss layer, variance and weight are updated in the present embodiment
It specifically includes:If each pixel is matched with the Gauss layer, the preset multiple of the characteristic value and the Gauss layer mean value of each pixel is obtained
Between difference;According to each difference and and square the sum of, obtain new average value and new variance;It wherein, will be with the Gauss
The number of the matched pixel of layer is as new weight;According to new average value, new variance and new weight, to the Gauss layer into
Row update.
Specifically, since the present embodiment uses speced learning background model, background need not be established in current slot
Model only just calculates the background model learnt in the last of current slot.Knowing how any Gauss in current slot
Layer n ascribed value and P, and square the sum of q, the average for the background model that current slot learns can be calculated
μ and variances sigma2;Wherein n is the number with the matched pixel of Gauss layer, and the weight of the corresponding background model of current slot is
n.Ascribed value is the difference between the characteristic value and the preset multiple of the Gauss layer mean value of the matched pixel of Gauss layer.This reality
Apply example only need to add up P and q in background model learning process, need not set learning rate α, simplify the study of background model
Method accelerates the process of Background learning.
On the basis of the above embodiments, average value mu new in the present embodiment and new variances sigma2It is obtained by following formula
It takes:
Wherein, p is the sum of each difference, and q is the sum of square of each difference, and n is the number with the matched pixel of Gauss layer.
On the basis of the above embodiments, step S101 described in the present embodiment specifically includes:Current slot is divided
For multiple sub- periods;For any Gauss layer in the newest background model got before any sub- period, if the son
Each pixel is matched with the Gauss layer in period corresponding each video frame, then obtains the characteristic value and the Gauss layer mean value of each pixel
Preset multiple between difference and each difference and and square the sum of;It will be corresponding difference of each sub- period and peaceful
The sum of side adds up respectively;According to the accumulation result of the accumulation result of the sum of difference and the sum of square of difference, obtain new
Average value and new variance;Wherein, using the number with the matched pixel of Gauss layer in all sub- periods as new weight;
According to new average value, new variance and new weight, which is updated.
Specifically, when not being overlapped between each period, the newest background model got is to work as before the sub- period
The previous period of preceding period learns the background model got.When having overlapping between each period, current slot
The previous period background modeling has not been completed, before the sub- period the newest background model got be current time
The previous period of section learns the background model got.In order to improve the speed of Background learning, current slot is divided
At multiple sub- period a, in each accumulation for carrying out P and q in period a.All sub- periods of current slot are all learned
After habit, a new model is formed according to the p of accumulation and q, as shown in Figure 4.
On the basis of the above embodiments, average value mu new in the present embodiment and new variances sigma2It is obtained by following formula
It takes:
Wherein, P is the accumulation result of the sum of difference, and Q is the accumulation result of the sum of square of difference, and N is all sub- times
The number of the Duan Zhongyu matched pixels of Gauss layer.
On the basis of the above embodiments, in the present embodiment the previous period of current slot and current slot it
Between be overlapped one or more sub- periods;Chong Die one between current slot and the latter period of current slot
Or multiple sub- periods.
Specifically, there is overlapping between each period in the present embodiment in target crossing traffic video, to make background
Model can obtain in real time.As shown in figure 4, each period A is divided into 4 identical sub- period a.Background model is every duration
A updates are primary, to ensure the newer timeliness of background model.When calculating the background model of current slot, due to current
Have between period and the previous period of current slot it is overlapping, the corresponding difference of sub- period of overlapping and and square
The sum of calculate current slot the previous period when calculatings has been carried out, directly accumulate it, do not have to progress again
It calculates.
On the basis of the above embodiments, the corresponding background model of current slot is used in the present embodiment in step S102
The step of carrying out vehicle detection to the latter period corresponding video frame specifically includes:Use the corresponding background of current slot
Model is not to having the video frame for carrying out vehicle detection to carry out vehicle detection in the latter period corresponding video frame.
Specifically, due to having overlapping between each period, after the completion of current slot corresponding background model, to latter
There is no the video frame for carrying out vehicle detection to carry out vehicle detection in a period corresponding video frame.As shown in Figure 4.Assuming that current
Period is t, and the background model that current slot learns is Mt, the latter period of current slot is t+1, when t+1
Between not have to carry out the video frame of vehicle detection in section be the 4th sub- period corresponding video frame in the t+1 periods.Use Mt
Vehicle detection is carried out to the 4th in the t+1 periods sub- period corresponding video frame.Every duration a using more in the present embodiment
New model is detected vehicle, improves the timeliness of vehicle detection.
Vehicle detecting system in a kind of crossing traffic video is provided in another embodiment of the present invention, and Fig. 5 is this hair
Vehicle detecting system overall structure diagram in the crossing traffic video that bright embodiment provides, which includes 1 He of acquisition module
Detection module 2;Wherein:
Acquisition module 1 is used to, for carrying out the current slot of vehicle detection in target crossing traffic video, to described work as
Preceding period, corresponding video frame carried out Background learning, obtained the corresponding background model of the current slot;
Wherein, target crossing traffic video refers to the video of the target traffic intersection of shooting.Target crossing traffic video can
Think the video of the video of the target traffic intersection of history or the target traffic intersection of captured in real-time.Due to the situation of crossing traffic
The actual conditions that traffic can preferably be reacted, mouthful traffic video that usually satisfies the need carries out vehicle detection, and then it is logical to calculate crossing vehicle
Rate and occupation rate are crossed, foundation is provided for traffic programme and adjustment.Due to carrying out real-time update to background, it is easy to cause red light feelings
The scene that vehicle waits under condition is mistakened as making background, so as to cause vehicle detection mistake.Acquisition module 1 is by target road in the present embodiment
The time shaft of mouth traffic video is divided into multiple periods, learns to background in each period.It is not needed within each period
Background model is established, only just needs to go out each time according to the video frame one-time calculation of each period in the last of each period
The corresponding background model of section.Current slot is a period in destination path traffic video.Current slot is corresponded to
Video frame established before Background learning refers to feature and current slot using the corresponding video frame of current slot
Background model be compared, background model is updated according to comparison result, obtains the corresponding background mould of current slot
Type.The present embodiment is not limited the algorithm of Background learning.
The latter period that detection module 2 is used to obtain current slot in the target crossing traffic video is corresponding
Video frame carries out vehicle using the corresponding background model of the current slot to the latter period corresponding video frame
Detection, and using the latter period as next current slot for carrying out vehicle detection;Wherein, the current time
The duration of section and the latter period are respectively greater than twice of the default red light waiting time at target crossing.
The background model that detection module 2 is learnt using each period is corresponding to the latter period of each period to be regarded
Frequency frame carries out vehicle detection.The duration of each period can be the same, can not also be the same.There can be overlapping between each period,
It can also not be overlapped.As shown in Figure 3, it is assumed that the duration of each period is identical, is all A.Between time period t, t+1 and t+2
It is not overlapped.Background learning is carried out to time period t, t+1 and the corresponding video frame of t+2 respectively, obtains corresponding background model Mt、
Mt+1And Mt+2.In the t periods, the background model M obtained using the t-1 periodst-1Carry out vehicle detection;In the t+1 periods, make
The background model M obtained with the t periodstCarry out vehicle detection;In the t+2 periods, the background model obtained using the t+1 periods
Mt+1Carry out vehicle detection.The method that the present embodiment is not limited to vehicle detection.In the background model learnt using current slot
After carrying out vehicle detection to the latter period of current slot corresponding video frame, by the latter time of current slot
The step of Duan Zuowei current slots, iteration executes above-mentioned Background learning and vehicle detection, to realize the real-time learning of background
With the real-time progress of vehicle detection.
The default red light waiting time be preset red light in the case of need the duration waited for.It is each in order to ensure
In period, each vehicle do not occupy crossing time occupy than each vehicle crossing time it is long, the duration of each period is set
It is set to twice of the default red light waiting time more than target crossing.Occupy crossing time be stoppage of vehicle crossing when
Between.Vehicle may rest on crossing when red light starts, it is also possible to the time before green light starts after red light starts
Point rests on crossing.In the case of traffic not congestion, the time that vehicle at most rests on crossing is the default waiting time,
Then vehicle sails out of crossing.But in the case of traffic congestion, vehicle still rests on crossing in next red light, next
A red light can just leave later, and the duration of each period needs to be more than twice of duration between two red lights at this time.
The present embodiment by the time shaft of target crossing traffic video by being divided into multiple periods, in each period to background
Learnt, background model need not be established within each period, when only the last time in each period calculates each
Between the corresponding background model of section, the background model learnt using each period is corresponding to the latter period of each period
Video frame carries out vehicle detection, and the duration of each period is more than twice of the default red light waiting time at target crossing, to keep away
Exempt from the scene that vehicle waits for mistakenly being detected as background, improves the correctness of background detection and vehicle detection.
On the basis of the above embodiments, acquisition module is specifically used in the present embodiment:Using gauss hybrid models to working as
Preceding period, corresponding video frame carried out Background learning.
On the basis of the above embodiments, acquisition module is further specifically used in the present embodiment:For current slot
Corresponding background model of previous period in any Gauss layer, if each pixel in the corresponding each video frame of current slot
Characteristic value be less than the Gauss layer mean value preset multiple, then each pixel matched with the Gauss layer, according to each pixel
The average value of the Gauss layer, variance and weight are updated;If the spy of each pixel in the corresponding each video frame of current slot
Value indicative is greater than or equal to the preset multiple of the Gauss layer mean value, then each pixel is mismatched with the Gauss layer, to the power of the Gauss layer
It is updated again;If in the corresponding video frame of current slot there is no with the matched pixel of Gauss layer, to the Gauss layer
It is reset.
On the basis of the above embodiments, acquisition module is further specifically used in the present embodiment:If each pixel and the height
This layer matches, then obtains the difference between the characteristic value of each pixel and the preset multiple of the Gauss layer mean value;According to each difference
With with square the sum of, obtain new average value and new variance;Wherein, using with the number of the matched pixel of Gauss layer as new
Weight;According to new average value, new variance and new weight, which is updated.
On the basis of the above embodiments, average value mu new in the present embodiment and new variances sigma2It is obtained by following formula
It takes:
Wherein, p is the sum of each difference, and q is the sum of square of each difference, and n is the number with the matched pixel of Gauss layer.
On the basis of the above embodiments, acquisition module is specifically used in the present embodiment:Current slot is divided into more
A sub- period;For any Gauss layer in the newest background model got before any sub- period, if the sub- time
Each pixel is matched with the Gauss layer in the corresponding each video frame of section, then obtains the pre- of the characteristic value of each pixel and the Gauss layer mean value
If difference and each difference between multiple and and square the sum of;By corresponding difference of each sub- period and and square it
It adds up respectively;According to the accumulation result of the accumulation result of the sum of difference and the sum of square of difference, new be averaged is obtained
Value and new variance;Wherein, using the number with the matched pixel of Gauss layer in all sub- periods as new weight;According to
New average value, new variance and new weight, is updated the Gauss layer.
On the basis of the above embodiments, average value mu new in the present embodiment and new variances sigma2It is obtained by following formula
It takes:
Wherein, P is the accumulation result of the sum of difference, and Q is the accumulation result of the sum of square of difference, and N is all sub- times
The number of the Duan Zhongyu matched pixels of Gauss layer.
On the basis of the above embodiments, in the present embodiment the previous period of current slot and current slot it
Between be overlapped one or more sub- periods;Chong Die one between current slot and the latter period of current slot
Or multiple sub- periods.
On the basis of the above embodiments, detection module is specifically used in the present embodiment:It is corresponding using current slot
Background model is not to having the video frame for carrying out vehicle detection to carry out vehicle detection in the latter period corresponding video frame.
The present embodiment provides vehicle equipment in a kind of crossing traffic video, Fig. 6 is road provided in an embodiment of the present invention
Vehicle equipment overall structure diagram in mouth traffic video, the equipment include:At least one processor 61 at least one is deposited
Reservoir 62 and bus 63;Wherein,
Processor 61 and memory 62 complete mutual communication by bus 63;
Memory 62 is stored with the program instruction that can be executed by processor 61, and the processor calls described program to instruct energy
Enough execute the method that above-mentioned each method embodiment is provided, such as including:For carrying out vehicle inspection in target crossing traffic video
The current slot of survey carries out Background learning to the corresponding video frame of the current slot, obtains the current slot pair
The background model answered;The latter period corresponding video frame of current slot in the target crossing traffic video is obtained,
Vehicle detection is carried out to the latter period corresponding video frame using the current slot corresponding background model, and
Using the latter period as next current slot for carrying out vehicle detection;Wherein, the current slot and institute
The duration for stating the latter period is respectively greater than twice of default red light waiting time of target crossing.
The present embodiment provides a kind of non-transient computer readable storage medium, the non-transient computer readable storage medium
Computer instruction is stored, the computer instruction makes the computer execute the method that above-mentioned each method embodiment is provided, example
Such as include:It is corresponding to the current slot for carrying out the current slot of vehicle detection in target crossing traffic video
Video frame carries out Background learning, obtains the corresponding background model of the current slot;Obtain the target crossing traffic video
The latter period corresponding video frame of middle current slot, using the corresponding background model of the current slot to described
The latter period, corresponding video frame carried out vehicle detection, and using the latter period as next progress vehicle inspection
The current slot of survey;Wherein, the current slot and the duration of the latter period are respectively greater than target crossing
Twice of default red light waiting time.
One of ordinary skill in the art will appreciate that:Realize that all or part of step of above method embodiment can pass through
The relevant hardware of program instruction is completed, and program above-mentioned can be stored in a computer read/write memory medium, the program
When being executed, step including the steps of the foregoing method embodiments is executed;And storage medium above-mentioned includes:ROM, RAM, magnetic disc or light
The various media that can store program code such as disk.
Vehicle equipment embodiment is only schematical in crossing traffic video described above, wherein the work
The unit illustrated for separating component may or may not be physically separated, and the component shown as unit can be
Or it may not be physical unit, you can be located at a place, or may be distributed over multiple network units.It can be with
Some or all of module therein is selected according to the actual needs to achieve the purpose of the solution of this embodiment.The common skill in this field
Art personnel are not in the case where paying performing creative labour, you can to understand and implement.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can
It is realized by the mode of software plus required general hardware platform, naturally it is also possible to pass through hardware.Based on this understanding, on
Stating technical solution, substantially the part that contributes to existing technology can be expressed in the form of software products in other words, should
Computer software product can store in a computer-readable storage medium, such as ROM/RAM, magnetic disc, CD, including several fingers
It enables and using so that a computer equipment (can be personal computer, server or the network equipment etc.) executes each implementation
Method described in certain parts of example or embodiment.
Finally, the present processes are only preferable embodiment, are not intended to limit the scope of the present invention.It is all
Within the spirit and principles in the present invention, any modification, equivalent replacement, improvement and so on should be included in the protection of the present invention
Within the scope of.
Claims (10)
1. vehicle checking method in a kind of crossing traffic video, which is characterized in that including:
For carrying out the current slot of vehicle detection, video corresponding to the current slot in target crossing traffic video
Frame carries out Background learning, obtains the corresponding background model of the current slot;
The latter period corresponding video frame for obtaining current slot in the target crossing traffic video, is worked as using described
Preceding period corresponding background model carries out vehicle detection to the latter period corresponding video frame, and will be described latter
A period is as next current slot for carrying out vehicle detection;
Wherein, the current slot and the duration of the latter period are respectively greater than the default red light waiting at target crossing
Twice of duration.
2. according to the method described in claim 1, it is characterized in that, carrying out background to the corresponding video frame of the current slot
The step of study, specifically includes:
Background learning is carried out to the corresponding video frame of the current slot using gauss hybrid models.
3. according to the method described in claim 2, it is characterized in that, being corresponded to the current slot using gauss hybrid models
Video frame carry out Background learning the step of specifically include:
For any Gauss layer in the newest background model got before current slot, if current slot is corresponding each
The characteristic value of each pixel is less than the preset multiple of the Gauss layer mean value in video frame, then each pixel is matched with the Gauss layer,
The average value of the Gauss layer, variance and weight are updated according to each pixel;
If the characteristic value of each pixel is greater than or equal to the described pre- of the Gauss layer mean value in the corresponding each video frame of current slot
If multiple, then each pixel is mismatched with the Gauss layer, is updated to the weight of the Gauss layer;
If in the corresponding video frame of current slot there is no with the matched pixel of Gauss layer, to the Gauss layer carry out weight
It sets.
4. according to the method described in claim 3, it is characterized in that, being carried out more to the average value of the Gauss layer, variance and weight
Newly specifically include:
If each pixel is matched with the Gauss layer, default times of the characteristic value of each pixel and the Gauss layer mean value is obtained
Difference between number;
According to each difference and and square the sum of, obtain new average value and new variance;It wherein, will be with the Gauss layer
The number for the pixel matched is as new weight;
According to the new average value, new variance and new weight, which is updated.
5. according to the method described in claim 4, it is characterized in that, the new average value mu and new variances sigma2Pass through following public affairs
Formula obtains:
Wherein, p is the sum of each difference, and q is the sum of square of each difference, and n is and the matched picture of the Gauss layer
The number of element.
6. according to the method described in claim 2, it is characterized in that, carrying out background to the corresponding video frame of the current slot
Study, the step of obtaining the current slot corresponding background model, specifically include:
The current slot is divided into multiple sub- periods, for the newest back of the body got before any sub- period
Any Gauss layer in scape model obtains if each pixel is matched with the Gauss layer in sub- period corresponding each video frame
Difference and each difference between the characteristic value of each pixel and the preset multiple of the Gauss layer mean value and and square
The sum of;
By the corresponding difference of each sub- period and and square the sum of add up respectively;
According to the accumulation result of the accumulation result of the sum of the difference and the sum of square of the difference, obtain new average value and
New variance;Wherein, using in all sub- periods with the number of the matched pixel of Gauss layer as new weight;
According to the new average value, new variance and new weight, which is updated.
7. according to the method described in claim 6, it is characterized in that, the new average value mu and new variances sigma2Pass through following public affairs
Formula obtains:
Wherein, P is the accumulation result of the sum of the difference, and Q is the accumulation result of the sum of square of the difference, and N is all institutes
State the number with the matched pixel of Gauss layer in the sub- period.
8. according to the method described in claim 6, it is characterized in that, the current slot and the current slot it is previous
One or more sub- periods are overlapped between a period;The latter of the current slot and the current slot
One or more sub- periods are overlapped between period.
9. according to the method described in claim 8, it is characterized in that, using the corresponding background model of the current slot to institute
The step of the latter period corresponding video frame carries out vehicle detection is stated to specifically include:
Using the corresponding background model of the current slot to not carried out in the latter period corresponding video frame
The video frame of vehicle detection carries out vehicle detection.
10. vehicle detecting system in a kind of crossing traffic video, which is characterized in that including:
Acquiring unit, for in target crossing traffic video carry out vehicle detection current slot, to it is described current when
Between the corresponding video frame of section carry out Background learning, obtain the corresponding background model of the current slot;
Detection unit, the latter period corresponding video for obtaining current slot in the target crossing traffic video
Frame carries out vehicle inspection using the corresponding background model of the current slot to the latter period corresponding video frame
It surveys, and using the latter period as next current slot for carrying out vehicle detection;
Wherein, the current slot and the duration of the latter period are respectively greater than the default red light waiting at target crossing
Twice of duration.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810455711.6A CN108648463B (en) | 2018-05-14 | 2018-05-14 | Method and system for detecting vehicles in intersection traffic video |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810455711.6A CN108648463B (en) | 2018-05-14 | 2018-05-14 | Method and system for detecting vehicles in intersection traffic video |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108648463A true CN108648463A (en) | 2018-10-12 |
CN108648463B CN108648463B (en) | 2020-10-27 |
Family
ID=63755151
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810455711.6A Active CN108648463B (en) | 2018-05-14 | 2018-05-14 | Method and system for detecting vehicles in intersection traffic video |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108648463B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111383455A (en) * | 2020-03-11 | 2020-07-07 | 上海眼控科技股份有限公司 | Traffic intersection object flow statistical method, device, computer equipment and medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090316009A1 (en) * | 2008-06-20 | 2009-12-24 | Atsushi Ito | Apparatus, Method, and Program for Processing Image |
CN103177456A (en) * | 2013-03-29 | 2013-06-26 | 上海理工大学 | Method for detecting moving target of video image |
CN105976612A (en) * | 2016-04-27 | 2016-09-28 | 东南大学 | Urban traffic scene vehicle detection method based on robust mixed Gaussian model |
CN106504273A (en) * | 2016-10-28 | 2017-03-15 | 天津大学 | A kind of innovatory algorithm based on GMM moving object detections |
CN106780548A (en) * | 2016-11-16 | 2017-05-31 | 南宁市浩发科技有限公司 | moving vehicle detection method based on traffic video |
CN107169992A (en) * | 2017-05-11 | 2017-09-15 | 南宁市正祥科技有限公司 | A kind of traffic video moving target detecting method |
-
2018
- 2018-05-14 CN CN201810455711.6A patent/CN108648463B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090316009A1 (en) * | 2008-06-20 | 2009-12-24 | Atsushi Ito | Apparatus, Method, and Program for Processing Image |
CN103177456A (en) * | 2013-03-29 | 2013-06-26 | 上海理工大学 | Method for detecting moving target of video image |
CN105976612A (en) * | 2016-04-27 | 2016-09-28 | 东南大学 | Urban traffic scene vehicle detection method based on robust mixed Gaussian model |
CN106504273A (en) * | 2016-10-28 | 2017-03-15 | 天津大学 | A kind of innovatory algorithm based on GMM moving object detections |
CN106780548A (en) * | 2016-11-16 | 2017-05-31 | 南宁市浩发科技有限公司 | moving vehicle detection method based on traffic video |
CN107169992A (en) * | 2017-05-11 | 2017-09-15 | 南宁市正祥科技有限公司 | A kind of traffic video moving target detecting method |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111383455A (en) * | 2020-03-11 | 2020-07-07 | 上海眼控科技股份有限公司 | Traffic intersection object flow statistical method, device, computer equipment and medium |
Also Published As
Publication number | Publication date |
---|---|
CN108648463B (en) | 2020-10-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110298266B (en) | Deep neural network target detection method based on multiscale receptive field feature fusion | |
CN110555523B (en) | Short-range tracking method and system based on impulse neural network | |
CN104732208B (en) | Video human Activity recognition method based on sparse subspace clustering | |
CN105913087B (en) | Object identification method based on optimal pond convolutional neural networks | |
KR20210073569A (en) | Method, apparatus, device and storage medium for training image semantic segmentation network | |
CN108229474A (en) | Licence plate recognition method, device and electronic equipment | |
CN109902806A (en) | Method is determined based on the noise image object boundary frame of convolutional neural networks | |
CN103390278A (en) | Detecting system for video aberrant behavior | |
CN111259738A (en) | Face recognition model construction method, face recognition method and related device | |
CN112991389B (en) | Target tracking method and device and mobile robot | |
CN110310305B (en) | Target tracking method and device based on BSSD detection and Kalman filtering | |
CN113112526B (en) | Target tracking method, device, equipment and medium | |
Liu et al. | Deep network for road damage detection | |
CN110334584A (en) | A kind of gesture identification method based on the full convolutional network in region | |
CN114023062A (en) | Traffic flow information monitoring method based on deep learning and edge calculation | |
CN112001309A (en) | Target searching method, device and equipment based on unmanned aerial vehicle cluster and storage medium | |
WO2023116565A1 (en) | Method for intelligently designing network security architecture diagram | |
CN114419884B (en) | Self-adaptive signal control method and system based on reinforcement learning and phase competition | |
CN107871156B (en) | Ant colony multi-cell tracking system based on pheromone prediction | |
CN113326826A (en) | Network model training method and device, electronic equipment and storage medium | |
CN108648463A (en) | Vehicle checking method and system in a kind of crossing traffic video | |
CN110163103A (en) | A kind of live pig Activity recognition method and apparatus based on video image | |
CN110660068B (en) | Semi-automatic brain region segmentation method for three-dimensional cell construction image | |
CN111950507A (en) | Data processing and model training method, device, equipment and medium | |
CN111104965A (en) | Vehicle target identification method and device |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20231116 Address after: No. 57-5 Development Avenue, No. 6015, Yichang Area, China (Hubei) Free Trade Zone, Yichang City, Hubei Province, 443005 Patentee after: Hubei Jiugan Technology Co.,Ltd. Address before: 443002, China Three Gorges University, 8, University Road, Hubei, Yichang Patentee before: CHINA THREE GORGES University |