Embodiment
In order to the technical scheme and advantage that make the application are clearly understood, be described in more detail below in conjunction with the exemplary embodiment of accompanying drawing to the application, obviously, described embodiment is only a part of embodiment of the application, instead of all embodiments is exhaustive.And when not conflicting, the embodiment in this explanation and the feature in embodiment can be combined with each other.
Inventor notices in invention process:
Existing action identification method realizes based on colour picture (being also RGB image), carrys out identification maneuver according to pixel change.When there being two or more people to overlap in camera lens picture, specifically which people cannot being distinguished and create abnormal operation; And, when carrying out identification maneuver according to pixel change, easily be subject to the impact of other factors, such as, people institute habited color, decorative pattern etc., particularly when people wears pattern clothes, as long as people is action more slightly, will be there is larger change in the pixel of RGB image, thus cause erroneous judgement, and accuracy of detection is lower.
For above-mentioned deficiency, the embodiment of the present application proposes a kind of abnormal operation detection method and device, is described below.
Fig. 1 shows the schematic flow sheet that in the embodiment of the present application, abnormal operation detection method is implemented, and as shown in the figure, described abnormal operation detection method can comprise the steps:
Step 101, the foreground object detected according to depth information in monitor video;
Between step 102, calculating consecutive frame, the depth difference of described foreground object, obtains depth difference image;
Wherein, described depth difference image reflects the action at a time of described foreground object;
Step 103, the depth difference image of continuous multiple frames to be calculated, obtain depth of cure difference image;
Wherein, described depth of cure difference image reflects the action of described foreground object in section sometime;
Step 104, according to described depth of cure difference image calculated direction histogram of gradients (HOG, Histogramof Oriented Gradient) feature;
Wherein, described HOG feature represents the action vector of described foreground object;
Step 105, support vector machine (SVM by the good abnormal operation of training in advance, Support VectorMachine) sorter predicts the abnormal operation that described HOG feature is corresponding, determines whether described foreground object described abnormal operation occurs according to predicting the outcome.
Wherein, foreground object can be people, animal or other monitored object of specifying.
In the specific implementation, in the embodiment of the present application, can utilize background model that the depth value of non-foreground object position is set to infinite distance, thus reduce further interference that non-foreground object brings or operation inconvenience.
The scheme provided due to the embodiment of the present application relies on depth map (to be also, there is each two field picture in the monitor video of depth information) and depth map on human detection and tracking, according to depth information is very accurate, the same position place far and near different foreground object of distance camera lens in picture can be separated, therefore, it is possible to accurately judge in scene, whether each foreground object has abnormal operation.And, owing to depth map only showing the depth information of each point, motion detection is the change relying on depth information, instead of rely on pixel change, therefore, adopt the scheme that the embodiment of the present application provides, pattern and pure color do not have too many difference in depth map, eliminate a large amount of redundant informations compared to existing technology, and then further increase accuracy of detection.
Further, in order to solve the not high problem of the accuracy in detection that causes when foreground object is more in monitoring scene more complicated or picture, can also implement in the following manner.
In enforcement, when monitor video comprises N number of foreground object, after step 101, before step 102, described method can further include:
According to each foreground object, described monitor video is divided into N number of independently deep video, described deep video comprises the continuous action of each foreground object;
Described monitor video to be divided into several independently after deep video described by described method according to each foreground object, be specifically as follows:
Step 102 is performed to step 105 to the deep video of each foreground object.
In the embodiment of the present application, for one section of video, can first detect foreground object all in video, suppose that foreground object is behaved, everyone deep video is split, forms some sections of independently deep videos, in each section of deep video, only occur the series of actions of a people, deep video for different people carries out step such as successive depths difference calculatings etc., can more clear, facilitate and detect exactly.
In enforcement, describedly according to each foreground object, described monitor video is divided into several independently deep videos, is specifically as follows:
Determine the depth location of foreground object;
Fill (Flood fill) method by described depth location by unrestrained water, infect point adjacent with described depth location in preset range, foreground object described in monitor video is split, forms independently deep video.
In concrete enforcement, suppose that foreground object is behaved, first can determine the head position of people, by Flood fill method of the prior art, from head position, search point adjacent with head position within the scope of certain length, and these points are infected, the point distant apart from this people then can not be infected, operates thus, finally just foreground object can be split.
In enforcement, between described calculating consecutive frame, the depth difference of described foreground object, obtains depth difference image, can be specially:
The centre of gravity place of the foreground object in every two field picture is moved to picture centre, and after the foreground object between consecutive frame image is adjusted to same size, calculates the depth difference of described foreground object between consecutive frame, obtain depth difference image.
In the embodiment of the present application, can first to the pretreatment operation that two adjacent two field pictures align respectively and are out of shape.For the prospect people of every pictures, its centre of gravity place is moved to center picture, and people is adjusted to same size, and then calculate the depth difference between consecutive frame image, result is taken absolute value.
In enforcement, the described SVM classifier by the good abnormal operation of training in advance predicts the abnormal operation that described HOG feature is corresponding, determining whether described foreground object described abnormal operation occurs, can be specially according to predicting the outcome:
According to the HOG feature calculation of every section of successive frame and the degree of confidence of described foreground object generation abnormal operation, determine described foreground object generation abnormal operation when described degree of confidence is greater than predetermined threshold value.
In the embodiment of the present application, for any one section of depth of cure difference image generated, the HOG feature of this depth of cure difference image can be passed to the good SVM classifier of a training in advance, predict the degree of confidence of existing object generation abnormal operation.In concrete enforcement, the HOG feature that multistage successive frame can also be obtained carries out the calculating such as progressive mean, after obtaining accumulative degree of confidence, more accumulative degree of confidence and the threshold value preset are compared, if be greater than predetermined threshold value, determine that this object there occurs this action.
For the ease of the enforcement of the application, be described with example below.
Suppose that monitoring scene is that bank self-help is withdrawn the money business hall, due to the personnel handling self-help drawing money business in bank may have at one time multiple, there is queuing phenomena, the people before and after the people that now these are queued up in monitor video there will be partly overlap or people below by outrunner the situation of blocking.
Monitor video first can be detected all people according to depth information by the embodiment of the present application, and everyone deep video is separated, and forms independently deep video.Suppose total A, B, C tri-people handling self-help drawing money business, so just can form three independently deep videos, also, the deep video of the deep video of A, the deep video of B, C.Here suppose that video is 90 frame videos (about about 3 seconds).
Obtaining everyone independently after deep video, can utilize background model that the depth value of non-prospect people (as the object such as ATM (automatic teller machine) or door) position is set to infinite distance, for the deep video of different people, following steps can be performed respectively.
The motion detection block diagram of foreground object in the embodiment of the present application is shown in Fig. 2, as shown in the figure, has been detected as example with the abnormal operation of A below and is described.
(1) the depth difference image of consecutive frame is calculated
First the centre of gravity place of A in two two field pictures that are connected moved on to center picture and is adjusted to same size, calculate the depth difference between two two field pictures and result is taken absolute value, obtaining depth difference image.Depth difference image reflects A motion state at a time.
Such as:
The two field picture of the 1st frame and the 2nd frame obtains the 1st depth difference image;
The two field picture of the 2nd frame and the 3rd frame obtains the 2nd depth difference image;
…
The two field picture of the 89th frame and the 90th frame obtains the 89th depth difference image.
In concrete enforcement, each depth difference image can carry out the display of different depth color according to degree of depth difference size, such as, when A fastens suddenly the neck of B, can be there is action by a relatively large margin in arm, cause depth information that larger change occurs, at this moment, can by the arm of A with black or red display, other body parts of A then can show with grey.
(2) the depth of cure difference image of successive frame is calculated
Continuous print 15 depth difference image additions are averaged, depth of cure difference image can be obtained, thus reflect the operating state of A within a period of time.
Such as:
1st to the 15th depth difference image addition is averaged, obtains the 1st depth of cure difference image;
2nd to the 16th depth difference image addition is averaged, obtains the 2nd depth of cure difference image;
…
75th to the 89th depth difference image addition is averaged, obtains the 75th depth of cure difference image.
In concrete enforcement, other account form can also be adopted to obtain depth of cure difference image, be not limited in the account form being added and being averaged, the application is not restricted this.
For any frame depth difference image in video, can also by 15 two field picture regeneration depth of cure difference images after any frame depth difference image and its, also can be carried out being polymerized etc. by continuous print 20 frame, the application be all restricted the frame number which frame is polymerized and is polymerized.
(3) HOG feature is extracted to depth of cure difference image
The HOG feature of depth of cure difference image represents the quantification vector representation of current action, in concrete enforcement, the area of space of 8*8 can be used, and add up the frequency histogram in 32 directions, concrete HOG characteristic quantification can adopt mode of the prior art, does not repeat at this.
(4) predict by SVM classifier the action that HOG feature is corresponding
For the depth of cure difference image that any one section of video generates, its HOG feature the good SVM classifier of a training in advance be can be passed to, specific action occurs A degree of confidence S1, S2 ... Sn doped.
SVM classifier can the action of training in advance a lot of, carries out predicted operation separately.Can the better action thinking act of violence of training in advance, such as fasten neck, head etc. of fiercelying attack, can also the better action thinking emergency behavior of training in advance, such as wave, wave to be further subdivided into that left hand is brandished, the right hand is brandished, two hands intersect and to brandish or two hands swing in the same way.The application is that abnormal operation is not restricted for which action.
(5) judge whether accumulative degree of confidence exceedes predetermined threshold value
The embodiment of the present application can add up the degree of confidence of the above-mentioned each HOG feature calculated, and the most accumulative degree of confidence compares with the threshold value preset, when accumulative degree of confidence is greater than the threshold value preset, then judges that current event occurs.
Respectively above-mentioned (1) to (5) step is performed to B, C, the testing result that whether B abnormal operation occurs, whether C abnormal operation occurs can be obtained.
Such as: predict the HOG feature of A, the degree of confidence of the action of other people neck that finds to fasten in the HOG feature of A and SVM classifier is higher, then think that A there occurs violent action;
The HOG feature of B is predicted, finds that the degree of confidence of the action of waving in the HOG feature of B and SVM classifier is higher, then think that B there occurs emergency action.
In the embodiment of the present application, different actions (corresponding different events, such as violence and emergency) can judge separately, and the threshold value of setting also can be different, and the application is not restricted for the concrete setting of threshold value.
The embodiment of the present application can judge violence and emergency action based on deep video, and relative to the violence in traditional rgb video with wave to detect, the scheme that the embodiment of the present application provides can detect violence in picture and action of crying for help more accurately; And the embodiment of the present application can not only detect violence in video and emergency event, particular location and concrete people that violence and emergency event occur can also be oriented.
Based on same inventive concept, a kind of abnormal operation detection device is additionally provided in the embodiment of the present application, the principle of dealing with problems due to these equipment is similar to a kind of abnormal operation detection method, and therefore the enforcement of these equipment see the enforcement of method, can repeat part and repeat no more.
Fig. 3 shows the structural representation of abnormal operation detection device in the embodiment of the present application, and as shown in the figure, abnormal operation detection device can comprise:
Detection module 301, for detecting the foreground object in monitor video according to depth information;
Depth difference computing module 302, for calculating the depth difference of described foreground object between consecutive frame, obtains depth difference image;
Depth of cure difference computing module 303, for calculating the depth difference image of continuous multiple frames, obtains depth of cure difference image;
HOG feature calculation module 304, for according to described depth of cure difference image calculated direction histogram of gradients HOG feature;
According to predicting the outcome, determination module 305, for predicting by the SVM classifier of the good abnormal operation of training in advance the abnormal operation that described HOG feature is corresponding, determines whether described foreground object described abnormal operation occurs.
In enforcement, described device may further include:
Segmentation module, for when monitor video comprises N number of foreground object, according to each foreground object, described monitor video is divided into N number of independently deep video, described deep video comprises the continuous action of each foreground object;
Loop module, for being input to described depth difference computing module, depth of cure difference computing module, HOG feature calculation module and determination module successively by the deep video of described each foreground object.
In enforcement, described segmentation module is specifically for determining the depth location of foreground object; By Flood fill method by described depth location, infect point adjacent with described depth location in preset range, foreground object described in monitor video is split, forms independently deep video; Wherein, described deep video comprises the continuous action of described foreground object.
In enforcement, described depth difference computing module is specifically for moving to picture centre by the centre of gravity place of the foreground object in every two field picture, and after the foreground object between consecutive frame image is adjusted to same size, calculates the depth difference of described foreground object between consecutive frame, obtain depth difference image.
In enforcement, described determination module, specifically for according to the HOG feature calculation of every section of successive frame and the degree of confidence of described foreground object generation abnormal operation, determines described foreground object generation abnormal operation when described degree of confidence is greater than predetermined threshold value.
For convenience of description, each several part of the above device is divided into various module or unit to describe respectively with function.Certainly, the function of each module or unit can be realized in same or multiple software or hardware when implementing the application.
Those skilled in the art should understand, the embodiment of the application can be provided as method, system or computer program.Therefore, the application can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the application can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disk memory, CD-ROM, optical memory etc.) of computer usable program code.
The application describes with reference to according to the process flow diagram of the method for the embodiment of the present application, equipment (system) and computer program and/or block scheme.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block scheme and/or square frame and process flow diagram and/or block scheme and/or square frame.These computer program instructions can being provided to the processor of multi-purpose computer, special purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computing machine or other programmable data processing device produce device for realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be loaded in computing machine or other programmable data processing device, make on computing machine or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computing machine or other programmable devices is provided for the step realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
Although described the preferred embodiment of the application, those skilled in the art once obtain the basic creative concept of cicada, then can make other change and amendment to these embodiments.So claims are intended to be interpreted as comprising preferred embodiment and falling into all changes and the amendment of the application's scope.