Content of the invention
The present invention proposes a kind of video abstraction generating method and video frequency abstract generating means, existing to solve
In technology, first Gaussian Background modeling is carried out to video to be processed, extracts the target trajectory of motion,
Face datection is carried out to the object detecting, to Track Pick-up video frequency abstract face appearance is detected,
With solve in prior art cannot for the mobile target that comprises facial image carry out video frequency abstract generate with
Meet the problem of video monitoring needs.
The technical solution adopted for the present invention to solve the technical problems is:
According to an aspect of the invention, it is provided a kind of video abstraction generating method.This video frequency abstract
Generation method includes:Background modeling is carried out to the target two field picture in original video, obtains background model;
Extract the moving target in target two field picture using background model;Judge to carry using default grader
Whether facial image is included in the moving target got;The moving target including facial image is carried out rail
Mark arranges, and generates summary.
Further, carry out background modeling to the image of the target frame in original video to include:Using mixed
Close Gaussian Background algorithm the image of target frame is calculated, obtain the mixed Gaussian mould of target two field picture
Type.
Further, judge whether include face in the moving target extracting using default grader
Image includes:Using default, Face datection model is gone out by Adaboost algorithm and haar features training
The moving target extracting is carried out with facial image detection, and judges the fortune extracted according to testing result
Whether facial image is included in moving-target.
Further, judging whether include people in the moving target extracting using default grader
Also include after face image:By comprise in target two field picture the moving target of facial image and target frame it
The moving target comprising facial image in previous frame image carries out track following, obtains comprising facial image
Moving target movement locus.
Further, the moving target of facial image and the previous of target frame will be comprised in target two field picture
The moving target comprising facial image in two field picture carries out track following and includes:Calculate in target two field picture
The motion mesh of facial image is comprised in the previous frame image of the moving target comprising facial image and target frame
Target intersection area;Judge whether intersection area is more than preset area value;Preset when intersection area is more than
During area value, according to comprising the moving target of the facial image position on image in target two field picture more
New movement locus;When intersection area is less than or equal to preset area, comprise according in target two field picture
Position on image for the moving target of facial image generates new movement locus.
Further, the moving target including facial image is carried out trajectory alignment to include:According to comprising
The time relationship of movement locus appearance of the moving target of facial image and locus are to this movement locus
Arranged;Movement locus after arrangement is added on background image.
Provide a kind of video frequency abstract generating means according to another aspect of the present invention.This video frequency abstract
Generating means include:Background modeling module, for carrying out background to the target two field picture in original video
Modeling, obtains background model;Moving target recognition module, for extracting target using background model
Moving target in two field picture;Face discrimination module, for judging to extract using default grader
Moving target in whether include facial image;Summarization generation module, for including facial image
Moving target carries out trajectory alignment, generates summary.
Further, background modeling module is additionally operable to:Using mixed Gaussian Background Algorithm to target frame
Image is calculated, and obtains the mixed Gauss model of target two field picture.
Further, face discrimination module is additionally operable to:Using default by Adaboost algorithm with haar
Features training goes out Face datection model and carries out facial image detection to the moving target extracting, and according to
Testing result judges whether include facial image in the moving target extracting.
Further, this video frequency abstract generating means also includes:Track following module, for by target
Comprise in two field picture to comprise facial image in the moving target of facial image and the previous frame image of target frame
Moving target carry out track following, the movement locus of the moving target obtaining comprising facial image.
Application technical scheme, technical scheme extracts mobile target in the picture
Afterwards, judge that extracting the prospect obtaining moves whether target comprises face figure using default grader
Picture, generates video frequency abstract to the mobile target comprising face, and removes the track that can't detect face.
Thus complete and accurate ground generates the video frequency abstract meeting user's request, by Face datection and video frequency abstract
Combine, generate the video frequency abstract of the mobile target comprising facial image.So that user can be plucked from video
Quickly get, in wanting, the video information comprising face, improve the service efficiency of video.
Specific embodiment
It should be noted that in the case of not conflicting, in embodiment in the application and embodiment
Feature can be mutually combined.To describe the present invention below with reference to the accompanying drawings and in conjunction with the embodiments in detail.
Embodiments provide a kind of video frequency abstract generating means, Fig. 1 is to implement according to the present invention
The schematic diagram of the video frequency abstract generating means of example, as shown in figure 1, this generating means includes:Background is built
Mould module 11, for carrying out background modeling to obtain background model to the target two field picture in original video;
Moving target recognition module 13, for extracting the moving target in target two field picture using background model;
Face discrimination module 15, for judging whether wrap in the moving target extracting using default grader
Include facial image;Summarization generation module 17, for carrying out track by the moving target including facial image
Arrangement, generates summary.
Using the video frequency abstract generating means of the present embodiment, after setting up background model, using default
Grader judges that extracting the prospect that obtains moves whether target comprises facial image, to comprising face
Mobile target generates video frequency abstract, and removes the track that can't detect face.Thus complete and accurate ground is raw
Become to meet the video frequency abstract of user's request, combined by Face datection and video frequency abstract, generation comprises
The video frequency abstract of the mobile target of facial image.Make user can quickly get bag from video frequency abstract
Video information containing face, improves the service efficiency of video.
Background above MBM 11 can use various image background modeling algorithms, is setting up background mould
After type, current image and background model are compared, determine foreground target (i.e. according to comparative result
Need the moving target extracting).Specifically image background modeling algorithm can select to adopt color background
Model or grain background model, wherein, color background model is the color to each pixel in image
Value (including gray scale or colour) is modeled.If the pixel color on present image coordinate (x, y)
When pixel color value on (x, y) in value and background model has larger difference, current pixel is considered as
Prospect, otherwise for background.
The background modeling module 11 of the video frequency abstract generating means of this example can preferably use color background
Mixed Gaussian Background Algorithm in model, mixture Gaussian background model (Gaussian Mixture Model)
In being improved on the basis of single Gaussian Background model, by multiple Gaussian probability-density functions
Weighted average carrys out the density fonction of smoothly approximate arbitrary shape, is particularly suited for for outdoor ring
The image in border is processed, and background modeling module 11 utilizes the feature of mixed Gaussian Background Algorithm, permissible
Moving target in video under outdoor environment is rapidly and accurately identified.
When background modeling module 11 carries out background modeling, can be to the illumination in target two field picture and shade
Carry out corresponding filtering process, to avoid illumination and shade to be mistaken as moving target, impact video is plucked
The generation wanted.
In the case of using mixed Gaussian Background Algorithm, background modeling module 11 can be also used for:Make
With mixed Gaussian Background Algorithm, the image of target frame is calculated, the mixing obtaining target two field picture is high
This model.
Face discrimination module 15 can be gone out by Adaboost algorithm and haar features training using default
Face datection model carries out facial image detection to the moving target extracting, and Adaboost algorithm is tool
There is adaptive boosting algorithm, be the strong improvement of boosting.This algorithm is by substantial amounts of classification
The general Weak Classifier of ability is stacked up by certain method, constitutes one and has very strong classification capacity
Strong classifier.Theoretical proof, as long as each Weak Classifier classification capacity is better than random guess, when weak
When the number of grader trends towards infinite, the error rate of strong classifier will go to zero.Due in candidate region
The direction of face is about positive, meanwhile, in order to ensure the speed of human-face detector, the feature of selection
It is preferably Haar feature.Haar feature is divided three classes:Edge feature, linear character, central feature and
Diagonal feature, is combined into feature templates.White and two kinds of rectangles of black are had in feature templates, and fixed
The characteristic value of this template adopted be white rectangle pixel and deduct black rectangle pixel and.Determining feature
After form, the quantity of Haar feature is dependent on the size of training sample image matrix, and feature templates are in son
Arbitrarily place in window, a kind of form is referred to as a kind of feature, the feature finding out all subwindows is by
The basis of Adaboost weak typing training.The face being combined using Adaboost algorithm and haar feature
Detection technique, detection is accurately and reliably.
In the present embodiment, face discrimination module 15 use default by Adaboost algorithm with haar
Features training goes out Face datection model and carries out facial image detection to the moving target extracting, and according to
Testing result judges whether include facial image in the moving target extracting.
The video frequency abstract generating means of the present embodiment can also include track following module, and every frame is detected
To mobile target be tracked, tracking can adopt closest method, and concrete steps can be:
People will be comprised in the previous frame image with target frame for the moving target comprising facial image in target two field picture
The moving target of face image carries out track following, the motion rail of the moving target obtaining comprising facial image
Mark.
Wherein, track following can include several steps such as Track association, Track Pick-up and track disappearance
Rapid judgement.Specifically method of discrimination is:Calculate the motion mesh comprising facial image in target two field picture
The intersection area of the moving target of facial image is comprised in the previous frame image of mark and target frame;Judge to hand over
Whether fork area is more than preset area value;When intersection area is more than preset area value, according to target frame
The moving target of the facial image location updating movement locus on image is comprised in image;Work as cross facet
When amassing less than or equal to preset area, the moving target according to comprising facial image in target two field picture exists
Position on image generates new movement locus.Repeat above step, until all in traversal present frame
The moving target comprising face.
The area of the moving target of former frame of hypothesis target frame is Spre, the moving target of target two field picture
Area be Stemp, above-mentioned preset area value could be arranged to min (Spre,Stemp) × R, then when above-mentioned
Intersection area ScrossMeet:Scross>min(Spre,StempIt is possible to determine that target two field picture during the condition of) × R
Moving target is associated with the track of the moving target of the former frame of target frame, according to target two field picture
Moving target this movement locus of the location updating on image.In above formula, R is cross-ratio, permissible
Empirically value carries out value, and general value is 0.4.
Above-mentioned intersection area ScrossComputational methods be Scross=Widthcross×Heightcross, wherein,
Widthcross=min (rightpre,righttemp)-max(leftpre,lefttemp), rightpreThe former frame motion mesh being
Be marked on the maximum of abscissa in image coordinate, represent moving target previous frame image in
Right position;leftpreThe minimum of a value of the former frame moving target abscissa in image coordinate being, represents
Moving target previous frame image in the most left position;S be in target frame moving target in image
The maximum of abscissa in coordinate, represents least significant in target two field picture for the moving target;lefttemp
It is the minimum of a value of moving target abscissa in image coordinate in target frame, represent moving target in mesh
Leftmost position in mark two field picture.Therefore min (rightpre,righttemp) it is rightpreAnd righttempIn less
One value, max (leftpre,lefttemp) it is leftpreAnd lefttempIn a larger value.
Heightcross=min (Toppre,Toptemp)-max(Bottompre,Bottomtemp), BottompreThe former frame being
The minimum of a value of moving target ordinate in image coordinate, represents moving target in previous frame image
Bottom position;ToppreThe maximum of the former frame moving target ordinate in image coordinate being, generation
Table tip position in previous frame image for the moving target;ToptempIt is that in target frame, moving target is being schemed
As the maximum of ordinate in coordinate, represent bottom position in target two field picture for the moving target;
ToppreIt is the minimum of a value of moving target ordinate in image coordinate in target frame, represent moving target
Tip position in target two field picture.Therefore min (Toppre,Toptemp) it is ToppreAnd ToptempIn less
One value, max (Bottompre,Bottomtemp) it is BottompreAnd BottomtempIn a larger value.
It is S when intersection area is less than or equal to preset areacross≤min(Spre,Stemp) × R, according to target
Position on image for the moving target of two field picture generates new movement locus, and the motion before judging
Track disappears.
It is S when intersection area is less than or equal to preset areacross≤min(Spre,Stemp) × R, according to target
Position on image for the moving target of two field picture generates new movement locus, and the motion before judging
Track disappears.Above step is both for comprising the moving target of facial image, for not comprising face
Movement locus can disregard, automatically remove.
The flow process of summarization generation module 17 specifically can include:According to the moving target comprising facial image
Movement locus occur time relationship and locus this movement locus is arranged;After arranging
Movement locus be added on background image, thus generating the video frequency abstract comprising facial image.
The embodiment of the present invention additionally provides a kind of video abstraction generating method, this video abstraction generating method
Can be executed by any one video frequency abstract generating means that the above embodiment of the present invention is provided, Fig. 2
It is the schematic diagram of video abstraction generating method according to embodiments of the present invention, this video abstraction generating method,
Including:
Step S21, carries out background modeling to the target two field picture in original video, obtains background model;
Step S23, extracts the moving target in target two field picture using background model;
Step S25, judges whether include face figure in the moving target extracting using default grader
Picture;
Step S27, the moving target including facial image is carried out trajectory alignment, generates summary.
Wherein, step S21 specifically can include:Using the figure to target frame for the mixed Gaussian Background Algorithm
As being calculated, obtain the mixed Gauss model of target two field picture.Step S21 make use of mixed Gaussian
The feature of Background Algorithm, is smoothly approximately appointed by the weighted average of multiple Gaussian probability-density functions
The density fonction of meaning shape, can be by room it is adaptable to the image for outdoor environment is processed
Moving target in video under external environment is rapidly and accurately identified.
Step S25 specifically can include:Instructed by Adaboost algorithm and haar feature using default
Practise Face datection model and facial image detection is carried out to the moving target extracting, and according to detection knot
Really judge whether include facial image in the moving target extracting.Using Adaboost algorithm and haar
The human face detection tech that feature combines, detection is accurately and reliably.
The video abstraction generating method of the present embodiment, can also include after step S23:By target
Comprise in two field picture to comprise facial image in the moving target of facial image and the previous frame image of target frame
Moving target carry out track following, the movement locus of the moving target obtaining comprising facial image.Tool
Body ground flow process be:The moving target of facial image and the former frame of target frame will be comprised in target two field picture
The moving target comprising facial image in image carries out track following and includes:Calculate in target two field picture and wrap
The moving target of facial image is comprised in the previous frame image of the moving target containing facial image and target frame
Intersection area;Judge whether intersection area is more than preset area value;When intersection area is more than default face
During product value, according to comprising the moving target of the facial image location updating on image in target two field picture
Movement locus;When intersection area is less than or equal to preset area, comprise people according in target two field picture
Position on image for the moving target of face image generates new movement locus.Specific computational methods exist
Introduce video frequency abstract generating means to have introduced, here is not repeated.
Step S27 specifically can include:Movement locus according to the moving target comprising facial image goes out
Existing time relationship and locus arrange to this movement locus;Movement locus after arrangement is folded
It is added on background image.
The video abstraction generating method of the present embodiment, is concerned about the energy in the front occurring in video in user
See clearly under the occasion of face it may be possible to quickly browse the personage occurring in video to move target.First
First carry out background modeling, the prospect of detection motion, object be tracked, obtain the track of object,
Then Face datection is carried out to the track of motion, reject the track being not detected by face, preserve inspection
Measure the track of face, then respectively the track having face preserving is arranged, generate
Summary.Namely it is broadly divided into:Foreground detection, target following, Face datection, summarization generation are several
Step.Fig. 3 is the flow chart of video abstraction generating method according to embodiments of the present invention, as shown in the figure:
The step of foreground detection mainly includes:Using mixed Gaussian, background modeling is carried out to image, extract
The prospect of motion, calculating process will be processed accordingly to illumination and shade.Using mixed Gaussian pair
Image carries out background modeling, extracts the prospect of motion, wherein mixing can be selected high according to video scene
The number that this function is adopted, can individually train a Gauss model for shade or illumination.
The step of target following mainly includes:The target that every frame is detected is tracked, tracking
Simply closest method can be adopted, and storage track and Background.If before certain of present frame
On the Track association that scape is stored with previous frame, then update track, if track does not associate, produce
New track, if either with or without the track associating with the prospect that present frame detects, terminates this track and enters
Row subsequent operation, track is stored, and is used for being subsequently generated video frequency abstract.
The step of Face datection mainly includes:Using cascade adaboost learning algorithm and haar feature
Combine, train human-face detector, Face datection is carried out to the track of motion, preserves and face is detected
Motion track, remove and can't detect the track of face.
The step of summarization generation mainly includes:Background according to the storage extracting and comprise face
The track of the moving target of image, according to track, the time relationship occurring and spatial relationship are carried out to track
Arrangement, then the target trajectory of motion is added on the Background of storage, generates summary.Thus utilizing
The trace information of all moving targets extracting and the background of storage, by certain rule compositor, then
The track of mobile for face target is added in background, generates video frequency abstract.
Application technical scheme, technical scheme extracts mobile target in the picture
Afterwards, judge that extracting the prospect obtaining moves whether target comprises face figure using default grader
Picture, generates video frequency abstract to the mobile target comprising face, and removes the track that can't detect face.
Thus complete and accurate ground generates the video frequency abstract meeting user's request, by Face datection and video frequency abstract
Combine, generate the video frequency abstract of the mobile target comprising facial image.So that user can be plucked from video
Quickly get, in wanting, the video information comprising face, improve the service efficiency of video.The present invention is not
Affected by illumination variation and camera angle, distance, accurate can be identified people in video again
Body information.
Through the above description of the embodiments, those skilled in the art can be understood that this
Invention can be realized by the mode of software plus necessary general hardware platform naturally it is also possible to pass through hard
Part, but the former is more preferably embodiment in many cases.Based on such understanding, the skill of the present invention
Art scheme substantially in other words prior art is contributed partly can in the form of software product body
Reveal to come, this computer software product can be stored in storage medium, such as ROM/RAM, magnetic disc, light
Disk etc., including some instructions with so that a computer equipment (can be personal computer, service
Device, or the network equipment etc.) execution each embodiment of the present invention or embodiment some partly described
Method.
The above is only the preferred embodiment of the present invention it is noted that for the art
For those of ordinary skill, under the premise without departing from the principles of the invention, some improvement can also be made
And retouching, these improvements and modifications also should be regarded as protection scope of the present invention.