(2) background technology
Whether the moving target in intelligent video monitoring system detects in real time, is a major subjects of processing of low layer computer vision and Digital Image Processing, mainly be to detect to have dynamic object to exist from the still image sequence that video camera is caught.Moving object detection is that target is cut apart the important prerequisite with extraction, tracking, behavior understanding and event recognition, also is the basis of video analysis and processing, video monitoring system robotization.Because the dynamic change that exists in the reality scene, as in the generation of illumination, weather, shade, catastrophic event and the background chaotic disturb have (the switch motion of the rocking of branch, door etc.), make that motion detection is the work of a difficulty.In recent years, many scientists were devoted to the research of moving target detecting method, and it mainly can be divided three classes: frame-to-frame differences point-score, background model method and optical flow method.
Wherein the basic thought of frame-to-frame differences point-score is: variation has necessarily taken place in the grey scale pixel value corresponding to the moving region in the sequence image, by being done, consecutive frame subtracts each other processing, and use appropriate threshold to judge the variation of gray-scale value, just can extract the moving region.The simplest frame-to-frame differences point-score also has and improvedly respectively adjacent three frames is got difference in twos, at last difference result is got three-frame difference method with computing.Because method of difference mainly is based on the method for time shaft filtering image is processed, therefore the variation to illumination is not very sensitive, and calculated amount is less, its shortcoming mainly is, can not well extract complete target, under the slower situation of target translational speed, detected moving target is inner can to produce very big cavity, translational speed is too fast, and the moving region again can be more a lot of greatly than actual motion target.
The background model method mainly is that the video image of current input and the background model of having set up are compared, and by judging the variation of grey scale pixel value, or cuts apart moving target in the information extraction prospects such as color value and statistic histogram.The background model method generally is divided into three steps: at first, each pixel in the image is carried out statistical modeling based on gray-scale value or color value; Then, the background image of present image and statistics is carried out change-detection based on thresholding, extract dynamic area with respect to the static background model.At last, background model is carried out adaptive renewal, in the hope of adapting to the variation of dynamic scene.Utilize present image and reference model image to compare based on the method for background model and detect the moving region, generally speaking, can detect all motion pixels, but the interference to incoming event in illumination variation or the scene is responsive especially, especially can't handle the caused shade of local illumination variation in the scene, usually detection is the part of moving target, follow-up target following is handled brought very big inconvenience.Method commonly used has the method based on parameter model and nonparametric model, as average background model method, intermediate value background model method, single Gaussian Background modelling, mixed Gauss model method, based on the background method of formation of kalman filtering theory and based on the method for Density Estimator etc.
Optical flow method mainly is to utilize space motion object to detect the moving region in the variation of the caused pixel displacement vector of the plane of delineation, and different objects can corresponding different motion vector districts.Optical flow method mainly be object in of the projection of three-dimensional velocity in two dimensional image plane, i.e. its calculating be the transient change of each pixel in the image, the overall optical flow field has comprised movable information and shape facility information.Motion detection based on optical flow computation is a transient change in the whole scene owing to what calculate, can detect independently moving target under the situation of priori, and can be used for the movement background occasion.But owing to noise, illumination in the scene, block and the existence of shade, make that the optical flow field that calculates is not very accurate, and the computing method more complicated of light stream, as no special hardware environment support, be difficult to real-time scene.
A kind of moving target detecting method involved in the present invention based on Bayesian frame and LBP, wherein the moving object detection of Bayesian frame refers at first set up the background model of video scene, adopt bayesian theory that background in the video scene or moving target are judged according to background model of setting up and real-time video information then, and the result who judges according to bayesian theory upgrade to background model; LBP is the abbreviation of English Local Binary Pattern, Chinese is the partial binary pattern, he itself is a kind of strong texture description method, it has the gray level rotational invariance, and to illumination-insensitive, adopt LBP to describe in the inventive method based on the detected motion target area texture of Bayesian frame, and and the background model texture that adopts LBP to describe compares judgement, elimination reaches effective moving object detection based on shade and erroneous judgement in the detected moving target of Bayesian frame.
The inventive method is that a kind of moving target detecting method based on Bayesian frame and LBP is divided into four steps: the first step, extract the video frame images in the video stream data; Second step, every frame video image is carried out pre-service, promptly smoothing processing reduces interference and other disturbances that light changes to reach; The 3rd step, set up background model, carry out moving object detection based on Bayesian frame, comprise the background modeling and the study renewal of video sequence, and based on background on the bayesian theory basis and moving object classification; The 4th step, detect the moving target obtain for the 3rd step and add LBP and describe, describe comparing judgement with the LBP of the background model of current foundation, eliminate based on shade and erroneous judgement in the detected moving target of Bayesian frame.
Can significantly reduce the shade of eliminating moving target itself when the light variation influences moving object detection with other disturbances by this method, increase the accuracy of moving object detection, guaranteed the validity of the follow-up moving object classification of moving object detection, motion target tracking etc.
(3) summary of the invention
The technical problem to be solved in the present invention is: 1) solve the influence problem of the variation of light in the video sequence to the moving object detection accuracy, promptly adopt pre-service to video sequence, disturbance in the smoothed video sequence and light change, and make that the moving object detection in the video sequence has robustness for trickle disturbance and light variation; 2) solution is based on the speed issue of the moving object detection of video sequence, promptly carry out change-detection earlier by video frame images on the one hand for the needs analysis, do not carrying out computings such as context update, motion detection for the zone that does not change, by demoting for color dimension grade in modeling process, this two aspect can improve the speed of whole moving object detection on the other hand; 3) influence of non-moving region interested in the solution moving object detection, such as the curtain of the branch that flickers, the water surface that ripples, computer screen, swing, the fan of rotation and staircase of operation or the like influence for moving object detection, the characteristic model that promptly comprises static background object and non-movement background object interested by foundation is eliminated the influence of non-movement background object interested to detecting when moving object detection; 4) the moving target shade is promptly rejected the dash area that detects in the moving target that obtains by comparing based on the difference of detected LBP descriptor of Bayesian frame and current background model LBP descriptor to the influence of moving object detection in the solution moving object detection.
A kind of moving target detecting method based on Bayesian frame and LBP of primary study of the present invention the objective of the invention is to realize by following four steps:
The first step is extracted the video frame images in the video stream data.
In second step, the pre-service of video frame images is promptly carried out smoothing processing to video frame images, specifically adopts the gaussian kernel of 5*5 to carry out smoothing processing.
The 3rd step, carry out moving object detection based on background model and Bayesian frame, concrete steps comprise: 1) the second step processed video two field picture is carried out change-detection, the pixel in the corresponding zone that does not change will be labeled as the background pixel point, and not need to carry out subsequent treatment; 2) pixel of the region of variation that detection is obtained is divided into background pixel point or moving target pixel according to Bayes rule; 3) denoising, merging moving target pixel are promptly to 2) detect the further denoising of moving target pixel, the merging processing that obtain, obtain complete moving target; 4) study of background model is upgraded.
The 4th step, carry out shadow removal to detecting the moving target that obtains in the 3rd step based on LBP, the motion target area texture that concrete relatively LBP description detection obtains and the texture of background model corresponding region, if texture is very approaching, then think motion target detection owing to shade causes, these pixels will be rejected from moving target.
The method in the 3rd step is refered in particular to:
1) change detecting method refers in particular to:
A) video frame images of handling through second step is carried out inter-frame difference and background difference, inter-frame difference refers in particular to the difference of current video two field picture and last video frame images, and the background subtraction branch refers in particular to the difference of current video frame figure and background model image;
B) the image employing least square mean value theorem (LMedS) of background difference is carried out self-adaption thresholding processing acquisition bianry image and represent whether each pixel in the current video two field picture exists variation with background image;
C) if inter-frame difference and background difference satisfy unconverted situation simultaneously, these pixels will be as the no change pixel, and be labeled as the background pixel point, do not carrying out follow-up background model renewal processing and moving object detection processing, remaining pixel is labeled as and has the pixel that changes, the pixel that these existence change will be as follow-up pending pixel, and this method will improve arithmetic speed greatly.
2) the moving target pixel detects, promptly detect the acquisition moving target to there being the pixel that changes, for existing the pixel that changes to add up its characteristic information and the corresponding characteristic information of background model is added up judgement according to the background model of current foundation and Bayes rule.
A) wherein feature, the background model feature of statistics are refered in particular to:
I. be labeled as the pixel of variation after handling for the no change pixel of inter-frame difference mark and background difference thresholding, use the RGB color feature vector v of current time tt=[rtgtbt]TAs feature,
And, the RGB color dimension of 256 kinds of grades is repartitioned by 64 gray shade scales in order to improve arithmetic speed;
Ii. the pixel that changes for the existence of inter-frame difference mark, the proper vector of using the symbiosis color be as feature, and the proper vector of so-called symbiosis color is refered in particular to the proper vector v that the RGB color of previous moment and current time constitutes jointlyt=[rT-1gT-1bT-1rtgtbt]T, and in order to improve arithmetic speed, the RGB color dimension of 256 kinds of grades is repartitioned by 32 gray shade scales;
Iii. background model need comprise that each proper vector is at the distribution probability P at pixel s place (v except above proper vectort| s) and the conditional probability P (v that belongs to proper vector under the condition of background at pixel st| b, s);
Iv. establishI=1 ..., N, it is P (vt| b, s) through the top n cylindricality in the histogram after the descending sort, for given M1And M2, as M1=90%, M2=10%, there is an Integer N1Satisfy the condition of formula (1):
and
Still be the proper vector of pixel of moving target type for no matter from background like this, can obtain a characteristic statistics form, be designated as
I=1 ..., N
2(N
2>N
1), this form will be recorded in pixel s place, N during time t
2Individual important statistical information, every element of this statistical table just are made up of three shown in the following formula (2) parts:
B) Bayes judges the regular as follows of background and moving target:
I. establishing b is background, and f is a moving target, the proper vector v of ordering for stPosterior probability formula be:
C=b?or?f (3)
Ii. utilize Bayes decision rule, if proper vector satisfies following formula (4), then the pixel at this place can be considered to background:
P(b|vt,s)>P(f|vt,s) (4)
Iii. notice the proper vector relevant or belong to target context, or belong to moving target, promptly satisfy formula (5) with pixel s:
P(vt|s)=P(vt|b,s)·P(b|s)+P(vt|f,s)·P(f|s) (5)
Iv. formula (3) formula and formula (5) formula substitution formula (4) are obtained formula (6):
2P(vt|b,s)·P(b|s)>P(vt|s) (6)
V. can draw, by the proper vector in calculating probability P (b|s) and the background model at the distribution probability P at pixel s place (vt| s) and pixel s belong to the conditional probability P (v of proper vector under the condition of backgroundt| b, s), just can be with proper vector VtBe categorized as moving target or background.
C) according to Bayes rule the pixel of having added up color characteristic and symbiosis color characteristic being detected the method that obtains the moving target pixel is:
I. with current proper vector vtPreceding N with background model characteristic statistics form1Individual proper vector compares, and similar proper vector is added up, to obtain the characteristic probability of proper vector;
Ii. establish v
t=[a
0..., a
n]
T,
By in the formula (2)
Obtain, then characteristic probability is as shown in the formula acquisition:
M (v wherein
t) expression
In with v
tThe feature set of coupling is defined as:
Wherein δ represents vector distance, if
In do not have element coupling v
t, P (v
t| s) and P (v
t| b s) is set to 0;
Iii. with in the characteristic probability substitution formula (6) that calculates in (7), pixel s just has been divided into background pixel point or moving target pixel.
3) denoising, merge the moving target pixel: the moving target pixel that obtains corresponding 2), comprising some noise spots, and there is cavitation in motion target area, need further handle.
Concrete grammar is:
I. current processing video frames image is made up bianry image according to background pixel point and moving target pixel;
Ii. carry out twice morphology expansive working and eliminate cavity in the motion target area obtaining bianry image;
Iii. the bianry image after the last step being handled carries out three morphological erosion operations and eliminates noise spot;
Iv. the bianry image after the last step being handled carries out the unnecessary corrosion operation once of morphology expansive working compensation.
4) study of background model is upgraded, and the study of the background model in this method is upgraded and comprised two steps, and the first, finish the renewal of background model, the second, need finish the renewal of background image;
A) background model is upgraded and is divided into two classes, and the first kind is upgraded for the gradual change background model, and second class is upgraded for the sudden change background model, and concrete grammar is:
I. the detection of updating type, when the background sudden change took place, the new background characteristics after changing can become principal character immediately, from formula (1) and formula (5) as can be known, if satisfy following formula, then can detect the background of undergoing mutation at s point place, otherwise what take place is gradual change:
Wherein, T is a percent value, determine by it when new feature is regarded as new background, when the value of T was big, system can be more stable, but the reaction to sudden change can be slowed down, yet, if T gets smaller value, the easier frequent updating background characteristics of system, in this patent method, adopt T=90%;
Ii. the method for gradual change situation update background module, proper vector vtBe used for to pixel t constantly pixel s belong to the characteristic of division vector of moving target or background, individual features color characteristic or symbiosis color characteristic upgrade by formula (10):
I=1 ..., N
2, α
2Be learning rate, the speed of its controlling features study, if be judged as background at moment t pixel s,
Otherwise,
In formula (2)
V in the set
tDuring coupling
When not matching
Iii. the situation of suddenling change update background module method, for the proper vector of each pixel s, in case the sudden change background judge to occur with new at the s place, the feature of statistics is with following formula adjustment:
B) renewal of background image, the update method of background image also are divided into two classes according to the update method of background model, and promptly the first kind is upgraded for the gradual change background image, and second class is upgraded for the sudden change background image, and concrete grammar is:
I. under the situation for the gradual change update background module, background image with new method as shown in the formula:
Bc(s,t+1)=(1-α1)Bc(s,t)+α1Ic(s,t) (12)
BcThe expression background image, wherein { r, g, b} represent RGB color model, I to c ∈cThe expression current video frame, α1Be the study undated parameter;
Ii. for the sudden change update background module situation under, background image with new method as shown in the formula:
Bc(s,t+1)=Ic(s,t),for?c=r,g,b (13)
The moving target that the 4th step promptly obtained detection carries out shadow removal based on LBP, specifically be the motion target area texture information that utilizes the LBP descriptor to detect to obtain and the texture information of background image corresponding region, because the texture information of shadow region and the texture information of background image are closely similar, relatively the difference of their texture information just can be rejected the shade in the moving object detection.
1) wherein the LBP method of describing texture information is refered in particular to:
Selected a certain pixel is a central point, with the radius R is step-length, Correlation Centre point and with its gray-scale value at a distance of the neighborhood point of R, central point threshold value as a comparison, obtain one group of description of representing the binary value of grey scale change in the radius R as grey scale change, and calculate its LBP value:
Wherein, gcBe central point (xc, yc) gray-scale value, P is neighbours' number selected on the radius R, gpPut the gray-scale value of P for neighbours.The LBP operator is that the point set of symmetry on the circumference of R is neighbours usually with the radius, radius of a circle and neighbours count by user's decision, and the grey scale change of the local pixel of the big more description of radius is accurate more, but calculated amount also increases, all radiuses adopt 1 in this method, and it is 8 that neighbours count out.
2) concrete moving target shadow removal method is:
I. according to the moving target bianry image that obtains in the 3rd step, in current processing video frames image, calculate the LBP value of each pixel corresponding to each moving target pixel, be designated as FLBP
Ii. according to the moving target bianry image that obtains in the 3rd step, in the current background image, calculate the LBP value of each pixel corresponding to each moving target pixel, be designated as BLBP
Iii.FLBPWith BLBPBe a binary digit string, calculate the Hamming distance of these two binary digit strings;
Iv. judge by the Hamming distance of relatively acquisition and the size of threshold value whether pixel is shade:
Ham(FLBP,BLBP)<T1 (15)
Wherein, Ham is the hamming distance function, T1Be a threshold value, F in this grantingLBPWith BLBPBe 8 bit word strings, get T1Be 2, i.e. FLBPWith BLBPHamming distance detects the moving target pixel that obtains and background image for the pixel texture pixel less than 2 expressions, be judged as shade, and from the moving target pixel this pixel of rejecting, finally obtain the moving target of this algorithm.
The present invention has following technical characterictic:
1, the video image that need handle every frame of this method at first adopts the gaussian kernel of 5*5 to carry out smoothing processing, has eliminated because the interference that trickle light changes and other disturbances.
2, this method video frame images of needing to carry out moving object detection after to smoothing processing carries out change-detection earlier, to no longer carry out subsequent treatment to adopting inter-frame difference and background subtraction branch to detect the pixel that does not have variation, improve the arithmetic speed of entire method;
3, the background model feature of this method employing comprises color characteristic and symbiosis color characteristic, wherein color characteristic can be described the difference of current processing video frames and background image well, the symbiosis color characteristic is the difference of two frame video images of inter-frame difference pre-process and post-process well, so both the target of in the current video sequence, moving can well be detected, also the moving target of forbidding in the current video sequence can be detected well.
4, this method has been carried out further division for the color characteristic of background model employing and the color grade of symbiosis color characteristic, has reduced the color dimension, has improved the speed of algorithm.
5, the pixel of this method region of variation that detection is obtained carries out the division of background pixel point or moving target pixel according to Bayes rule.
6, this method detects the foundation Bayes rule and obtains the moving target pixel and carried out denoising and merged handling, and obtains more complete motion target area.
7, this method is classified to the renewal of background model feature, adopts gradual change to upgrade and two kinds of strategies of sudden change renewal, has satisfied the actual change situation of video scene.
8, this method is described texture information to moving target and the LBP that detection obtains at last, and the texture information of describing with the LBP of background compares, and as Shadows Processing, has rejected the shade in the moving object detection for the similar situation of texture information.
Compared with prior art, the invention has the advantages that:
1, this method has been carried out pre-service before video frame images is carried out moving object detection, has eliminated because the interference that trickle light changes and other disturbances by smoothing processing.
2, the image of this method after to smoothing processing carried out change detection, do not carry out subsequent treatment for the pixel that does not have conversion, when in addition the pixel that has variation being carried out feature extraction the color dimension has been carried out dimensionality reduction, these 2 speed that all improve entire method.
3, this law moving target that detection is obtained has carried out denoising, merging and has rejected Shadows Processing, makes whole moving object detection more accurate.