Specific embodiment
In order to which technical solution and the advantage of the application is more clearly understood, below in conjunction with attached drawing to the exemplary of the application
Embodiment is described in more detail, it is clear that and described embodiment is only a part of the embodiment of the application, rather than
The exhaustion of all embodiments.And in the absence of conflict, the feature in the embodiment and embodiment in this explanation can be mutual
It combines.
Inventor during invention note that
Existing action identification method is realized based on color image (namely RGB image), is known according to pixel variation
It does not move work.When in camera lens picture there are two or more than two people overlap when, cannot be distinguished is specifically which people generates
Abnormal operation;Moreover, according to pixel variation come identification maneuver when, be easy to be affected by other factors, for example, people is worn the clothes
Color, decorative pattern of clothes etc., especially when the person wears pattern clothes, as long as people more slightly acts, the pixel of RGB image will
It varies widely, so as to cause erroneous judgement, detection accuracy is lower.
In view of the above deficiencies, the embodiment of the present application proposes a kind of abnormal operation detection method and device, is said below
It is bright.
Fig. 1 shows the flow diagram that abnormal operation detection method is implemented in the embodiment of the present application, as shown, described
Abnormal operation detection method may include steps of:
Step 101 detects foreground object in monitor video according to depth information;
Step 102, the depth difference for calculating the foreground object between consecutive frame, obtain depth difference image;
Wherein, the depth difference image reflects the movement of the foreground object at a time;
Step 103 calculates the depth difference image of continuous multiple frames, obtains depth of cure difference image;
Wherein, the depth of cure difference image reflects the movement of the foreground object in a certain period of time;
Step 104 calculates histograms of oriented gradients (HOG, Histogram of according to the depth of cure difference image
Oriented Gradient) feature;
Wherein, the HOG feature represents the movement vector of the foreground object;
Step 105, support vector machines (SVM, the Support Vector by training abnormal operation in advance
Machine) classifier predicts the corresponding abnormal operation of the HOG feature, whether determines the foreground object according to prediction result
The abnormal operation occurs.
Wherein, foreground object can be people, animal or other specified monitored object.
In the specific implementation, it can use background model in the embodiment of the present application to set the depth value of non-foreground object position
It is set to infinity, to further decrease interference or inconvenient brought by non-foreground object.
The scheme as provided by the embodiment of the present application is to rely on depth map (that is, the monitoring with depth information regards
Each frame image in frequency) and human testing and tracking on depth map, it can very accurately will be in picture according to depth information
It is separated at same position apart from the far and near different foreground object of camera lens, it therefore, being capable of each prospect in accurate judgement scene
Whether object has abnormal operation.Moreover, because only showing the depth information of each point on depth map, motion detection is by depth
The variation of information, rather than pixel is relied on to change, therefore, using scheme provided by the embodiment of the present application, pattern and pure color exist
Without too many difference in depth map, a large amount of redundancy is eliminated compared with prior art, and then further improves detection essence
Degree.
Further, in order to solve that monitoring scene is more complicated or picture in foreground object it is more when caused detection it is quasi-
The not high problem of exactness, can also implement in the following manner.
In implementation, when in monitor video including N number of foreground object, after step 101, before step 102, the side
Method can further include:
The monitor video is divided into N number of independent deep video according to each foreground object, in the deep video
Continuous action including each foreground object;
The monitor video is divided into several independent depth to regard by the method described according to each foreground object
After frequency, it is specifically as follows:
Step 102 is executed to step 105 to the deep video of each foreground object.
In the embodiment of the present application, for one section of video, foreground object all in video can be detected first, it is assumed that
Foreground object is behaved, everyone deep video is split, and forms the independent deep video of several segments, each section of depth view
Only occur the series of actions of a people in frequency, successive depths difference calculating is carried out for the deep video of different people, it can
To be more clear, conveniently and accurately detect.
It is described that the monitor video is divided by several independent deep videos according to each foreground object in implementation,
It is specifically as follows:
Determine the depth location of foreground object;
Fill (Flood fill) method by the depth location by unrestrained water, infection within a preset range with it is described
The adjacent point of depth location, foreground object described in monitor video is split, independent deep video is formed.
In specific implementation, it is assumed that foreground object is behaved, and can first be determined the head position of people, be passed through the prior art
In Flood fill method, since the position of head, search it is adjacent with head position within the scope of certain length
Point, and these points are infected, and will not then be infected apart from the distant point of this people, thus operate, finally can will
Foreground object is split.
In implementation, the depth difference for calculating the foreground object between consecutive frame obtains depth difference image, can be specific
Are as follows:
The position of centre of gravity of foreground object in every frame image is moved to picture centre, and will be before between consecutive frame image
Scape object is adjusted to after identical size, is calculated the depth difference of the foreground object between consecutive frame, is obtained depth difference image.
In the embodiment of the present application, the pretreatment that adjacent two field pictures are aligned and deform respectively can be grasped first
Make.For the prospect people of every picture, its position of centre of gravity is moved into center picture, and people is adjusted to same size, then
The depth difference between consecutive frame image is calculated again, is taken absolute value to result.
In implementation, the SVM classifier by training abnormal operation in advance predicts the corresponding exception of the HOG feature
Movement, determines whether the foreground object occurs the abnormal operation according to prediction result, can be with specifically:
The confidence level of movement is abnormal according to the HOG feature calculation of every section of successive frame and the foreground object, when described
Confidence level determines that the foreground object is abnormal movement when being greater than preset threshold.
In the embodiment of the present application, the depth of cure difference image generated for any one section can be by the depth of cure difference figure
The HOG feature of picture is transmitted to a preparatory trained SVM classifier, to predict that existing object is abnormal the confidence level of movement.
In specific implementation, the HOG feature that multistage successive frame obtains can also be carried out cumulative mean etc. to calculate, obtains accumulative confidence level
Afterwards, then by accumulative confidence level with preset threshold value it is compared, then determines that the object has occurred if it is greater than preset threshold
The movement.
For the ease of the implementation of the application, it is illustrated below with example.
Assuming that monitoring scene is bank self-help withdrawal business hall, since the personnel for handling self-help drawing money business in bank can
There can be the people portion that multiple, there are queuing phenomenas, before and after these people being lined up will appear in monitor video at this time in the same time
The case where dividing overlapping or subsequent people to be blocked by outrunner.
Monitor video first can be detected all people according to depth information by the embodiment of the present application, and everyone depth
Degree Video segmentation is opened, and independent deep video is formed.Assuming that tri- people of shared A, B, C of self-help drawing money business are handled, then just
Three independent deep videos can be formed, that is, the deep video of the deep video of the deep video of A, B, C.It is assumed that
Video is 90 frame videos (about 3 seconds or so).
After obtaining everyone independent deep video, background model can use by non-prospect people (such as automatic drawing
The objects such as machine or door) depth value of position is set as infinity, for the deep video of different people, can execute respectively following
Step.
The motion detection block diagram of foreground object in the embodiment of the present application is shown in Fig. 2, as shown, below with the different of A
It is illustrated for normal motion detection.
(1) the depth difference image of consecutive frame is calculated
The position of centre of gravity of A in connected two field pictures is moved on into center picture first and is adjusted to same size, calculates two frames
Depth difference between image simultaneously takes absolute value to result, obtains depth difference image.Depth difference image reflects A at a time
Motion state.
Such as:
The frame image of 1st frame and the 2nd frame obtains the 1st depth difference image;
The frame image of 2nd frame and the 3rd frame obtains the 2nd depth difference image;
…
The frame image of 89th frame and the 90th frame obtains the 89th depth difference image.
In specific implementation, each depth difference image can carry out the aobvious of different depth colors according to depth difference size
Show, for example, movement by a relatively large margin can occur for arm when A fastens the neck of B suddenly, causes depth information that larger change occurs
Change, at this moment, can be by the arm of A with black or red display, and other body parts of A then can be with gray display.
(2) the depth of cure difference image of successive frame is calculated
Continuous 15 depth difference image additions are averaged, available depth of cure difference image, to reflect that A exists
Action state in a period of time.
Such as:
1st to the 15th depth difference image addition is averaged, the 1st depth of cure difference image is obtained;
2nd to the 16th depth difference image addition is averaged, the 2nd depth of cure difference image is obtained;
…
75th to the 89th depth difference image addition is averaged, the 75th depth of cure difference image is obtained.
In specific implementation, depth of cure difference image can also be obtained using other calculations, be not limited in
Be added the calculation that is averaged, the application to this with no restriction.
It, can also be by any one frame depth difference image and 15 frame behind for any one frame depth difference image in video
Image regeneration is also possible to carry out continuous 20 frame to polymerize etc. at depth of cure difference image, which frame is the application carry out
The frame number for polymerizeing and being polymerize is with no restriction.
(3) HOG feature is extracted to depth of cure difference image
The quantization vector that the HOG feature of depth of cure difference image represents current action indicates, in specific implementation, can be with
Using the area of space of 8*8, and the frequency histogram in 32 directions is counted, specific HOG characteristic quantification can use existing skill
Mode in art, this will not be repeated here.
(4) the corresponding movement of HOG feature is predicted by SVM classifier
For the depth of cure difference image that any one section of video generates, its HOG feature can be transmitted to one and trained in advance
SVM classifier, predict A occur specific action confidence level S1, S2 ... Sn.
SVM classifier can train a lot of to act in advance, individually carry out predicted operation.It can train and better recognize in advance
To be the movement of act of violence, such as the neck that fastens, head of fiercelying attack etc., it can also train in advance and better be considered emergency behavior
Movement, such as wave, wave can also to be further subdivided into that left hand is brandished, the right hand is brandished, two hands intersections are brandished or two
Hand is swung in the same direction.The application for which movement be abnormal operation with no restriction.
(5) judge whether accumulative confidence level is more than preset threshold
The embodiment of the present application can add up the confidence level of the above-mentioned each HOG feature being calculated, and will finally tire out
Confidence level and preset threshold value comparison are counted, when accumulative confidence level is greater than preset threshold value, then judges current event
Occur.
Above-mentioned (1) to (5) step is executed to B, C respectively, whether available B is abnormal movement, whether C is abnormal
The testing result of movement.
Such as: the HOG feature of A is predicted, finds the dynamic of other people necks that fasten in the HOG feature and SVM classifier of A
The confidence level of work is higher, then it is assumed that violent action has occurred in A;
The HOG feature of B is predicted, find the confidence level of movement waved in the HOG feature and SVM classifier of B compared with
It is high, then it is assumed that emergency movement has occurred in B.
In the embodiment of the present application, different movement (corresponding different event, such as violence and emergency) can individually be sentenced
It is disconnected, and the threshold value set is also possible to different, the application sets with no restriction the specific of threshold value.
The embodiment of the present application can judge violence and emergency movement based on deep video, relative in traditional rgb video
It violence and waves to detect, the violence and emergency in detection frame out that scheme provided by the embodiment of the present application can be more accurate
Movement;Moreover, the embodiment of the present application can not only detect violence and emergency event in video, additionally it is possible to orient violence and
The specific location and specific people that emergency event occurs.
Based on the same inventive concept, a kind of abnormal operation detection device is additionally provided in the embodiment of the present application, due to these
The principle that equipment solves the problems, such as is similar to a kind of abnormal operation detection method, therefore the implementation of these equipment may refer to method
Implement, overlaps will not be repeated.
Fig. 3 shows the structural schematic diagram of abnormal operation detection device in the embodiment of the present application, as shown, abnormal operation
Detection device may include:
Detection module 301, for detecting the foreground object in monitor video according to depth information;
Depth difference computing module 302 obtains depth difference figure for calculating the depth difference of the foreground object between consecutive frame
Picture;
Depth of cure difference computing module 303 calculates for the depth difference image to continuous multiple frames, obtains depth of cure
Difference image;
HOG feature calculation module 304, it is special for calculating histograms of oriented gradients HOG according to the depth of cure difference image
Sign;
Determining module 305 predicts that the HOG feature is corresponding for the SVM classifier by training abnormal operation in advance
Abnormal operation, determine whether the foreground object occurs the abnormal operation according to prediction result.
In implementation, described device be may further include:
Divide module, for when in monitor video including N number of foreground object, according to each foreground object by the monitoring
Video segmentation includes the continuous action of each foreground object at N number of independent deep video, in the deep video;
Loop module calculates mould for the deep video of each foreground object to be sequentially inputted to the depth difference
Block, depth of cure difference computing module, HOG feature calculation module and determining module.
In implementation, the segmentation module is specifically used for determining the depth location of foreground object;Pass through Flood fill method
By the depth location, point adjacent with the depth location within a preset range is infected, before described in monitor video
Scape Object Segmentation comes out, and forms independent deep video;Wherein, continuous dynamic including the foreground object in the deep video
Make.
In implementation, the depth difference computing module is specifically used for translating the position of centre of gravity of the foreground object in every frame image
To picture centre, and after the foreground object between consecutive frame image is adjusted to identical size, calculate described between consecutive frame
The depth difference of foreground object obtains depth difference image.
In implementation, the determining module is specifically used for HOG feature calculation and the foreground object according to every section of successive frame
It is abnormal the confidence level of movement, determines that the foreground object is abnormal movement when the confidence level is greater than preset threshold.
For convenience of description, each section of apparatus described above is divided into various modules with function or unit describes respectively.
Certainly, each module or the function of unit can be realized in same or multiple softwares or hardware when implementing the application.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the application, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
The application is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present application
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although the preferred embodiment of the application has been described, it is created once a person skilled in the art knows basic
Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as
It selects embodiment and falls into all change and modification of the application range.