The content of the invention
It is an object of the invention to provide a kind of generation of video frequency abstract and indexing means, to overcome currently available technology presence
Above-mentioned deficiency.
The purpose of the present invention is to be achieved through the following technical solutions:
A kind of video frequency abstract generation and indexing means, comprise the following steps:
1)Background modeling:Background modeling is carried out to the target two field picture in original video, background extracting is realized, is regarded from original
Separating background in frequency;
2)Moving target recognition:Current image and background model are compared segmentation, determined to transport according to comparative result
Moving-target;
3)Motion target tracking:The spatial information that interframe is distributed and the clarification of objective split per two field picture are carried out
Matching, realizes target following, and record the movement locus of target;
4)Moving target position amendment:The goal set traced into is modified, mainly to target in sequence in image
In position be modified;And
5)Summary synthesis and video index are set up:Moving target is superimposed upon in background, when will be different in original video
Generation activity it is unobstructed in video frequency abstract or block it is less in the case of synchronously play, produce one over time and space
Relative compact and the summarized radio for including required activity in original video, docket video data during synthetic video are formed
Index data file.
Further, step 1)The method that middle background modeling uses color background model.
It is preferred that, the color background model specifically uses mixed Gaussian Background Algorithm.
Further, step 2)If there is the defect of cavity and noise jamming in the moving target after middle extraction, using shape
State open and close operator is handled, and eliminates cavity and noise;Step 2)If there is same target quilt in the moving target after middle extraction
Be divided into the defect of two or more targets, then it is mutual between calculating target to all targets extracted in each frame
Space length, is less than threshold value Λ target identification into same target by distance.
Further, step 3)Specifically include following steps:
a)The distributed intelligence of tracking module utilization space and color characteristic carry out matched jamming between the moving target of consecutive frame,
What the match is successful is considered as same target, and records movement locus;Matching is unsuccessful to be considered as a new moving target.
b)The result of tracking is stored in setIn,Middle object representation mode is as follows:
Wherein,Represent targetThe sequence occurred in video.
Further, the method for the matched jamming includes following two:
The first:Target in target and set omega that a new frame is split is matched, and is defined with minor function:
Time difference function:
Wherein,A target newly extracted is represented,Represent setIn a target.RepresentWhen
Between stab,RepresentTimestamp.For the time difference threshold value of definition.
Distance difference function:
Wherein,A target newly extracted is represented,Represent setIn a target.Table
ShowWithDistance spatially.For the range difference threshold value of definition.
Comparison function:
If comparison functionFor 1, then calculateWithColor histogram map distance, meet Histogram distance threshold value
The match is successful, willIt is added toSequence in.If matching it is unsuccessful orFor 0, thenIt is a new target, willIt is added to setIn.
Second:By first method first by target beta andA newest frame for target sequenceIt is compared, if matching
It is unsuccessful, then andFormer frame be compared, untilPreceding M frames.
Further, step 4)In moving target position be modified specifically include following steps:
The first step, after the completion of video all processing, statisticsIn each targetSequence in target width,
Height simultaneously sorts.
After sequenceWidth means it is as follows:
After sequenceHeight be expressed as follows:
Second step, calculates the average value of above sequence, obtains target respectivelyWidthAnd height, according toWith
Each target location in target sequence is modified.
Further, step 5)During middle summary synthesis, the moving target for participating in merging in each frame of video frequency abstract need to be recorded
Coding, position and the timestamp occurred first, by these values keep indexed file in.
Beneficial effects of the present invention are:After motion target tracking, it is ensured that the success rate of tracking, regarding for generation is greatly improved
The quality of frequency summary, video index work(disclosure satisfy that user quickly checks video, easily check that original video is completely seen
See actual conditions.
Embodiment
As shown in figure 1, the step of embodiment of the present invention is by background modeling, moving target recognition, motion target tracking, motion
Target amendment, summary synthesis, video index composition.It is comprised the following steps that:
1st, background modeling
Background modeling module can use various image background modeling algorithms, including color background model and grain background mould
The class of type two.Its thought of color background model is the color value to each pixel in image(Gray scale or colour)It is modeled.If
When pixel color value in pixel color value and background model on present image coordinate (x, y) on (x, y) has larger difference, when
Preceding pixel is considered as prospect, is otherwise background.
The present embodiment background modeling module uses the mixed Gaussian Background Algorithm in color background model, mixed Gaussian background
Model(Gaussian Mixture Model)It is to be developed on the basis of single Gauss model, it is close by multiple gaussian probabilities
The weighted average of degree function carrys out the density fonction of smoothly approximate arbitrary shape.Mixed Gauss model is assumed to be used for describing every
The Gaussian Profile of the color of individual pixel is K, typically takes 3 ~ 5.The present embodiment K values are 3.
2nd, moving target recognition
After Background Modeling, current image and background model are carried out certain and compared, need are determined according to comparative result
The moving target to be detected.Generally, the prospect obtained contains many noises, in order to eliminate noise, the present embodiment pair
The movement destination image of extraction has carried out opening operation and closed operation, and smaller profile is then abandoned again.
The present embodiment is after target is extracted, the pixel sum that it is included to each object statistics, if a certain mesh
Mark pixel sum and be less than 400 pixels, the target is considered as ELIMINATION OF ITS INTERFERENCE and fallen, do not processed by the present embodiment.
The problem of in order to solve same Target Segmentation into two and above target, calculate in present frame between all targets
Mutual space length, in units of pixel, will apart from less thanTarget identification into same target.Λ values in the present embodiment
For 15 pixels.
3rd, motion target tracking module
To some moving target of present frame, because inter frame temporal interval is very short, space size shared by moving target and
Residing spatial position change is smaller, and the distributed intelligence of the present embodiment utilization space and color characteristic are between the moving target of consecutive frame
Carry out matched jamming.
The distributed intelligence of tracking module utilization space and color characteristic carry out matched jamming between the moving target of consecutive frame.
With being successfully considered as same target, and movement locus is recorded, match and unsuccessful is considered as a new moving target.
The result of tracking is stored in setIn,Middle object representation mode is as follows:
Wherein,Represent targetThe sequence occurred in video.
If a certain frame Objective extraction effect of extraction module is bad, tracking can be caused to fail.In order to improve the success of tracking
Rate, using following two method:
1)Target of the target that a new frame is split not only with previous frame is matched, but and setIn mesh
Mark is matched, and is defined with minor function:
Time difference function:
Wherein,A target newly extracted is represented,Represent setIn a target.RepresentWhen
Between stab,RepresentTimestamp.For the time difference threshold value of definition.
Distance difference function:
Wherein,A target newly extracted is represented,Represent setIn a target.Table
ShowWithDistance spatially.For the range difference threshold value of definition.
Comparison function:
If comparison functionFor 1, then calculateWithColor histogram map distance, meet Histogram distance threshold value
The match is successful, willIt is added toSequence in.If matching it is unsuccessful orFor 0, thenIt is a new target, willIt is added to setIn.
2)In above method, only by target andA newest frame for target sequence is compared, ifLast frame
Extract bad, it may appear that the situation of tracking failure.First by target beta andA newest frame for target sequenceIt is compared, if
With unsuccessful, then andFormer frame be compared, untilPreceding M frames.
In the present embodiment, the frame number appeared in using target in video flowing sequence is used as its timestamp, the first frame number
For 0, increase successively.The present embodiment time difference functionValue is 15, represents target to be matchedAnd setMiddle target
Timestamp difference should be within 15 frames.
In the present embodiment, target to be matched is calculatedAnd setMiddle targetThe distance between when, with two targets it
Between pixel value between closest approach be used as both distances, distance difference functionValue is 20, is represented to be matched
TargetAnd setMiddle targetDistance difference should be in 20 pixels.
M values are 10 in the present embodiment tracking module, represent target to be matchedCan and it gatherMiddle targetSequence
Last 10 targets are compared, and are carried out when comparing according to the inverted order of target time of occurrence.
The present embodiment statistics obtains target to be matchedAnd setInColor histogram, calculate the two histogrammic
Bhattacharyya distances, to describe two histogrammic similitudes.If Bhattacharyya distances are less than 0.6, say
It is brightAnd setInThe match is successful, willIt is added toSequence in.IfWithIn all targets can not all match, then
GiveOne target code, willIt is added to setIn.
4th, moving target position correcting module
Moving target position correcting module is after the completion of video all processing, statisticsIn each targetSequence
The width of middle target, height, to target in ΩThe target location of sequence is modified, rightWidth and height are from big in sequence
It is ranked up to small, after sequenceWidth means it is as follows:
After sequenceHeight be expressed as follows:
Top n width and the average value of height after sequence are calculated, mean breadth and average height is drawn.Here N values areThe 20% of sequence sum.The principle alignd during amendment according to target's center, symmetrical modification target width is symmetrical above and below to repair
Change object height.
It is the target after amendment as shown in Figure 3 as shown in Fig. 2 being the position of the previous target sequence of amendment in the picture
The position of sequence.After moving target position amendment, the incomplete problem of the Objective extraction having in extraction process can be improved,
Improve the quality of the video frequency abstract of generation.
5th, summary synthesis and video index
The module mainly completes the moving target traced into be synthesized with video background, is sent out when will be different in original video
Raw activity is unobstructed in video frequency abstract(Or block smaller)In the case of synchronously play, produce one over time and space
Relative compact and the summarized radio for including required activity in original video.
For each two field picture of video frequency abstract, which moving target is selected while occurring being the key synthesized.This implementation
Example is determined by calculating the energy damage threshold of each moving target.The function is by moving target time difference loss function and fortune
Moving-target collision loss function is constituted, and the selection qualified moving target of energy damage threshold value is merged.
Produce before each frame video frequency abstract, moving target is divided into three classes set:Completion is merged(S1), merge
(S2), it is to be combined(S3).According to the sequencing of time of occurrence from S3, the energy loss letter between set S2 is calculated successively
Number, meets and occurs in same frame video just merging for loss threshold value.
Need to provide background image during merging, choose the background at moving target time of occurrence earliest moment in the frame as the back of the body
Scape image.
When merging moving target, record the coding of moving target for participating in merging in each frame, position, occur first when
Between stab, by these values preserve indexed file in.
When user clicks on video, judge whether mouse position falls in the range of the envelope of moving target, if mouse position
Put in a certain target zone, search index file obtains the time that the target occurs in original video.
The present invention is not limited to above-mentioned preferred forms, and anyone can show that other are various under the enlightenment of the present invention
The product of form, however, make any change in its shape or structure, it is every that there is skill identical or similar to the present application
Art scheme, is within the scope of the present invention.