The early-warning detection method of emergency case in a kind of smart city video monitoring
Technical field
The present invention relates to a kind of early-warning detection method of emergency case in smart city video monitoring.
Background technology
Video monitoring species is various, and traditional monitor video method for detecting abnormality can not adapt to a variety of environment very well.Because mesh
Preceding detection method, caused number of videos is huge daily for each camera, various due to video genre if processing locality
Property, and local host computing capability are limited, and the degree of accuracy that is handled when in face of magnanimity monitor video, response speed are all very low,
Therefore tested and analyzed in local host, the accuracy of early warning result cannot be guaranteed;If uploading Cloud Server processing,
Because monitor video data volume is huge, upload high in the clouds processing procedure take it is oversize, at the influence of can also be because of network blockage situations such as
Effect is managed, emergency case is missed the optimal response time from real-time early warning.How to judge to happen suddenly using video monitoring data
Event, such as in the detection of the events such as burst terror, violence, colony's aggregation, to accomplish fast and accurately to complete early warning detection
It is an extremely difficult thing.
Video Supervision Technique development in recent years is very fast, as disclosed in China number of patent application for 201210047156.6
" detection method of abnormal behaviour in video monitoring ", this method calculate target by changing entropy between optical flow method calculating target frame
Kinergety, according to entropy and kinergety progress decision-making is changed between target frame, in the event of exception, then alarm.The detection side
The weak point one of method is to calculate changes of entropy using optical flow method, amount of calculation is larger when optical flow method is detected, and can not ensure reality
When property and practicality;Second, a large amount of occasions have Normal aggregation motion conditions, the square video monitoring of square dance is such as jumped, or
The market of densely populated place, these scene motion energy can cause largely to report by mistake to monitoring system, and this method changes of entropy uses
Same threshold value, without practicality.
During China Patent No. is 201210223375.5, disclosed " group's crowd's unusual checking in video monitoring
In method ", by the macrocyclic method for estimating based on video particle, the movement locus of target is obtained, to track spacing
Spectral clustering analysis is carried out from, travel speed information, by normal trace suddenly change come the identification that is blocked and fallen, but should
The behavior of method detection is excessively single, for the unconspicuous abnormal scene of motion feature, a large amount of wrong reports be present and fails to report, judge work
Local host is concentrated on, when handling multiple live video streams, the performance of main frame has larger limitation.
Chinese Patent Application No. 201610841596.7 " personnel based on video monitoring platform go around behavioral value side
In method ", disclose and carry out background modeling using Gaussian Mixture background method, and according to profile complexity, area and boundary rectangle
Aspect ratio features are simply screened, and obtain pedestrian's foreground blocks, then determine whether the degree that video state changes, and then
The video flowing of abnormal behaviour is obtained, it judges that work concentrates on local host, when handling multiple live video streams, the property of main frame
There can be larger limitation.
Also in " a kind of smart city intelligent monitor system " of Chinese Patent Application No. 201611151575.9, disclose
The system being made up of monitoring information acquisition system, monitoring information processing end and monitoring information responder, and describe the system and lead to
Cross dot matrix layout, all standing to urban space, a triggered monitoring information acquisition end directly with monitoring information processing end
It is connected, and command and monitor information response end responds, and farthest ensure that the promptness of emergency response.The monitoring system
Weak point be that whole city real time video data amount is huge, the data transfer at monitoring information acquisition end to monitoring information processing
End process is time-consuming longer, and is easily limited by network environment, makes real-time be difficult to be protected.
With the expansion of city size, the continuous lifting of managerial skills, it is desirable to development of the city management to Internationalization level,
For the early-warning detection method of emergency case in a kind of this necessary smart city video monitoring of exploitation.
The content of the invention
The problem of existing the invention aims to the prior art of solution, and provide in a kind of smart city video monitoring
The early-warning detection method of emergency case, when occurring emergency case in monitor video, the feelings that happen suddenly can be judged in the very first time
The threat types and threat level of condition, early warning and processing are carried out in time.
To reach above-mentioned purpose, the technical solution adopted by the present invention is:There is provided and happened suddenly in a kind of smart city video monitoring
The detection method of situation, it is to establish an early warning detecting system, provided with client and cloud server end, described client first
Provided with monitoring camera, local host and the processing software in local host;Cloud server end be provided with Cloud Server and
The off-note storehouse of processing software and foundation in Cloud Server;Operate as follows again:
(1), the monitor video of each monitoring camera transmission in city is obtained by the local host of client, to monitoring camera
A large amount of monitoring video flows of head output are pre-processed;
(1.1), the local host in client uses mixture Gaussian background model by all frame of video by handling software
Truncated picture pixel is divided into background and the class of prospect two;
(1.2), local host carries out key-frame extraction using frame difference method to the frame of video of interception, and only key frame is grasped
Local host data processing amount is greatly reduced in work;
(1.3), local host is combined the key frame of extraction with the foreground image in mixture Gaussian background model, by image
In there are track characteristic, expressive features, textural characteristics, velocity characteristic, the foreground features of acceleration signature to extract respectively, add
Enter integrity detection mark, encapsulation is packaged into package feature packet and is uploaded to Cloud Server;
(1.4), the Cloud Server feedack of the also real-time reception cloud server end of the local host in client, and root
According to the threat types and threat level of feedback early warning, corresponding warning and processing are made;
(2), the Cloud Server of described cloud server end obtains each monitoring camera in city by another Channel Synchronous and passed
The monitor video sent, a large amount of monitoring video flows are pre-processed;
(2.1), video flowing is switched to picture by Cloud Server to monitoring video flow using frame interception is carried out at equal intervals;
(2.2), described picture completes foreground object separation by object detection segmentation;
(2.3) foreground object, is subjected to tagsort, separates track characteristic, expressive features, textural characteristics, velocity characteristic
And acceleration signature;
(2.4), the foreground object Jing Guo tagsort is passed through SACBA association rule minings and grader structure by Cloud Server
Build, using the SACBA sorting algorithms of adaptive threshold correlation rule, described SACBA association rule minings are used to find data
In the information of potentially useful that implies, establish the description of model for each category feature data;Grader is used to choose priority
Other correlation rule is constructed, and is extracted the off-note in magnanimity monitor video data by grader, is transmitted to off-note
Storehouse, while off-note storehouse is expanded by ever-increasing original video data, the data in real time automatic update off-note storehouse;
(2.5), the package feature packet data of cloud server client, the integrality of the packet is detected,
After confirming that packet is complete, with the off-note storehouse of structure match parsing characteristic attribute, and according to different emergency cases,
Judge the threat types and threat level of emergency case, feed back to the local host of client.
The local host of client uses mixture Gaussian background model by all intercepting video frames in described step (1.1)
Image pixel be divided into background and the class of prospect two;Operating procedure is:
(1.1.1), described mixture Gaussian background model be by the weighted average of multiple Gaussian probability-density functions come
Smoothly represent the density fonction of arbitrary shape;
I (x, y, t) is made to represent pixel value of the pixel in t, then density fonction P (I (x, y, t)) is expressed as
In above formula:K is the mixed coefficint of the number, referred to as Gaussian-mixture probability density of Gaussian Profile;For t
I-th of Gaussian Profile of moment,For average, δtFor covariance matrix;
(1.1.2), the k Gaussian component for a pixel, according toValue arranged from big to small, for full
The preceding B Gaussian Profile of foot formula is treated as background model;
Wherein:WkFor weights, T is the minimum scale that background model occupies Gaussian Profile, is arranged to 0.7;
(1.1.3), for current pixel (x, y, t), if its value I (x, y, t) and k-th of Gaussian Profile in its background model
Matching, wherein k≤B, i.e. I (x, y, t) existWithin the scope of, whereinFor desired value,For t when
The standard deviation of k-th of Gaussian Profile is carved, λ is constant, is arranged to 2.5, then the pixel is considered as background, is otherwise prospect;
It is output to make output image, and calculation formula is:
After prospect has been detected, if the pixel is considered as prospect, i.e., before no one of B Gaussian Profile therewith
Match somebody with somebody, then substitute that minimum Gaussian Profile of weight with a new Gaussian Profile;The desired value of new distribution is current
Pixel value, while distribute an initial deviation std_init and initial weight value weight_init for it;
(1.1.4) if, the pixel be considered as background, to the weight of each Gaussian Profile of the pixelDo as follows
Adjustment:
Wherein:α is learning rate, and α values are between 0~1, and M is totalframes, Di,tFor constant, if i-th of Gaussian Profile with
Current pixel matches, then Di,t=1, otherwise Di,t=0;
For the Gaussian Profile matched with current pixel, their desired value and deviation is updated.
Local host carries out key-frame extraction using frame difference method to the frame of video of interception in described step (1.2), described
Frame difference method be utilize same camera lens in each frame between change it is very small, pass through histogram carry out video image it is similar
The comparison of degree, when acute variation occurs for the histogram of two interframe, next camera lens is now entered, the first frame of camera lens is determined
Position is key frame;And compare the grey level histogram difference of consecutive frame using absolute distance method, with the gray scale difference of two frame respective pixels
Absolute value sum as frame-to-frame differences;Frame-to-frame differences calculation formula:
Wherein:Fi(x,y)、Fj(x, y) represents the i-th, gray value of j frames (x, y) position respectively, if representing, i, j frame-to-frame differences surpass
When crossing the threshold value of setting, then it is assumed that have Shot change.
The method of the present invention is to establish an early warning detecting system first, provided with client and cloud server end, using double
Passage transmits monitor video to client and cloud server end respectively.The monitoring of client and cloud server end respectively to magnanimity regards
Frequency stream has carried out video pre-filtering, analysis, rational to accept or reject and divide.Mixture Gaussian background model, pass are employed in client
The operations such as the extraction of key frame, background separation, foreground features extraction, only the foreground features extraction post package compression in key frame is beaten
Biography Cloud Server is wrapped, Cloud Server is by the way that the off-note storehouse of the package feature packet of transmission and cloud server end is carried out
Contrast, feedback judged result is to client.Due to uploading the package feature packet very little of compression, it is almost real to upload response process
Shi Jinhang, when emergency case occurs in monitor video, it can be handled with the very first time.When original video stream passes through another lead to
Road uploads cloud server end, and Cloud Server carries out frame interception, object detection segmentation, extraction expression, track, texture, speed, acceleration
The features such as degree, grader construction is carried out by SACBA Classification of Association Rules algorithm, by ever-increasing original video data,
Progressively expand off-note storehouse so that real-time and accurately can be transmitted by client in the monitoring video information of different scenes
Data match with the contrast of off-note storehouse, real-time and accurately make threat types and threat etc. to emergency case for Cloud Server
The judgement of level.
The SACBA association rule minings of cloud server end are using adaptive threshold correlation rule in the method for the present invention
SACBA sorting algorithms;Traditional association sorting algorithm all relies on the support and confidence threshold value being manually set, and rule of thumb gives
The threshold value gone out, it is impossible to changed according to concrete scene dynamic change.When threshold value set it is too low, excessive classifying rules can be produced, very
To over-fitting problem is produced, threshold value setting is too high, then can ignore some rare characteristic items, it is impossible to enough classifying rules are found,
The degree of accuracy is caused to decline.And the SACBA sorting algorithms that the present invention uses are automatically generated then according to monitoring video flow feature by system
Support and confidence threshold value, when Cloud Server calculates overlong time, when response process is slow, system can improve threshold value automatically,
System real time is allowed to be guaranteed, when the degree of accuracy for feeding back to local system is relatively low, system reduces threshold value automatically, treats local pipe
After reason personnel confirm, as new threshold value;The generation of maximum frequent itemsets is determined by support, finally caused accurately to divide
Rule-like is determined by confidence level.Beta pruning is carried out according to threshold value correlation rule in the method for the present invention, therefrom selects priority higher
Rule cover training sample, and generate grader;According to different characteristic collection, dynamic support and confidence threshold value are set,
According to the importance of different characteristic, different supports and confidence level are set, greatly improve off-note storehouse for different scenes
Adaptability.
The early-warning detection method of emergency case, has compared with prior art in the smart city video monitoring of the present invention
Beneficial effect is:
(1), method client of the invention has carried out rational choice and division to magnanimity monitoring video flow, only checks on
Compression packing uploads Cloud Server after foreground features extraction in key frame, and Cloud Server is by the information and cloud of package feature packet
The off-note storehouse of server end is contrasted, and is judged result and is fed back to client.Due to the package feature data of upload
Bag very little, upload response process and almost carry out in real time, when there is emergency case in monitor video, Cloud Server judges the feelings that happen suddenly
The threat types and threat level of condition, client is fed back in time, local host can be handled in the very first time, be reached pair
The purpose of the detection early warning of emergency case.
(2), original video stream uploads Cloud Server by another passage in method of the invention, is intercepted by frame, object
The feature such as detection segmentation, extraction expression, track, speed, acceleration, and calculated using SACBA adaptive thresholds Classification of Association Rules
Method carries out grader construction, by the original video data for being continuously increased and updating, progressively expands and update abnormal feature database, by
Step improves the degree of accuracy to the detection of polytype emergency case;The package feature packet information and exception that Cloud Server will receive
Feature database is contrasted, and is made accurate early warning in real time and is judged to feed back to client.It can ensure monitoring and early warning using this method
Real-time and accuracy.
(3), cloud server end employs SACBA association rule minings and grader structure in method of the invention, employs
A kind of SACBA sorting algorithms of new adaptive threshold correlation rule, solve the dependence of traditional association sorting algorithm and be manually set
Support and confidence threshold value present in disadvantage, SACBA algorithms are to automatically generate support and confidence threshold value by system;
Beta pruning is carried out according to threshold value correlation rule, therefrom selects the higher rule of priority to cover training sample, and generate grader;
Dynamic support and confidence threshold value can be set automatically according to different characteristic collection, different branch are set according to the importance of different characteristic
Degree of holding and putting property degree, greatly improve the accuracy that off-note storehouse judges for different scenes.
Brief description of the drawings
Fig. 1 is the early-warning detection method operating procedure schematic diagram of emergency case in smart city video monitoring of the invention.
Embodiment
The present invention is further illustrated with specific embodiment below in conjunction with the accompanying drawings, but the implementation of the present invention is not limited to
This.
Embodiment 1:The present invention provides a kind of early-warning detection method of emergency case in smart city video monitoring, is first
An early warning detecting system is established, provided with client and cloud server end, described client is provided with monitoring camera, this landlord
Machine and the processing software in local host;Cloud server end is provided with Cloud Server and the processing in Cloud Server
Software and the off-note storehouse of foundation;Operate as follows again:Referring to Fig. 1.
(1), the monitor video of each monitoring camera transmission in city is obtained by the local host of client, to monitoring camera
A large amount of monitoring video flows of head output are pre-processed;
(1.1), the local host in client uses mixture Gaussian background model by all frame of video by handling software
Truncated picture pixel is divided into background and the class of prospect two;
This method is ensures to adapt to the diversity of scene, using mixture Gaussian background model by all intercepting video frames
Image pixel be divided into background and the class of prospect two, its operating procedure is:
(1.1.1), described mixture Gaussian background model be by the weighted average of multiple Gaussian probability-density functions come
Smoothly represent the density fonction of arbitrary shape;
I (x, y, t) is made to represent pixel value of the pixel in t, then density fonction P (I (x, y, t)) is expressed as
In above formula:K is the mixed coefficint of the number, referred to as Gaussian-mixture probability density of Gaussian Profile;For t
I-th of Gaussian Profile of moment,For average, δtFor covariance matrix;
(1.1.2), the K Gaussian component for a pixel, according toValue arranged from big to small, for full
The preceding B Gaussian Profile of foot formula is treated as background model;
Wherein:WkFor weights, T is the minimum scale that background model occupies Gaussian Profile, is arranged to 0.7;
(1.1.3), for current pixel (x, y, t), if its value I (x, y, t) and k-th of Gaussian Profile in its background model
Matching, wherein k≤B, i.e. I (x, y, t) existWithin the scope of, whereinFor desired value,For t when
The standard deviation of k-th of Gaussian Profile is carved, λ is constant, is traditionally arranged to be 2.5, then the pixel is considered as background, before being otherwise
Scape;
It is output to make output image, and calculation formula is:
After prospect has been detected, if the pixel is considered as prospect, i.e., before no one of B Gaussian Profile therewith
Match somebody with somebody, then substitute that minimum Gaussian Profile of weight with a new Gaussian Profile;The desired value of new distribution is current
Pixel value, while distribute an initial deviation std_init and initial weight value weight_init for it;
(1.1.4) if, the pixel be considered as background, to the weight of each Gaussian Profile of the pixelDo as lowered
It is whole:
Wherein:α is learning rate, and α values are between 0~1, and M is totalframes, Di,tFor constant, if i-th of Gaussian Profile with
Current pixel matches, then Di,t=1, otherwise Di,t=0;
For the Gaussian Profile matched with current pixel, their desired value and deviation is updated.
(1.2), local host carries out key-frame extraction using frame difference method to the frame of video of interception, and only key frame is grasped
Work can be greatly reduced local host data processing amount;
Described frame difference method is to utilize the change between each frame in same camera lens very small, is regarded by histogram
The comparison of the similarity of frequency image, when acute variation occurs for the histogram of two interframe, next camera lens is now entered, by mirror
First frame alignment of head is key frame;And compare the grey level histogram difference of consecutive frame using absolute distance method, it is corresponding with two frames
The absolute value sum of the gray scale difference of pixel is as frame-to-frame differences;
Frame-to-frame differences calculation formula is as follows:
Wherein:Fi(x,y),Fj(x, y) represents the i-th, gray value of j frames (x, y) position respectively, if representing the difference of i, j interframe
More than setting threshold value when, then it is assumed that have Shot change.
Frame difference method extraction key frame compares other Key-frame Extraction Algorithms, in computation complexity, adapts in the scope of scene
All have a clear superiority.
(1.3), foreground features extraction step is the foreground image in the key frame and mixture Gaussian background model by extraction
With reference to, by image have track characteristic, expressive features, textural characteristics, velocity characteristic, acceleration signature foreground features distinguish
Extract, add integrity detection mark, encapsulation packing and compression are uploaded to Cloud Server.
(1.4), the local host in client receives the Cloud Server feedack of cloud server end, and according to feedback
Early warning threat types and threat level, make corresponding to warning and processing.
(2), the Cloud Server of described cloud server end obtains each monitoring camera in city by another Channel Synchronous and passed
The monitor video sent, a large amount of monitoring video flows are pre-processed;
(2.1), video flowing is switched to picture by Cloud Server to monitoring video flow using frame interception is carried out at equal intervals;
(2.2), described picture completes foreground object separation by object detection segmentation;
(2.3) foreground object, is subjected to tagsort, separates track characteristic, expressive features, textural characteristics, velocity characteristic
And acceleration signature;
(2.4), the foreground object Jing Guo tagsort is passed through SACBA association rule minings and grader structure by Cloud Server
Build, using the SACBA sorting algorithms of adaptive threshold correlation rule, described SACBA association rule minings are used to find data
In the information of potentially useful that implies, establish the description of model for each category feature data;Grader is used to choose priority
Other correlation rule is constructed, and is extracted the off-note in magnanimity monitor video data by grader, is transmitted to off-note
Storehouse, while off-note storehouse is expanded by ever-increasing original video data, the data in real time automatic update off-note storehouse;
(2.5), the package feature packet data of cloud server client, the integrality of the packet is detected,
After confirming that packet is complete, with the off-note storehouse of structure match parsing characteristic attribute, and according to different emergency cases,
Judge the threat types and threat level of emergency case, feed back to the local host of client.
The method of the present invention uses binary channels uploaded videos, by client and cloud server end respectively to magnanimity monitor video
Stream has carried out rational choice and division, and compression packing after the foreground features extraction in key frame is only uploaded cloud clothes by client
It is engaged in device end, the package feature packet very little of upload, uploading response process and almost carrying out in real time, solve prior art well
In because magnanimity monitor video is placed on local host processing and judges, the asking of can not ensureing of the degree of accuracy for making processing speed and judging
Topic.The method of the present invention make it that the monitor video in different scenes can be transmitted accurately rapidly, can be at the very first time
Reason, reach the purpose of the monitoring and early warning to emergency case.