A kind of Intelligent Hybrid group optimization filter tracking method
Technical field
The invention belongs to computer vision field, the state estimation that is related in target following, and in particular to a kind of intelligence is mixed
Gregarious body optimizes filter tracking method.
Background technique
Most burning hot method in target following for estimating posteriority state is particle filter algorithm (PF).PF algorithm is adopted
With sequential Monte Carlo method (SMC), using the Posterior distrbutionp of one group of sample (i.e. particle) approximate representation nonlinear system, then make
With the state of this approximate representation estimating system.Compared with other several algorithms, the more applicable nonlinear system of PF algorithm is applicable in model
It encloses more extensively, actual effect is also preferable.In the Vision Tracking of current main-stream, such as CNT algorithm and IOPNMF algorithm are all
Using particle filter as the track algorithm of frame.However particle filter algorithm not can avoid sample degeneracy phenomenon, this is because particle
The variance of weight can be gradually increased with the accumulation of time.To solve sample degeneracy phenomenon, the method generallyd use is to increase
The number or resampling of particle.But the number for increasing particle will lead to the increase of calculation amount, so that runing time mentions at double
The real-time of height, algorithm is all gone.The method of resampling is to take out the lesser particle of weight, only replicates the biggish grain of weight
Son, but as the progress of resampling since the big particle of weight is constantly replicated declines the type of particle sharply,
Lead to samples impoverishment problem.
Particle filter algorithm need other problem solved is that, in the state migration procedure of particle, after shifting
Particle wants that all positions being likely to occur of target can be appeared in, and otherwise tracking may be gradually distance from our tracking target, most
Cause to track target loss eventually.Increasing population equally can solve this problem, it is apparent that the number for increasing particle will lead to meter
The increase of calculation amount, so that runing time significantly improves, the real-time of algorithm is all gone.
Summary of the invention
It is an object of the invention to a kind of Intelligent Hybrid groups to optimize filter tracking method, to overcome the above-mentioned prior art to deposit
Defect, the present invention can more accurately estimate the posteriority state in nonlinear system, in scene environment complicated and changeable
In, show higher tracking accuracy.
In order to achieve the above objectives, the present invention adopts the following technical scheme that:
A kind of Intelligent Hybrid group optimization filter tracking method, includes the following steps:
Step 1:Particle stratification:
Pass through the threshold tau of settingh, τl, by particle sample particle according to weight size be divided into high weight particle collection,
Middle weight particle collection and low weight particle collection, thus according to the number of particles in different layers come the position of more new particle;
Step 2:State updates
The most probable state of target is found out in position and value information using current time particle, that is, generates and suitably build
View distribution, so that accurately estimation target chooses whether in the position at current time, and according to the number of different layers particle to height
The particle of weight particle collection, middle weight particle collection and low weight particle collection carries out cohesion movement;
Step 3:State estimation
State estimation is carried out according to minimum mean square error criterion or maximum posteriori criterion, by conditional mean or after having greatly
Estimated value of the state as system mode of probability density is tested, i.e., amendment state is recalculated to cohesion post exercise particle and updated
The position of the target of estimation, the actual position as target export;
Step 4:Status predication
Design prior density function, the state of prediction subsequent time estimation target, i.e., according to the number pair of different layers particle
Particle carries out arrangement movement or disengaging movement.
Further, the realization of particle stratification such as following formula in step 1:
Wherein,For the weight of i-th of particle in k moment particle sample, τh, τlRespectively particle stratification is upper and lower
Threshold value, ψh, ψm, ψlThe respectively mark of high weight particle collection, middle weight particle collection and low weight particle collection.
Further, the cohesion movement of particle and the arrangement campaign and disengaging movement of the particle in step 4 be such as in step 2
Under:
(1) cohesion movement
According to the weight of existing particle, the lower particle of weight is allowed to be moved to the biggish region of weight, the mobile side of particle
Method is as follows:
coh(xk):xk=xk-1+(a+(b-a)*rand)*(xk-1-xc)
Wherein xkThe location status for being particle at the k moment, xk-1For the location status of previous moment, xcFor average center
Position, the random number that rand is 0 to 1, a and b are preset constant, wherein a≤1≤b, and the value of b-a is smaller, and cohesion speed is faster,
But particle diversity is poorer, otherwise the value of b-a is bigger, and cohesion speed is slower, but particle diversity is better;
(2) disengaging movement
When that accurately can not determine target position at current time, all particles is allowed to carry out disengaging movement, the mobile side of particle
Method is as follows:
spa(xk):xk=xk-1+λ*rand(xc-xk-1)
Wherein xkIt is particle in the position at k moment, xk-1For the location status of previous moment, xcFor average center,For the average displacement of target, the random number that rand is 0 to 1, λ is preset constant, takes λ≤1, and λ value is bigger, and separation degree is got over
Greatly, ability of searching optimum is stronger, but local search ability is weaker, on the contrary, λ is smaller, separation degree is smaller, and ability of searching optimum is got over
Difference, but local search ability is stronger;
(3) arrangement movement
To predict subsequent time target position in the case where that accurately can estimate target position at current time, use is even
Fast motion model, is expressed as follows:
Further, state update follows following 4 criterion in step 3:
Criterion 3.1:As high weight particle collection ψhMiddle number of particles is more, i.e. length (ψh) > threshold, show
Current time, particle collection can sufficiently confirm the location status of target, be ideal tracking effect, then according to global minima mean square error
Poor criterion, calculates center, when generating suggestion distribution, it is contemplated that particle diversity retains high weight particle and middle power
It is worth the location status of particle, only to low weight particle collection ψlIn particle carry out cohesion movement;
Criterion 3.2:As high weight particle collection ψhIn number of particles it is less, but be greater than a threshold value when, i.e. threshold
> length (ψh) > mpts, the threshold value mpts > 0, and middle weight particle collection ψmIn number of particles it is more, i.e. length
(ψm) > threshold, show under current state, tracking effect is good, but possesses higher power around high weight particle
Value, then according to Local Minimum mean-square error criteria, to high weight particle collection ψhIn particle it is local weighted, calculate centre bit
It sets, when generating suggestion distribution, the location status of weight particle in reservation, only to low weight particle collection ψlIn particle carry out in
Poly- movement;
Criterion 3.3:As high weight particle collection ψhIn number of particles it is less but be greater than a threshold value, that is, threshold >
length(ψh) > mpts, the threshold value mpts > 0, and middle weight particle collection ψmIn number of particles it is less, i.e.,
Threshold > length (ψm), then according to Local Minimum mean-square error criteria, to the particle carry out office in high weight particle collection
Portion's weighting, calculates center, when generating suggestion distribution, centering weight particle collection ψmWith low weight particle collection ψlIn grain
Son carries out cohesion movement simultaneously;
Criterion 3.4:As high weight particle collection ψhIn number of particles it is few, i.e. mpts > length (ψh), and middle weight
Particle collection ψmIn number of particles it is more, i.e. length (ψm) > threshold, show that tracking effect is general at this time, but occupies
Greater number of middle weight particle still is able to the location status of approximate representation target, then quasi- according to Local Minimum mean square error
Then, centering weight particle collection ψmIn particle carry out it is local weighted, calculate center, generate suggest distribution when, it is only right
Low weight particle collection ψlIn particle carry out cohesion movement.
Further, maximum posteriori criterion calculation formula is in step 3:
Wherein wk(xk) it is that particle concentrates the corresponding normalization weight of each particle, xkFor the particle sample at k moment,To meet maxwk(xk) condition all xkThe set of composition.
Further, minimum mean square error criterion is divided into following two in step 3:
(1) Local Minimum mean-square error criteria
By setting a range R, the number of particles M in R is come out, when estimating target posteriority state, only to R
Interior particle sample sum it up by weight, and calculation formula is as follows:
WhereinFor i-th particle in k moment particle sample weight normalization as a result,For k moment particle sample
I-th of particle in this;
(2) global minima mean-square error criteria
All particle overall weight summations are concentrated to the particle that sum is N, calculation formula is:
WhereinFor i-th particle in k moment particle sample weight normalization as a result,For k moment particle sample
I-th of particle in this.
Further, status predication follows following 2 criterion in step 4:
Criterion 5.1:If current time meets the condition of replacement criteria, show that current time can judge the position shape of target
State then estimates the posteriority state of target according to global minima mean-square error criteria, then particle collection is carried out under arrangement motion prediction
The prior state at one moment;
Criterion 5.2:If current time is unsatisfactory for the either condition in replacement criteria, high weight particle collection ψhIn particle it is non-
It is often few, i.e. mpts > length (ψh), and the quantity of middle weight particle is also less, i.e. threshold > length (ψm), then
The posteriority state of target is estimated according to maximum posteriori criterion, and center is determined according to maximum posteriori criterion, then to all grains
Son carries out the prior state of disengaging movement prediction subsequent time.
Compared with prior art, the invention has the following beneficial technical effects:
The method of the present invention is on the basis of Bayesian filter, with three kinds of moving description targets of intelligent group optimization
Posteriority state, wherein cohesion movement increases the weight of sample in the case where maintaining the multifarious situation of particle, disengaging movement and
The prior state of subsequent time target can be more accurately predicted in arrangement coordinate movement, the experimental results showed that, with standard grain
Son filtering is compared, and can more accurately estimate the posteriority state in nonlinear system, in scene environment complicated and changeable, table
Reveal higher tracking accuracy.
Detailed description of the invention
Fig. 1 is flow diagram of the invention;
Fig. 2 is sampling importance resampling particle filter (Sampling Importance Resampling Particle
Filter, PF-SIR) algorithm and SIF algorithm proposed by the invention performance comparison figure;Wherein, (a) is function of state and sees
The function distribution of function is surveyed, (b) is the result curve figure of algorithm proposed by the present invention and PF-SIR state estimation, (c) (d) (e)
It (f) is the Partial key frame screenshot that track algorithm proposed by the present invention is used for Basketball video sequence tracking result, (c)
It indicates partial occlusion, (d) indicates significantly to block, (e) indicate to fast move, (f) indicate target distortion.
Specific embodiment
Present invention is further described in detail with reference to the accompanying drawing:
Referring to Fig. 1 and Fig. 2, the present invention provides a kind of Intelligent Hybrid group optimization filter tracking method, in Bayesian filter
On the basis of, with the posteriority state of three kinds of moving description targets of intelligent group optimization.Concrete thought is traditional grain
There is sample degeneracy in sub- filtering algorithm, although increasing number of particles can solve this problem, but accordingly greatly increase
Calculation amount, this method combination intelligent group thought, particle is moved accordingly according to specific circumstances, is guaranteeing not increase
In the case where number of particles, sample degeneracy problem is avoided well, and wherein cohesion movement is maintaining the multifarious situation of particle
Under increase the weight of sample, the elder generation of subsequent time target can be more accurately predicted in disengaging movement and arrangement coordinate movement
State is tested, the posteriority state in nonlinear system can be more accurately estimated than traditional particle filter, complicated and changeable
In scene environment, higher tracking accuracy is shown.
Specific step is as follows:
Step 1, the threshold tau by settingh, τl, the particle in particle sample is layered according to the size of weight, thus
It can be according to the number of particles in different layers come the position of more new particle.It is represented by:
Wherein,For the weight of i-th of particle in k moment particle sample, τh, τlRespectively particle stratification is upper and lower
Threshold value, ψh, ψm, ψlThe respectively mark of high weight particle collection, middle weight particle collection and low weight particle collection.
Step 2, the position using current time particle and value information find out the most probable state of target, that is, generate and close
Suitable suggestion distribution, thus accurately estimation target in the position at current time, and according to the number of different layers particle number
It chooses whether to carry out cohesion movement to middle layer particle, cohesion movement finally is carried out to low layer particle;In SIF algorithm, it then follows with
Lower 4 criterion:
Criterion 1
As high weight particle collection ψhMiddle more (length (the ψ of number of particlesh) > threshold), show at current time,
Particle collection can sufficiently confirm the location status of target, be ideal tracking effect.Then according to GMMSE criterion, centre bit is calculated
It sets.
When generating suggestion distribution, it is contemplated that particle diversity retains the position shape of high weight particle and middle weight particle
State, only to low weight particle collection ψlIn particle carry out cohesion movement.
Criterion 2
As high weight particle collection ψhIn number of particles it is less, but be greater than one by one threshold value when (mpts > 0,
Threshold > length (ψh) > mpts), and middle weight particle collection ψmIn the more (length (ψ of number of particlesm) >
threshold).Show under current state, tracking effect is good, but may possess higher power around high weight particle
Value.Then according to LMMSE criterion, to high weight particle collection ψhIn particle it is local weighted, calculate center.Wherein threshold value
Why mpts is greater than 0, is that extracted feature (Feature Extractor) cannot sufficiently represent target in order to prevent
State, it is possible to target position state can not be indicated by pole individual particle occur, but according to the calculated power of observation model institute
It is worth larger.
When generating suggestion distribution, the location status of weight particle in reservation, only to low weight particle collection ψlIn particle
Carry out cohesion movement.
Criterion 3
As high weight particle collection ψhIn number of particles it is less but be greater than certain threshold value (mpts > 0, threshold >
length(ψh) > mpts), and middle weight particle collection ψmIn less (the threshold > length (ψ of number of particlesm)).Then
It is local weighted to the particle progress in high weight particle collection according to LMMSE criterion, calculate center.
When generating suggestion distribution, centering weight particle collection ψmWith low weight particle collection ψlIn particle carry out cohesion simultaneously
Movement.
Criterion 4
As high weight particle collection ψhIn few (the mpts > length (ψ of number of particlesh)), and middle weight particle collection ψm
In the more (length (ψ of number of particlesm) > threshold).Show that tracking effect is general at this time, but occupies a greater number
Middle weight particle still can be with the location status of approximate representation target.Then according to LMMSE criterion, centering weight particle collection ψmIn
Particle carry out it is local weighted, calculate center.
When generating suggestion distribution, only to low weight particle collection ψlIn particle carry out cohesion movement.
Step 3:State estimation
Usually state estimation can be carried out according to least mean-square error (MMSE) criterion or maximum posteriori (MAP) criterion, it will
Conditional mean or estimated value of the state as system mode with maximum posteriori probability density, i.e., to cohesion post exercise particle
The position for recalculating the target of amendment state more new estimation, the actual position as target export;
MAP criterion calculation formula is:
Wherein wk(xk) it is that particle concentrates the corresponding normalization weight of each particle, xkFor the particle sample at k moment,To meet maxwk(xk) condition all xkThe set of composition.MMSE criterion is divided into following two again:
Local Minimum mean square error (LMMSE) criterion is counted the number of particles M in R by one range R of setting
Come.When estimating target posteriority state, only the particle sample in R sum it up by weight, calculation formula is as follows:
WhereinFor i-th particle in k moment particle sample weight normalization as a result,For k moment particle sample
I-th of particle in this.
Global minima mean square error (GMMSE) criterion concentrates all particle overall weights to sum on the particle that sum is N, meter
Calculating formula is:
WhereinFor i-th particle in k moment particle sample weight normalization as a result,For k moment particle sample
I-th of particle in this.
Step 4:Status predication
Design prior density function, the state of prediction subsequent time estimation target, i.e., according to the number of different layers particle
How much, arrangement movement or disengaging movement are carried out to particle.In the method for the present invention (SIF algorithm), it then follows following 2 criterion:
Criterion 5
If current time meets the condition of replacement criteria, show that current time can judge the location status of target.Then root
The posteriority state of target is estimated according to GMMSE criterion, then particle collection is carried out to the prior state of arrangement motion prediction subsequent time.
Criterion 6
If current time is unsatisfactory for the either condition in replacement criteria, high weight particle collection ψhIn particle it is considerably less
(mpts > length (ψh)), and also less (the threshold > length (ψ of the quantity of middle weight particlem)).Then according to pole
The posteriority state of big posteriority criterion estimation target, and center is determined according to MAP criterion, then separation fortune is carried out to all particles
The prior state of dynamic prediction subsequent time.
Three kinds of motion modes are as follows:
(1) cohesion movement
According to the weight of existing particle, the lower particle of weight is allowed to be moved to the biggish region of weight, more may be used to generate
The importance density function leaned on.In order to improve robustness, the moving method of particle is as follows:
coh(xk):xk=xk-1+(a+(b-a)*rand)*(xk-1-xc)
Wherein xkThe location status for being particle at the k moment, xk-1For the location status of previous moment, xcFor average center
Position is determined by corresponding replacement criteria.The random number that rand is 0 to 1, a and b are preset constant, wherein a≤1≤b, b-a's
It is worth smaller, cohesion speed is faster, but particle diversity is poorer, otherwise the value of b-a is bigger, and cohesion speed is slower, but particle multiplicity
Property is better.
(2) disengaging movement
When that accurately can not determine target position at current time, all particles is allowed to carry out disengaging movement, in order under
One moment can cover the possible state of target as much as possible.The moving method of particle is as follows:
spa(xk):xk=xk-1+λ*rand(xc-xk-1)
Wherein xkIt is particle in the position at k moment, xk-1For the location status of previous moment, xcFor average center,
It is determined by corresponding replacement criteria.For the average displacement of target, the random number that rand is 0 to 1, λ is preset constant, can use λ
≤ 1, λ value is bigger, and separation degree is bigger, and ability of searching optimum is stronger, but local search ability is weaker, on the contrary, λ is smaller, separation
Degree is smaller, and ability of searching optimum is poorer, but local search ability is stronger.
(3) arrangement movement
Arrangement movement purpose is to predict subsequent time target in the case where that accurately can estimate target position at current time
Position.The motion model that our adoption status transitional provavility densities are moved as arrangement, i.e.,:
xk~p (xk|xk-1)
In practice in target following, the physical motion model of systematic state transfer has very much, for example becomes and accelerate fortune
It is dynamic, become retarded motion, accelerate etc..For convenience of calculation, uniform motion model is used in algorithm of the invention.
(a) is the function distribution of function of state and observation function in Fig. 2.As seen from the figure, in moment 5 to moment 20, target
Observation model z it is Chong Die with the peak value of state transition model x, likelihood function is in the tail portion of prior distribution at this time, survey precision compared with
Height, therefore the weight of particle concentrates on a small number of particles, the weight of most particles is intended to zero, thus particle filter occurs seriously
Sample degeneracy phenomenon.Although PF-SIR algorithm can be reduced degradation phenomena by resampling, but reduce particle accordingly
Diversity, (b) is it can be seen that tracking effect is decreased obviously from Fig. 2.Since SIF algorithm of the invention makes full use of current time
Observation information, the lower particle of weight is moved to the biggish region of weight by cohesion movement, increase particle weight
While still have a preferable particle diversity, therefore state estimation effect is significantly better than PF-SIR algorithm.In Fig. 2 (c) (d)
(e) (f) lists intelligent group optimization algorithm Experiments Results Section frame screenshot in Basketball video set.In Basketball
In video sequence, in 12 frame, there is partial occlusion in target;In 16 frame, target appearance is significantly blocked, SIF pass criteria 3
It is local weighted to the particle progress in high weight particle collection, effectively handle occlusion issue.In 107 frames or so, target occurs
It fast moves;After 186 frames, there is large scale plane external rotation in target, and SIF algorithm of the invention does not lose target, mesh yet
Mark tracking velocity 10 frame per second or so.