CN108154090A - Face identification method and device - Google Patents
Face identification method and device Download PDFInfo
- Publication number
- CN108154090A CN108154090A CN201711310840.8A CN201711310840A CN108154090A CN 108154090 A CN108154090 A CN 108154090A CN 201711310840 A CN201711310840 A CN 201711310840A CN 108154090 A CN108154090 A CN 108154090A
- Authority
- CN
- China
- Prior art keywords
- flow velocity
- optical flow
- histogram
- face region
- spacing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/74—Image or video pattern matching; Proximity measures in feature spaces
- G06V10/75—Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
- G06V10/758—Involving statistics of pixels or of feature values, e.g. histogram matching
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/40—Spoof detection, e.g. liveness detection
- G06V40/45—Detection of the body part being alive
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Health & Medical Sciences (AREA)
- Human Computer Interaction (AREA)
- General Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Software Systems (AREA)
- Medical Informatics (AREA)
- Evolutionary Computation (AREA)
- Databases & Information Systems (AREA)
- Artificial Intelligence (AREA)
- Oral & Maxillofacial Surgery (AREA)
- Image Analysis (AREA)
Abstract
The disclosure is directed to face identification method and devices.This method includes:At least two field pictures for including face to be detected are obtained, the intensive light stream figure of the optical flow velocity value for each pixel for including any frame image in two field pictures is obtained according at least two field pictures;N number of human face region optical flow velocity histogram and N number of non-face region optical flow velocity histogram are determined according to the optical flow velocity value of each pixel;The average distance between human face region optical flow velocity histogram and non-face region optical flow velocity histogram is obtained according to N number of human face region optical flow velocity histogram and N number of non-face region optical flow velocity histogram and the corresponding preset weights of each histogram spacing;When detecting that average distance is less than pre-determined distance threshold value, it is prosthese face to determine face to be detected.The average distance value of calculating can be more accurate, improves the accuracy of recognition of face.
Description
Technical field
This disclosure relates to image identification technical field more particularly to face identification method and device.
Background technology
With the development of science and technology, information security has become the biology spy such as the problem of increasingly paying close attention to and fingerprint, iris
Sign is compared, since facial image is very easy to obtain, recognition of face is increasingly used in identity discriminating.
At present, recognition of face is mainly by a variety of apparatus and systems such as laptop, mobile terminal and gate inhibition
System etc. obtains video to be detected, and is differentiated by detecting the face in video to be detected to complete identity.But by be detected
Face in video is completed in the mechanism of the identification to identity, since facial image is very easy to obtain (for example, in target person
Mobile phone photograph is carried out under the conditions of object is unwitting), therefore the attack of face prosthese can often occur, that is, the target of printing is used
Photograph print is directed at taking lens as attack tool by the human face photo at family, at this point, to be detected regarding of getting of taking lens
The facial image of target user will be included in frequency, so as to complete the identification of identity by recognition of face.In this way, it will reduce
The accuracy of recognition of face, so that the safety of user information is relatively low.
Invention content
To overcome the problems in correlation technique, the embodiment of the present disclosure provides face identification method and device.The skill
Art scheme is as follows:
According to the embodiment of the present disclosure in a first aspect, provide a kind of face identification method, including:
Obtain at least two field pictures for including face to be detected;
Intensive light stream figure is obtained according at least two field pictures, the intensive light stream figure is included in the two field pictures
The optical flow velocity value of each pixel of any frame image;
N number of human face region optical flow velocity histogram and N number of non-face is determined according to the optical flow velocity value of each pixel
Region optical flow velocity histogram;Wherein, the histogram spacing of each human face region optical flow velocity histogram is different, Ge Gesuo
The histogram spacing for stating non-face region optical flow velocity histogram is different;The N is the integer more than or equal to 2;
According to N number of human face region optical flow velocity histogram and N number of non-face region optical flow velocity histogram with
And the corresponding preset weights of each histogram spacing obtain human face region optical flow velocity histogram and non-face region optical flow velocity
Average distance between histogram;
When detecting that the average distance is less than pre-determined distance threshold value, it is prosthese face to determine the face to be detected.
The technical scheme provided by this disclosed embodiment can include the following benefits:It obtains comprising face to be detected
At least two field pictures obtain intensive light stream figure according at least two field pictures, and intensive light stream figure includes any frame in two field pictures
The optical flow velocity value of each pixel of image;Determine that N number of human face region optical flow velocity is straight according to the optical flow velocity value of each pixel
Side's figure and N number of non-face region optical flow velocity histogram;Wherein, the histogram spacing of each human face region optical flow velocity histogram
Difference, the histogram spacing of each non-face region optical flow velocity histogram are different;N is the integer more than or equal to 2;According to N number of
Human face region optical flow velocity histogram and N number of non-face region optical flow velocity histogram and each histogram spacing are corresponding pre-
If weights obtain the average distance between human face region optical flow velocity histogram and non-face region optical flow velocity histogram;Work as inspection
When measuring average distance less than pre-determined distance threshold value, it is prosthese face to determine face to be detected.It can be made by above-mentioned method
The distance value that must be calculated can be more accurate, and then improves the accuracy of recognition of face.
In one embodiment, the optical flow velocity value according to each pixel determines that N number of human face region optical flow velocity is straight
Side's figure and N number of non-face region optical flow velocity histogram, including:
Obtain the minimum light velocity value in the optical flow velocity value of each pixel;
Determine first histogram spacing of the minimum light velocity value for the 1st face area light stream velocity histogram;
It is adjacent previous face area according to the first histogram spacing of the latter human face region optical flow velocity histogram
The preset multiple of first histogram spacing of domain optical flow velocity histogram determines each face area light stream velocity histogram
First histogram spacing;
N-th of face is determined according to the corresponding first histogram spacing of n-th of human face region optical flow velocity histogram
Each first optical flow velocity value section in the optical flow velocity histogram of region, the n take 1,2 ... N successively;
To each first optical flow velocity value section, in the optical flow velocity value for obtaining each pixel in the human face region
It is contained in first pixel quantity in the first optical flow velocity value section;
According to each first optical flow velocity value section and each first optical flow velocity value section corresponding first
Pixel quantity determines N number of human face region optical flow velocity histogram;
Determine the minimum light velocity value between the second histogram of the 1st non-face region optical flow velocity histogram
Away from;
It is adjacent previous inhuman according to the second histogram spacing of the non-face region optical flow velocity histogram of the latter
The preset multiple of second histogram spacing of face region optical flow velocity histogram determines each non-face area light flow velocity
Spend the second histogram spacing of histogram;
According to the corresponding second histogram spacing of n-th of non-face region optical flow velocity histogram determine described n-th it is non-
Each second optical flow velocity value section in human face region optical flow velocity histogram, the n take 1,2 ... N successively;
To each second optical flow velocity value section, the optical flow velocity value of each pixel in the non-face region is obtained
In be contained in second pixel quantity in the second optical flow velocity value section;
According to each second optical flow velocity value section and each second optical flow velocity value section corresponding second
Pixel quantity determines N number of non-face region optical flow velocity histogram.
In one embodiment, it is described according to N number of human face region optical flow velocity histogram and N number of non-face area
Domain optical flow velocity histogram and the corresponding preset weights of each histogram spacing obtain human face region optical flow velocity histogram and
Average distance between non-face region optical flow velocity histogram, including:
The new matched pixel quantity in i-th pair optical flow velocity histogram is obtained, wherein, the i takes 1,2 ... N successively;It is described
I-th pair optical flow velocity histogram includes a face area light stream velocity histogram and a non-face region optical flow velocity is straight
Fang Tu, and the corresponding first histogram spacing of the human face region optical flow velocity histogram and the non-face region optical flow velocity
The corresponding second histogram spacing of histogram is identical;
It is straight according to the corresponding preset weights of histogram spacing of every a pair of of optical flow velocity histogram and every a pair of of optical flow velocity
New matched pixel quantity in square figure obtain human face region optical flow velocity histogram and non-face region optical flow velocity histogram it
Between average distance.
In one embodiment, the new matched pixel quantity obtained in i-th pair optical flow velocity histogram, including:
It obtains in the matched pixel quantity and the i-th pair optical flow velocity histogram in (i-1)-th pair of optical flow velocity histogram
Matched pixel quantity;
Determine the matched pixel quantity in the i-th pair optical flow velocity histogram and (i-1)-th pair of optical flow velocity Nogata
The difference of matched pixel quantity in figure is the new matched pixel quantity in the i-th pair optical flow velocity histogram.
In one embodiment, the matched pixel quantity obtained in i-th pair optical flow velocity histogram, including:
Obtain j-th of first light in the human face region optical flow velocity histogram in the i-th pair optical flow velocity histogram
The corresponding third pixel value of velocity value interzone spacing;
Obtain j-th second in the non-face region optical flow velocity histogram in the i-th pair optical flow velocity histogram
Corresponding 4th pixel value of optical flow velocity value interzone spacing, wherein, the j takes 1,2 ... M successively;The M is the i-th pair light
The quantity of the first optical flow velocity value interzone spacing in the human face region optical flow velocity histogram in velocity histogram is flowed, alternatively,
The M is the second optical flow velocity value in the non-face region optical flow velocity histogram in the i-th pair optical flow velocity histogram
The quantity of interzone spacing, and the M is the integer more than or equal to 1;
Determine the corresponding third pixel value of j-th of first optical flow velocity value interzone spacings and j-th of second light
Minimum value in 4th pixel value of velocity value interzone spacing;
Determine that the sum of corresponding minimum value of each optical flow velocity value interzone spacing is in the i-th pair optical flow velocity histogram
Matched pixel quantity in the i-th pair optical flow velocity histogram.
In one embodiment, the preset weights of (i-1)-th pair of optical flow velocity histogram are more than i-th pair light stream speed
Spend the preset weights of histogram.
At least two field pictures of the face to be detected are:The adjacent two field pictures of the face to be detected.
The method further includes:
When detecting that the average distance is greater than or equal to the pre-determined distance threshold value, determine that the face to be detected is
Living body faces.
According to the second aspect of the embodiment of the present disclosure, a kind of face identification device is provided, including:
First acquisition module, for obtaining at least two field pictures for including face to be detected;
Second acquisition module obtains intensive light for at least two field pictures according to first acquisition module acquisition
Flow graph, the intensive light stream figure include the optical flow velocity value of each pixel of any frame image in the two field pictures;
First determining module, the optical flow velocity value of each pixel for being obtained according to second acquisition module are true
Fixed N number of human face region optical flow velocity histogram and N number of non-face region optical flow velocity histogram;Wherein, each human face region light
The histogram spacing for flowing velocity histogram is different, and the histogram spacing of each non-face region optical flow velocity histogram is different;Institute
It is the integer more than or equal to 2 to state N;
Third acquisition module is straight for N number of human face region optical flow velocity for being determined according to first determining module
Scheme preset weights corresponding with N number of non-face region optical flow velocity histogram and each histogram spacing and obtain face in side
Average distance between region optical flow velocity histogram and non-face region optical flow velocity histogram;
Detection module, for detecting the human face region optical flow velocity histogram that the third acquisition module obtains and non-
Whether the average distance between human face region optical flow velocity histogram is less than pre-determined distance threshold value;
Second determining module detects that the average distance is less than the pre-determined distance threshold value for working as the detection module
When, it is prosthese face to determine the face to be detected.
In one embodiment, first determining module includes:First acquisition submodule, the first determination sub-module,
Two determination sub-modules, third determination sub-module, the second acquisition submodule, the 4th determination sub-module, the 5th determination sub-module, the 6th
Determination sub-module, the 7th determination sub-module, third acquisition submodule and the 8th determination sub-module;
First acquisition submodule, for obtaining the optical flow velocity value for each pixel that second acquisition module obtains
In minimum light velocity value;
First determination sub-module, for determining the minimum light velocity value of the first acquisition submodule acquisition
The first histogram spacing for the 1st face area light stream velocity histogram;
Second determination sub-module, between the first histogram according to the latter human face region optical flow velocity histogram
Preset multiple away from the first histogram spacing for adjacent previous human face region optical flow velocity histogram, determines everyone
First histogram spacing of face region optical flow velocity histogram;
The third determination sub-module, for according to corresponding first Nogata of n-th of human face region optical flow velocity histogram
Figure spacing determines each first optical flow velocity value section in n-th of human face region optical flow velocity histogram, and the n is successively
Take 1,2 ... N;
Second acquisition submodule, for each first optical flow velocity determined to the third determination sub-module
It is worth section, obtains and the first optical flow velocity value section is contained in the optical flow velocity value of each pixel in the human face region
First pixel quantity;
4th determination sub-module, for according to each first optical flow velocity value section and each first light
Corresponding first pixel quantity in velocity value section determines N number of human face region optical flow velocity histogram;
5th determination sub-module, for determining the minimum light velocity value of the first acquisition submodule acquisition
The second histogram spacing for the 1st non-face region optical flow velocity histogram;
6th determination sub-module, for the second histogram according to the non-face region optical flow velocity histogram of the latter
The preset multiple of the spacing for the second histogram spacing of adjacent previous non-face region optical flow velocity histogram, determines
Second histogram spacing of each non-face region optical flow velocity histogram;
7th determination sub-module, for corresponding second straight according to n-th of non-face region optical flow velocity histogram
Square figure spacing determines each second optical flow velocity value section in described n-th non-face region optical flow velocity histogram, the n
1,2 ... N are taken successively;
The third acquisition submodule, for each second optical flow velocity determined to the 7th determination sub-module
It is worth section, obtains in the non-face region and be contained in the second optical flow velocity value section in the optical flow velocity value of each pixel
The second pixel quantity;
8th determination sub-module, for according to each second optical flow velocity value section and each second light
Corresponding second pixel quantity in velocity value section determines N number of non-face region optical flow velocity histogram.
In one embodiment, the third acquisition module includes:4th acquisition submodule and the 5th acquisition submodule;
4th acquisition submodule, for obtaining the new matched pixel quantity in i-th pair optical flow velocity histogram,
In, the i takes 1,2 ... N successively;The i-th pair optical flow velocity histogram includes a face area light stream velocity histogram
With a non-face region optical flow velocity histogram, and between corresponding first histogram of the human face region optical flow velocity histogram
It is identical away from the second histogram spacing corresponding with the non-face region optical flow velocity histogram;
5th acquisition submodule, for corresponding default according to the histogram spacing per a pair of of optical flow velocity histogram
What weights and the 4th acquisition submodule obtained obtains face per the new matched pixel quantity in a pair of of optical flow velocity histogram
Average distance between region optical flow velocity histogram and non-face region optical flow velocity histogram.
In one embodiment, the 4th acquisition submodule includes:6th acquisition submodule and the 9th determination sub-module;
6th acquisition submodule, for obtaining matched pixel quantity and the institute in (i-1)-th pair of optical flow velocity histogram
State the matched pixel quantity in i-th pair optical flow velocity histogram;
9th determination sub-module, for determining the i-th pair optical flow velocity of the 6th acquisition submodule acquisition
Matched pixel quantity and the difference of the matched pixel quantity in (i-1)-th pair of optical flow velocity histogram in histogram are described
New matched pixel quantity in i-th pair optical flow velocity histogram.
In one embodiment, the 6th acquisition submodule includes:7th acquisition submodule, the 8th acquisition submodule,
Tenth determination sub-module and the 11st determination sub-module;
7th acquisition submodule, for obtaining the speed of the human face region light stream in the i-th pair optical flow velocity histogram
Spend the corresponding third pixel value of j-th of first optical flow velocity value interzone spacings in histogram;
8th acquisition submodule, for obtaining the non-face region light stream in the i-th pair optical flow velocity histogram
Corresponding 4th pixel value of j-th of second optical flow velocity value interzone spacings in velocity histogram, wherein, the j takes 1 successively,
2…M;The M is the first optical flow velocity in the human face region optical flow velocity histogram in the i-th pair optical flow velocity histogram
It is worth the quantity of interzone spacing, alternatively, the M is straight for the non-face region optical flow velocity in the i-th pair optical flow velocity histogram
The quantity of the second optical flow velocity value interzone spacing in square figure, and the M is the integer more than or equal to 1;
Tenth determination sub-module, for determining the corresponding third of j-th of first optical flow velocity value interzone spacings
Minimum value in pixel value and the 4th pixel value of j-th of second optical flow velocity value interzone spacings;
11st determination sub-module, for determining each optical flow velocity value in the i-th pair optical flow velocity histogram
The sum of corresponding minimum value of interzone spacing is the matched pixel quantity in the i-th pair optical flow velocity histogram.
In one embodiment, the preset weights of (i-1)-th pair of optical flow velocity histogram are more than i-th pair light stream speed
Spend the preset weights of histogram.
In one embodiment, at least two field pictures of the face to be detected are:Adjacent the two of the face to be detected
Frame image.
In one embodiment, described device further includes:Third determining module;
The third determining module detects the average distance more than or equal to described pre- for working as the detection module
If during distance threshold, it is living body faces to determine the face to be detected.
According to the third aspect of the embodiment of the present disclosure, a kind of face identification device is provided, including:
Processor;
For storing the memory of processor-executable instruction;
Wherein, the processor is configured as:
Obtain at least two field pictures for including face to be detected;
Intensive light stream figure is obtained according at least two field pictures, the intensive light stream figure is included in the two field pictures
The optical flow velocity value of each pixel of any frame image;
N number of human face region optical flow velocity histogram and N number of non-face is determined according to the optical flow velocity value of each pixel
Region optical flow velocity histogram;Wherein, the histogram spacing of each human face region optical flow velocity histogram is different, Ge Gesuo
The histogram spacing for stating non-face region optical flow velocity histogram is different;The N is the integer more than or equal to 2;
According to N number of human face region optical flow velocity histogram and N number of non-face region optical flow velocity histogram with
And the corresponding preset weights of each histogram spacing obtain human face region optical flow velocity histogram and non-face region optical flow velocity
Average distance between histogram;
When detecting that the average distance is less than pre-determined distance threshold value, it is prosthese face to determine the face to be detected.
According to the fourth aspect of the embodiment of the present disclosure, a kind of computer readable storage medium is provided, is stored thereon with calculating
Machine instructs, and first aspect any one of them method and step is realized when which is executed by processor.
It should be understood that above general description and following detailed description are only exemplary and explanatory, not
The disclosure can be limited.
Description of the drawings
Attached drawing herein is incorporated into specification and forms the part of this specification, shows the implementation for meeting the disclosure
Example, and for explaining the principle of the disclosure together with specification.
Fig. 1 is the flow chart according to the face identification method shown in an exemplary embodiment one.
Fig. 2 is according to the histogram schematic diagram shown in an exemplary embodiment.
Fig. 3 is the flow chart according to the face identification method shown in an exemplary embodiment two.
Fig. 4 is the block diagram according to a kind of face identification device shown in an exemplary embodiment one.
Fig. 5 is the block diagram according to the first determining module 12 in a kind of face identification device shown in an exemplary embodiment.
Fig. 6 is the block diagram according to the second acquisition module 13 in a kind of face identification device shown in an exemplary embodiment.
Fig. 7 is the frame according to the 4th acquisition submodule 131 in a kind of face identification device shown in an exemplary embodiment
Figure.
Fig. 8 is the frame according to the 6th acquisition submodule 1311 in a kind of face identification device shown in an exemplary embodiment
Figure.
Fig. 9 is according to a kind of block diagram with face identification device shown in an exemplary embodiment two.
Figure 10 is according to a kind of block diagram with face identification device 80 shown in an exemplary embodiment.
Figure 11 is the block diagram according to a kind of device 90 for recognition of face shown in an exemplary embodiment.
Specific embodiment
Here exemplary embodiment will be illustrated in detail, example is illustrated in the accompanying drawings.Following description is related to
During attached drawing, unless otherwise indicated, the same numbers in different attached drawings represent the same or similar element.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistent with the disclosure.On the contrary, they be only with it is such as appended
The example of the consistent device and method of some aspects be described in detail in claims, the disclosure.
It is completed in the mechanism of the identification to identity by the face in video to be detected, if living body faces appear in
In the video of taking lens shooting, then the light stream of the speed of the pixel light stream of human face region and non-face (background) area pixel
Speed is different.The optical flow velocity of human face region is usually larger, the usual very little of optical flow velocity in non-face region.However,
If if prosthese face, as human face region with the optical flow velocity in non-face region is typically.So by comparing people
The statistical information of the optical flow velocity in face region and non-face region can attack prosthese and be identified.
It is worth noting that, embodiment of the disclosure provide a kind of face identification method can be applied to terminal device or
In server.Wherein, terminal device includes but not limited to:For mobile phone, tablet computer and intelligent wearable device etc..Server
The equipment that the offer for including but not limited to being provided and being used by recognition of face service provider calculates service, or by network
Operator provides the equipment for calculating service by the offer that recognition of face service provider uses.Illustrate the disclosure in order to clearer
Scheme, illustrated by executive agent of terminal device in following embodiment.
Fig. 1 is according to the flow chart of the face identification method shown in an exemplary embodiment one, as shown in Figure 1, this method
Include the following steps S101-S105:
In step S101, at least two field pictures for including face to be detected are obtained.
Exemplary, at least two field pictures of above-mentioned face to be detected are the adjacent two field pictures of face to be detected.
In step s 102, intensive light stream figure is obtained according at least two field pictures, intensive light stream figure is included in two field pictures
Any frame image each pixel optical flow velocity value.
Wherein, at least two field pictures of face to be detected can be to be engaged in first to be stored in terminal device to read in video
, or it is being taken by the filming apparatus on terminal device or receive other devices or system and send, the disclosure
The source of at least two field pictures containing face to be detected is not limited in embodiment.
Wherein, the optical flow velocity value of some pixel is used to indicate the pixel in adjacent two field pictures, by previous frame figure
As to the displacement distance between next frame image.
Previous frame image and current frame image in two field pictures can calculate intensive light stream figure, intensive light stream
Figure represents the size and Orientation of the movement velocity of each pixel in piece image.The fortune of pixel has only been used in the disclosure
The size (optical flow velocity value) of dynamic speed, directional information is not accounted for.Therefore it can be obtained from the intensive light stream figure every
The optical flow velocity value of one pixel.
In step s 103, N number of human face region optical flow velocity histogram and N are determined according to the optical flow velocity value of each pixel
A non-face region optical flow velocity histogram;Wherein, the histogram spacing of each human face region optical flow velocity histogram is different, respectively
The histogram spacing of a non-face region optical flow velocity histogram is different;N is the integer more than or equal to 2.
It is exemplary, it can be detected current by first carrying out recognition of face to the image of present frame according to AdaBoost algorithms
The region of face in the image of frame, the region of face are represented with rectangle frame.And then after the optical flow velocity value of each pixel is obtained,
With reference to the human face region of identification, the optical flow velocity value of each pixel in human face region is determined, and then according to each in human face region
The optical flow velocity value of pixel can determine N number of human face region optical flow velocity histogram, in combination with the human face region of identification, really
The optical flow velocity value of each pixel in fixed non-face region, and then according to the optical flow velocity value of pixel each in non-face region just
It can determine N number of non-face region optical flow velocity histogram, human face region optical flow velocity histogram determining at this time and non-face
The quantity of region optical flow velocity histogram is identical.
By setting different histogram spacing, it can more comprehensively reflect the distribution of optical flow velocity value.
In step S104, according to N number of human face region optical flow velocity histogram and N number of non-face region optical flow velocity Nogata
Figure and the corresponding preset weights of each histogram spacing obtain human face region optical flow velocity histogram and non-face region light stream
Average distance between velocity histogram.
In step S105, when detecting that average distance is less than pre-determined distance threshold value, it is prosthese to determine face to be detected
Face.
In one embodiment, the above method further includes:When detect average distance be greater than or equal to pre-determined distance threshold value
When, it is living body faces to determine the face in face video to be detected.
It is worth noting that, above-mentioned living body faces, it can be understood as the face to be detected is by lived true
The face of people is shot and is obtained, and is not what is obtained by being shot to the photo or image that include face,
Photo or image including face can be understood as prosthese face.
Wherein, pre-determined distance threshold value can be previously stored in terminal device, or terminal device is from other devices
Or obtained at system, the disclosure does not limit it.
In the disclosure, human face region optical flow velocity histogram and non-face is built by setting different histogram spacing
Region optical flow velocity histogram so that the human face region optical flow velocity histogram of structure can comprehensively reflect the light of human face region
The distribution of velocity value, the non-face region optical flow velocity histogram of structure can also comprehensively reflect the light stream in non-face region
The distribution of velocity amplitude, and calculating between human face region optical flow velocity histogram and non-face region optical flow velocity histogram
During average distance, preset weights are provided with for each histogram spacing, so as to which the histogram spacing for embodying different is corresponding
The distance between human face region optical flow velocity histogram and non-face region optical flow velocity histogram are in the average departure finally calculated
From the proportion in value, so that the average distance value calculated can be more accurate, and then the accuracy of recognition of face is improved.
The technical scheme provided by this disclosed embodiment can include the following benefits:It obtains comprising face to be detected
At least two field pictures obtain intensive light stream figure according at least two field pictures, and intensive light stream figure includes any frame in two field pictures
The optical flow velocity value of each pixel of image;Determine that N number of human face region optical flow velocity is straight according to the optical flow velocity value of each pixel
Side's figure and N number of non-face region optical flow velocity histogram;Wherein, the histogram spacing of each human face region optical flow velocity histogram
Difference, the histogram spacing of each non-face region optical flow velocity histogram are different;N is the integer more than or equal to 2;According to N number of
Human face region optical flow velocity histogram and N number of non-face region optical flow velocity histogram and each histogram spacing are corresponding pre-
If weights obtain the average distance between human face region optical flow velocity histogram and non-face region optical flow velocity histogram;Work as inspection
When measuring average distance less than pre-determined distance threshold value, it is prosthese face to determine face to be detected.It can be made by above-mentioned method
The distance value that must be calculated can be more accurate, and then improves the accuracy of recognition of face.
In one embodiment, N number of face area is determined according to the optical flow velocity value of each pixel in above-mentioned step S102
Domain optical flow velocity histogram may be embodied as following steps A1-A6:
In A1, the minimum light velocity value in the optical flow velocity value of each pixel is obtained.
In A2, determine minimum light velocity value between the first histogram of the 1st face area light stream velocity histogram
Away from.
It is adjacent previous according to the first histogram spacing of the latter human face region optical flow velocity histogram in A3
The preset multiple of first histogram spacing of human face region optical flow velocity histogram determines that each face area light flow velocity degree is straight
First histogram spacing of square figure.
In A4, n-th of people is determined according to the corresponding first histogram spacing of n-th of human face region optical flow velocity histogram
Each first optical flow velocity value section in the optical flow velocity histogram of face region, n take 1,2 ... N successively.
Wherein, the initial value in the first optical flow velocity value section in each human face region optical flow velocity histogram can not phase
Together, can also be identical, the disclosure does not limit it.
In A5, to each first optical flow velocity value section, obtain in human face region in the optical flow velocity value of each pixel
It is contained in first pixel quantity in the first optical flow velocity value section.
In A6, according to corresponding first picture in each first optical flow velocity value section and each first optical flow velocity value section
Prime number amount determines N number of human face region optical flow velocity histogram.
As shown in Fig. 2, after the optical flow velocity value of each pixel is obtained, it is assumed that the minimum light stream in those optical flow velocity values
Be worth is 1, it is assumed that preset multiple 2, and 3 face area light stream velocity histograms are built, after minimum light flow valuve 1 is obtained, with 1
As the first histogram spacing of the 1st face area light stream velocity histogram, since preset multiple is 2, then the 2nd face area
First histogram spacing of the first histogram spacing of domain optical flow velocity histogram for the 1st face area light stream velocity histogram
2 times, at this point, the first histogram spacing of the 2nd face area light stream velocity histogram be 2;3rd face area light flow velocity
2 times of the first histogram spacing of histogram for the first histogram spacing of the 2nd face area light stream velocity histogram are spent, this
When, the first histogram spacing of the 3rd face area light stream velocity histogram is 4;Assuming that the 1st face area light flow velocity degree is straight
First optical flow velocity value section of square figure is with 0 for optical flow velocity initial value, then in the 1st face area light stream velocity histogram
Each first optical flow velocity value section is respectively (0,1), (1,2), (2,3), (3,4), (4,5);When obtaining each first light stream
Behind velocity amplitude section, determine in the optical flow velocity value of each pixel to be contained in first pixel quantity of (0,1) from human face region
Value, such as:0.5、0.6;Similarly determine to be contained in first picture of (1,2) in the optical flow velocity value of each pixel from human face region
Prime number magnitude, the first pixel number magnitude for being contained in (2,3), the first pixel number magnitude for being contained in (3,4) and be contained in (4,
5) the first pixel number magnitude, after those the first pixel number magnitudes are obtained, with (0,1), (1,2), (2,3), (3,4), (4,5)
For horizontal axis, using comprising pixel number magnitude create the 1st face area light stream velocity histogram as the longitudinal axis;Correspondingly, based on the 1st
First of optical flow velocity initial value and the 2nd face area light stream velocity histogram in a face area light stream velocity histogram
Histogram spacing 2 obtain in the 2nd face area light stream velocity histogram each first optical flow velocity value section be respectively (0,
2), (2,4), (4,6), (6,8), (8,10);Similarly, it determines to be contained in the optical flow velocity value of each pixel from human face region
The first pixel number magnitude of (0,2), the first pixel number magnitude for being contained in (2,4), the first pixel quantity for being contained in (4,6)
The the first pixel number magnitude for being worth, being contained in (6,8) and the first pixel number magnitude for being contained in (8,10), when obtain those first
After pixel number magnitude, with (0,2), (2,4), (4,6), (6,8), (8,10) be horizontal axis, using comprising pixel number magnitude as the longitudinal axis
Create the 2nd face area light stream velocity histogram;Correspondingly, based on the light in the 1st face area light stream velocity histogram
First histogram spacing 4 of stream velocity original value and the 3rd face area light stream velocity histogram obtains the 3rd face area light
Each first optical flow velocity value section respectively (0,4), (4,8), (8,12), (12,16), (16,20) in velocity histogram are flowed,
The 3rd face area light stream velocity histogram is created according to the method described above.
The technical scheme provided by this disclosed embodiment can include the following benefits:Each pixel is based in the disclosure
Optical flow velocity value in minimum light velocity value determine human face region optical flow velocity histogram, due to being based on minimum light flow valuve
And set different histogram spacing that can comprehensively embody the optical flow velocity Distribution value of each pixel, so that build
Human face region optical flow velocity histogram is more accurate.
In one embodiment, it is determined in above-mentioned step S102 according to the optical flow velocity value of each pixel N number of non-face
Region optical flow velocity histogram may be embodied as following steps B1-B6:
In B1, the minimum light velocity value in the optical flow velocity value of each pixel is obtained.
In B2, second histogram of the minimum light velocity value for the 1st non-face region optical flow velocity histogram is determined
Spacing.
It is adjacent previous according to the second histogram spacing of the non-face region optical flow velocity histogram of the latter in B3
The preset multiple of second histogram spacing of a non-face region optical flow velocity histogram determines each non-face region light stream
Second histogram spacing of velocity histogram.
In B4, determined n-th according to the corresponding second histogram spacing of n-th of non-face region optical flow velocity histogram
Each second optical flow velocity value section in non-face region optical flow velocity histogram, n take 1,2 ... N successively.
In B5, to each second optical flow velocity value section, the optical flow velocity value of each pixel in non-face region is obtained
In be contained in second pixel quantity in the second optical flow velocity value section.
In B6, according to corresponding second picture in each second optical flow velocity value section and each second optical flow velocity value section
Prime number amount determines N number of non-face region optical flow velocity histogram.
Built in the present embodiment non-face region optical flow velocity histogram method and above-described embodiment in structure face area
The method of domain optical flow velocity histogram is identical, and details are not described herein again.
The technical scheme provided by this disclosed embodiment can include the following benefits:Each pixel is based in the disclosure
Light stream value in minimum light flow valuve determine non-face region optical flow velocity histogram, due to being based on minimum light flow valuve and setting
Different interzone spacings can comprehensively embody the light stream Distribution value of each pixel, so that the non-face area light of structure
It is more accurate to flow velocity histogram.
Due in the relevant technologies between determining two histograms apart from when, need one histogram area of User Defined
Between spacing, if histogram spacing selection it is improper, then can cause in each section of histogram reflect light stream Distribution value
Situation it is not comprehensive enough so that the result of recognition of face is not accurate enough, and in the disclosure, based on the setting of minimum light flow valuve not
Same histogram spacing, so that light stream Distribution value is comprehensively reflected in each section of the histogram of structure as far as possible,
So as to improve the accuracy of face recognition result.
In one embodiment, above-mentioned step S103 may be embodied as following steps C1-C2:
In C1, the new matched pixel quantity in i-th pair optical flow velocity histogram is obtained, wherein, i takes 1,2 ... N successively;
I-th pair optical flow velocity histogram includes a face area light stream velocity histogram and a non-face region optical flow velocity is straight
Fang Tu, and the corresponding first histogram spacing of human face region optical flow velocity histogram and non-face region optical flow velocity histogram pair
The the second histogram spacing answered is identical.
If it is used as according to the matched pixel quantity in i-th pair optical flow velocity histogram and obtains N number of human face region light stream
The parameter of the distance between velocity histogram and N number of non-face region optical flow velocity histogram, then, due to i-th pair light stream speed
The matched pixel quantity spent in histogram is overlapping with having in the matched pixel quantity in (i-1)-th pair of optical flow velocity histogram,
Partial pixel quantity has been computed repeatedly in the distance that can cause, it is not accurate enough so as to cause the distance of calculating, therefore, this public affairs
In opening, it is used as using the new matched pixel quantity in every a pair of of optical flow velocity histogram and obtains N number of human face region optical flow velocity
The parameter of the distance between histogram and N number of non-face region optical flow velocity histogram, so as to avoid computing repeatedly, effectively
Improve the accuracy of result of calculation.
In C2, according to the corresponding preset weights of histogram spacing of every a pair of of optical flow velocity histogram and per a pair of of light stream
New matched pixel quantity in velocity histogram obtains human face region optical flow velocity histogram and non-face region optical flow velocity is straight
Average distance between square figure.
Exemplary, according to above-mentioned each embodiment, N number of human face region optical flow velocity histogram of structure is:Wherein, H1(y) it is the 1st face area light stream velocity histogram, H2(y)
For the 2nd face area light stream velocity histogram, HN(y) it is n-th human face region optical flow velocity histogram;What is built is N number of non-
Human face region optical flow velocity histogram is:H1(z) it is the 1st non-face area
Domain optical flow velocity histogram, H2(z) it is the 2nd non-face region optical flow velocity histogram, HN(z) it is the non-face area light of n-th
Flow velocity histogram;According toObtain human face region optical flow velocity histogram and inhuman
Average distance between the optical flow velocity histogram of face region;Wherein, NiFor the new matched pixel in i-th pair optical flow velocity histogram
Quantity, wiThe corresponding preset weights of histogram spacing for i-th pair optical flow velocity histogram.
The technical scheme provided by this disclosed embodiment can include the following benefits:For every a pair of of optical flow velocity Nogata
The histogram spacing of figure sets corresponding preset weights, so that obtained average distance is more accurate.
New matched pixel quantity in above-mentioned acquisition i-th pair optical flow velocity histogram may be embodied as following steps D1-D2:
In D1, matched pixel quantity and i-th pair optical flow velocity histogram in (i-1)-th pair of optical flow velocity histogram are obtained
In matched pixel quantity.
In D2, matched pixel quantity and (i-1)-th pair of optical flow velocity histogram in i-th pair optical flow velocity histogram are determined
In the difference of matched pixel quantity be the new matched pixel quantity in i-th pair optical flow velocity histogram.
It is exemplary, according to Ni=I [Hi(y),Hi(z)]-I[Hi-1(y),Hi-1(z)] i-th pair optical flow velocity histogram is determined
In new matched pixel quantity, wherein, I [Hi(y),Hi(z)] it is the matched pixel quantity in i-th pair optical flow velocity histogram, I
[Hi-1(y),Hi-1(z)] it is the matched pixel quantity in (i-1)-th pair of optical flow velocity histogram.
In one embodiment, the matched pixel quantity in i-th pair optical flow velocity histogram is obtained, is included the following steps
E1-E4:
In E1, j-th first in the human face region optical flow velocity histogram in i-th pair optical flow velocity histogram are obtained
The corresponding third pixel value of optical flow velocity value interzone spacing.
In E2, j-th the in the non-face region optical flow velocity histogram in i-th pair optical flow velocity histogram are obtained
Corresponding 4th pixel value of two optical flow velocity value interzone spacings, wherein, j takes 1,2 ... M successively;M is i-th pair optical flow velocity Nogata
The quantity of the first optical flow velocity value interzone spacing in human face region optical flow velocity histogram in figure, alternatively, M is i-th pair light
Flow the quantity of the second optical flow velocity value interzone spacing in the non-face region optical flow velocity histogram in velocity histogram, and M
To be more than or equal to 1 integer.
In E3, j-th of corresponding third pixel values of first optical flow velocity value interzone spacing and j-th of second light streams are determined
Minimum value in 4th pixel value of velocity amplitude interzone spacing.
In E4, determine in i-th pair optical flow velocity histogram the corresponding minimum value of each optical flow velocity value interzone spacing it
With for the matched pixel quantity in i-th pair optical flow velocity histogram.
It is exemplary, according toDetermine i-th pair light stream speed
The matched pixel quantity in histogram is spent, wherein, Hi(y)jFor the human face region optical flow velocity in i-th pair optical flow velocity histogram
The corresponding third pixel value of j-th of first optical flow velocity value interzone spacings in histogram, (Hi(y)j,Hi(z)j) it is i-th pair light
J-th of the second optical flow velocity value interzone spacings flowed in the non-face region optical flow velocity histogram in velocity histogram are corresponding
4th pixel value.
In one embodiment, the preset weights of (i-1)-th pair of optical flow velocity histogram are more than i-th pair optical flow velocity histogram
Preset weights.
In a kind of achievable mode, the preset weights that can take i-th pair optical flow velocity histogram areWherein,
β is the preset multiple in above-described embodiment.Assuming that β=2, then
Due to the histogram in (i-1)-th pair of optical flow velocity histogram be smaller than it is straight in i-th pair optical flow velocity histogram
Square figure spacing, therefore, the distribution that (i-1)-th pair of optical flow velocity histogram can more comprehensively react the light stream value of each pixel are closed
System, so as to which the distance between (i-1)-th pair of optical flow velocity histogram is in the N number of human face region optical flow velocity histogram finally obtained
Therefore the weight that the distance between N number of non-face region optical flow velocity histogram accounts for, sets the (i-1)-th couple at this time with regard to larger
The preset weights of optical flow velocity histogram are more than the preset weights of i-th pair optical flow velocity histogram, so as to improve the N number of of acquisition
The accuracy of the distance between human face region optical flow velocity histogram and N number of non-face region optical flow velocity histogram.
Realization process is discussed in detail below by several embodiments.
Fig. 3 be according to a kind of flow chart of face identification method shown in an exemplary embodiment, as shown in figure 3, including
Following steps:
In step s 201, at least two field pictures for including face to be detected are obtained.
In step S202, intensive light stream figure is obtained according at least two field pictures, intensive light stream figure is included in two field pictures
Any frame image each pixel optical flow velocity value.
It is exemplary, the position of face in current image frame can be detected according to AdaBoost algorithms, the position of face is used
Rectangle frame represents, if detecting that face preserves current image frame, and continues to detect next frame image, if can't detect people
Face, it is not face video to be detected to determine current image frame, and abandons current image frame, detects next frame picture frame.
According to the previous frame image comprising facial image and current frame image two field pictures, intensive light stream can be calculated
Figure can obtain the optical flow velocity value of each pixel according to intensive light stream figure.
In step S203, the minimum light velocity value in the optical flow velocity value of each pixel is determined.
In step S204, N number of human face region optical flow velocity histogram is determined according to the optical flow velocity value of each pixelWherein, H1(y) it is the 1st face area light stream velocity histogram, H2(y)
For the 2nd face area light stream velocity histogram, HN(y) it is n-th human face region optical flow velocity histogram.
It is the 1st face area light stream velocity histogram H to determine minimum light velocity value1(y) the first histogram spacing
a1。
According to ai=2ai-1Determine the first histogram spacing of each face area light stream velocity histogram, wherein, aiFor
I-th of human face region optical flow velocity histogram Hi(y) the first histogram spacing ai;ai-1For (i-1)-th face area light flow velocity
Spend histogram Hi-1(y) the first histogram spacing ai-1.I takes 2,3 ... N successively.
According to aiDetermine each first optical flow velocity value section in i-th of human face region optical flow velocity histogram.
To each first optical flow velocity value section, obtain and be contained in the in human face region in the optical flow velocity value of each pixel
First pixel quantity in one optical flow velocity value section.
According to corresponding first pixel quantity in each first optical flow velocity value section and each first optical flow velocity value section
Determine N number of human face region optical flow velocity histogram.
In step S205, N number of non-face region optical flow velocity histogram is determined according to the optical flow velocity value of each pixelH1(z) it is the 1st non-face region optical flow velocity histogram, H2(z) it is the
2 non-face region optical flow velocity histograms, HN(z) it is the non-face region optical flow velocity histogram of n-th.
It is the 1st non-face region optical flow velocity histogram H to determine minimum light velocity value1(z) between the second histogram
Away from b1;
According to bi=2bi-1Determine the second histogram spacing of each non-face region optical flow velocity histogram, wherein, bi
For i-th of non-face region optical flow velocity histogram Hi(z) the second histogram spacing bi;bi-1For (i-1)-th non-face region
Optical flow velocity histogram Hi-1(z) the second histogram spacing bi-1.I takes 2,3 ... N successively.
According to biDetermine each second optical flow velocity value section in i-th of non-face region optical flow velocity histogram.
To each second optical flow velocity value section, obtain and be contained in the optical flow velocity value of each pixel in non-face region
Second pixel quantity in the second optical flow velocity value section;
According to corresponding second pixel quantity in each second optical flow velocity value section and each second optical flow velocity value section
Determine N number of non-face region optical flow velocity histogram.
In step S206, according toDetermine i-th pair
Matched pixel quantity in optical flow velocity histogram, wherein, Hi(y)jFor the human face region light in i-th pair optical flow velocity histogram
Flow the corresponding third pixel value of j-th of first optical flow velocity value interzone spacings in velocity histogram, (Hi(y)j,Hi(z)j) be
Between j-th of second optical flow velocity value sections in non-face region optical flow velocity histogram in i-th pair optical flow velocity histogram
Away from corresponding 4th pixel value.
In step S207, according to Ni=I [Hi(y),Hi(z)]-I[Hi-1(y),Hi-1(z)] i-th pair optical flow velocity is determined
New matched pixel quantity in histogram, wherein, I [Hi(y),Hi(z)] it is the matched pixel in i-th pair optical flow velocity histogram
Quantity, I [Hi-1(y),Hi-1(z)] it is the matched pixel quantity in (i-1)-th pair of optical flow velocity histogram.
In step S208, according toObtain human face region optical flow velocity Nogata
Average distance between figure and non-face region optical flow velocity histogram;Wherein, NiIt is new in i-th pair optical flow velocity histogram
Matched pixel quantity, wiThe corresponding preset weights of histogram spacing for i-th pair optical flow velocity histogram.
In step S209, when detectingDuring more than or equal to pre-determined distance threshold value, determine described
Face in face video to be detected is living body faces;
When detectingDuring less than pre-determined distance threshold value, the face in face video to be detected is determined
For prosthese face.
Following is embodiment of the present disclosure, can be used for performing embodiments of the present disclosure.
Fig. 4 is the block diagram according to a kind of face identification device shown in an exemplary embodiment.As shown in figure 4, the face
Identification device includes:
First acquisition module 11, for obtaining at least two field pictures for including face to be detected.
Second acquisition module 12, it is close for at least two field pictures acquisition according to first acquisition module 11 acquisition
Light harvesting flow graph, the intensive light stream figure include the optical flow velocity value of each pixel of any frame image in the two field pictures;
First determining module 13, for the optical flow velocity of each pixel obtained according to second acquisition module 12
Value determines N number of human face region optical flow velocity histogram and N number of non-face region optical flow velocity histogram;Wherein, each face area
The histogram spacing of domain optical flow velocity histogram is different, and the histogram spacing of each non-face region optical flow velocity histogram is not
Together;The N is the integer more than or equal to 2;
Third acquisition module 14, for the N number of human face region light stream speed determined according to first determining module 13
It spends histogram and N number of non-face region optical flow velocity histogram and the corresponding preset weights of each histogram spacing obtains
Average distance between human face region optical flow velocity histogram and non-face region optical flow velocity histogram;
Detection module 15, for detect the face region optical flow velocity histogram that the third acquisition module 14 obtains and
Whether the average distance between non-face region optical flow velocity histogram is less than pre-determined distance threshold value;
Second determining module 16 detects that the average distance is less than the pre-determined distance for working as the detection module 15
During threshold value, it is prosthese face to determine the face to be detected.
In one embodiment, as shown in figure 5, first determining module 13 includes:First acquisition submodule 131,
One determination sub-module 132, the second determination sub-module 133, third determination sub-module 134, the second acquisition submodule the 135, the 4th are really
Stator modules 136, the 5th determination sub-module 137, the 6th determination sub-module 138, the 7th determination sub-module 139, third obtain son
1310 and the 8th determination sub-module 1311 of module;
First acquisition submodule 131, for obtaining the light stream for each pixel that second acquisition module 12 obtains
Minimum light velocity value in velocity amplitude;
First determination sub-module 132, for determining the minimum light stream of the acquisition of the first acquisition submodule 131
First histogram spacing of the velocity amplitude for the 1st face area light stream velocity histogram;
Second determination sub-module 133, for the first Nogata according to the latter human face region optical flow velocity histogram
Preset multiple of the figure spacing for the first histogram spacing of adjacent previous human face region optical flow velocity histogram, determines each
First histogram spacing of a face area light stream velocity histogram;
The third determination sub-module 134, for corresponding first straight according to n-th of human face region optical flow velocity histogram
Square figure spacing determines each first optical flow velocity value section in n-th of human face region optical flow velocity histogram, the n according to
It is secondary to take 1,2 ... N;
Second acquisition submodule 135, for each first light determined to the third determination sub-module 134
Velocity value section obtains and the first optical flow velocity value is contained in the optical flow velocity value of each pixel in the human face region
First pixel quantity in section;
4th determination sub-module 136, for according to each first optical flow velocity value section and each described the
Corresponding first pixel quantity in one optical flow velocity value section determines N number of human face region optical flow velocity histogram;
5th determination sub-module 137, for determining the minimum light stream of the acquisition of the second acquisition submodule 12
Second histogram spacing of the velocity amplitude for the 1st non-face region optical flow velocity histogram;
6th determination sub-module 138 is straight for second according to the non-face region optical flow velocity histogram of the latter
The preset multiple of the square figure spacing for the second histogram spacing of adjacent previous non-face region optical flow velocity histogram,
Determine the second histogram spacing of each non-face region optical flow velocity histogram;
7th determination sub-module 139, for according to n-th of non-face region optical flow velocity histogram corresponding second
Histogram spacing determines each second optical flow velocity value section in described n-th non-face region optical flow velocity histogram, institute
It states n and takes 1,2 ... N successively;
The third acquisition submodule 1310, for the 7th determination sub-module 139 determine each described second
Optical flow velocity value section obtains and is contained in the second light stream speed in the non-face region in the optical flow velocity value of each pixel
Second pixel quantity in angle value section;
8th determination sub-module 1311, for according to each second optical flow velocity value section and each described the
Corresponding second pixel quantity in two optical flow velocity value sections determines N number of non-face region optical flow velocity histogram.
In one embodiment, as shown in fig. 6, the third acquisition module 14 includes:4th acquisition submodule 141 and
Five acquisition submodules 142;
4th acquisition submodule 141, for obtaining the new matched pixel quantity in i-th pair optical flow velocity histogram,
Wherein, the i takes 1,2 ... N successively;The i-th pair optical flow velocity histogram includes a face area light flow velocity degree Nogata
Figure and a non-face region optical flow velocity histogram, and corresponding first histogram of the human face region optical flow velocity histogram
Spacing the second histogram spacing corresponding with the non-face region optical flow velocity histogram is identical;
5th acquisition submodule 142, for corresponding according to the histogram spacing per a pair of of optical flow velocity histogram
What preset weights and the 4th acquisition submodule 141 obtained obtains per the new matched pixel quantity in a pair of of optical flow velocity histogram
Take the distance between N number of human face region optical flow velocity histogram and N number of non-face region optical flow velocity histogram.
In one embodiment, as shown in fig. 7, the 4th acquisition submodule 141 includes:6th acquisition submodule 1411
With the 9th determination sub-module 1412;
6th acquisition submodule 1411, for obtaining the matched pixel quantity in (i-1)-th pair of optical flow velocity histogram
With the matched pixel quantity in the i-th pair optical flow velocity histogram;
9th determination sub-module 1412, for determining the i-th pair of the 6th acquisition submodule 1411 acquisition
The difference of matched pixel quantity and the matched pixel quantity in (i-1)-th pair of optical flow velocity histogram in optical flow velocity histogram
It is worth for the new matched pixel quantity in the i-th pair optical flow velocity histogram.
In one embodiment, as shown in figure 8, the 6th acquisition submodule 1411 includes:7th acquisition submodule a1,
8th acquisition submodule a2, the tenth determination sub-module a3 and the 11st determination sub-module a4;
The 7th acquisition submodule a1, for obtaining the human face region light stream in the i-th pair optical flow velocity histogram
The corresponding third pixel value of j-th of first optical flow velocity value interzone spacings in velocity histogram;
The 8th acquisition submodule a2, for obtaining the non-face area light in the i-th pair optical flow velocity histogram
Corresponding 4th pixel value of j-th of second optical flow velocity value interzone spacings in velocity histogram is flowed, wherein, the j takes successively
1、2…M;The M is the first light stream speed in the human face region optical flow velocity histogram in the i-th pair optical flow velocity histogram
The quantity of angle value interzone spacing, alternatively, the M is the non-face region optical flow velocity in the i-th pair optical flow velocity histogram
The quantity of the second optical flow velocity value interzone spacing in histogram, and the M is the integer more than or equal to 1;
The tenth determination sub-module a3, for determining j-th of first optical flow velocity value interzone spacings corresponding
Minimum value in three pixel values and the 4th pixel value of j-th of second optical flow velocity value interzone spacings;
The 11st determination sub-module a4, for determining each optical flow velocity in the i-th pair optical flow velocity histogram
It is worth the sum of corresponding minimum value of interzone spacing for the matched pixel quantity in the i-th pair optical flow velocity histogram.
In one embodiment, the preset weights of (i-1)-th pair of optical flow velocity histogram are more than i-th pair light stream speed
Spend the preset weights of histogram.
In one embodiment, at least two field pictures of the face to be detected are:Adjacent the two of the face to be detected
Frame image.
In one embodiment, as shown in figure 9, described device further includes:Third determining module 17;
The third determining module 17 detects that the average distance is greater than or equal to institute for working as the detection module 15
When stating pre-determined distance threshold value, it is living body faces to determine the face to be detected.
According to the third aspect of the embodiment of the present disclosure, a kind of face identification device is provided, including:
Processor;
For storing the memory of processor-executable instruction;
Wherein, processor is configured as:
Obtain at least two field pictures for including face to be detected;
Intensive light stream figure is obtained according at least two field pictures, the intensive light stream figure is included in the two field pictures
The optical flow velocity value of each pixel of any frame image;
N number of human face region optical flow velocity histogram and N number of non-face is determined according to the optical flow velocity value of each pixel
Region optical flow velocity histogram;Wherein, the histogram spacing of each human face region optical flow velocity histogram is different, Ge Gesuo
The histogram spacing for stating non-face region optical flow velocity histogram is different;The N is the integer more than or equal to 2;
According to N number of human face region optical flow velocity histogram and N number of non-face region optical flow velocity histogram with
And the corresponding preset weights of each histogram spacing obtain human face region optical flow velocity histogram and non-face region optical flow velocity
Average distance between histogram;
When detecting that the average distance is less than pre-determined distance threshold value, it is prosthese face to determine the face to be detected.
Above-mentioned processor is also configured to:
The optical flow velocity value according to each pixel determines N number of human face region optical flow velocity histogram and N number of non-face
Region optical flow velocity histogram, including:
Obtain the minimum light velocity value in the optical flow velocity value of each pixel;
Determine first histogram spacing of the minimum light velocity value for the 1st face area light stream velocity histogram;
It is adjacent previous face area according to the first histogram spacing of the latter human face region optical flow velocity histogram
The preset multiple of first histogram spacing of domain optical flow velocity histogram determines each face area light stream velocity histogram
First histogram spacing;
N-th of face is determined according to the corresponding first histogram spacing of n-th of human face region optical flow velocity histogram
Each first optical flow velocity value section in the optical flow velocity histogram of region, the n take 1,2 ... N successively;
To each first optical flow velocity value section, in the optical flow velocity value for obtaining each pixel in the human face region
It is contained in first pixel quantity in the first optical flow velocity value section;
According to each first optical flow velocity value section and each first optical flow velocity value section corresponding first
Pixel quantity determines N number of human face region optical flow velocity histogram;
Determine the minimum light velocity value between the second histogram of the 1st non-face region optical flow velocity histogram
Away from;
It is adjacent previous inhuman according to the second histogram spacing of the non-face region optical flow velocity histogram of the latter
The preset multiple of second histogram spacing of face region optical flow velocity histogram determines each non-face area light flow velocity
Spend the second histogram spacing of histogram;
According to the corresponding second histogram spacing of n-th of non-face region optical flow velocity histogram determine described n-th it is non-
Each second optical flow velocity value section in human face region optical flow velocity histogram, the n take 1,2 ... N successively;
To each second optical flow velocity value section, the optical flow velocity value of each pixel in the non-face region is obtained
In be contained in second pixel quantity in the second optical flow velocity value section;
According to each second optical flow velocity value section and each second optical flow velocity value section corresponding second
Pixel quantity determines N number of non-face region optical flow velocity histogram.
It is described according to N number of human face region optical flow velocity histogram and N number of non-face region optical flow velocity Nogata
Figure and the corresponding preset weights of each histogram spacing obtain human face region optical flow velocity histogram and non-face region light stream
Average distance between velocity histogram, including:
The new matched pixel quantity in i-th pair optical flow velocity histogram is obtained, wherein, the i takes 1,2 ... N successively;It is described
I-th pair optical flow velocity histogram includes a face area light stream velocity histogram and a non-face region optical flow velocity is straight
Fang Tu, and the corresponding first histogram spacing of the human face region optical flow velocity histogram and the non-face region optical flow velocity
The corresponding second histogram spacing of histogram is identical;
It is straight according to the corresponding preset weights of histogram spacing of every a pair of of optical flow velocity histogram and every a pair of of optical flow velocity
New matched pixel quantity in square figure obtain human face region optical flow velocity histogram and non-face region optical flow velocity histogram it
Between average distance.
The new matched pixel quantity obtained in i-th pair optical flow velocity histogram, including:
It obtains in the matched pixel quantity and the i-th pair optical flow velocity histogram in (i-1)-th pair of optical flow velocity histogram
Matched pixel quantity;
Determine the matched pixel quantity in the i-th pair optical flow velocity histogram and (i-1)-th pair of optical flow velocity Nogata
The difference of matched pixel quantity in figure is the new matched pixel quantity in the i-th pair optical flow velocity histogram.
The matched pixel quantity obtained in i-th pair optical flow velocity histogram, including:
Obtain j-th of first light in the human face region optical flow velocity histogram in the i-th pair optical flow velocity histogram
The corresponding third pixel value of velocity value interzone spacing;
Obtain j-th second in the non-face region optical flow velocity histogram in the i-th pair optical flow velocity histogram
Corresponding 4th pixel value of optical flow velocity value interzone spacing, wherein, the j takes 1,2 ... M successively;The M is the i-th pair light
The quantity of the first optical flow velocity value interzone spacing in the human face region optical flow velocity histogram in velocity histogram is flowed, alternatively,
The M is the second optical flow velocity value in the non-face region optical flow velocity histogram in the i-th pair optical flow velocity histogram
The quantity of interzone spacing, and the M is the integer more than or equal to 1;
Determine the corresponding third pixel value of j-th of first optical flow velocity value interzone spacings and j-th of second light
Minimum value in 4th pixel value of velocity value interzone spacing;
Determine that the sum of corresponding minimum value of each optical flow velocity value interzone spacing is in the i-th pair optical flow velocity histogram
Matched pixel quantity in the i-th pair optical flow velocity histogram.
The preset weights of (i-1)-th pair of optical flow velocity histogram are more than the default of the i-th pair optical flow velocity histogram
Weights.
At least two field pictures of the face to be detected are:The adjacent two field pictures of the face to be detected.
The method further includes:
When detecting that the average distance is greater than or equal to the pre-determined distance threshold value, determine that the face to be detected is
Living body faces.
About the device in above-described embodiment, wherein modules perform the concrete mode of operation in related this method
Embodiment in be described in detail, explanation will be not set forth in detail herein.
Figure 10 is according to a kind of block diagram with face identification device 80 shown in an exemplary embodiment, which is suitable for
Terminal device.For example, device 80 can be mobile phone, and computer, digital broadcast terminal, messaging devices, game control
Platform, tablet device, Medical Devices, body-building equipment, personal digital assistant etc..
Device 80 can include following one or more components:Processing component 802, memory 804, power supply module 806 are more
Media component 808, audio component 810, the interface 812 of input/output (I/O), sensor module 814 and communication component
816。
The integrated operation of 802 usual control device 80 of processing component, such as with display, call, data communication, camera
Operation and record operate associated operation.Processing component 802 can carry out execute instruction including one or more processors 820,
To perform all or part of the steps of the methods described above.In addition, processing component 802 can include one or more modules, it is convenient for
Interaction between processing component 802 and other assemblies.For example, processing component 802 can include multi-media module, to facilitate more matchmakers
Interaction between body component 808 and processing component 802.
Memory 804 is configured as storing various types of data to support the operation in device 80.These data are shown
Example includes the instruction of any application program or method for being operated on device 80, contact data, and telephone book data disappears
Breath, picture, video etc..Memory 804 can be by any kind of volatibility or non-volatile memory device or their group
It closes and realizes, such as static RAM (SRAM), electrically erasable programmable read-only memory (EEPROM) is erasable to compile
Journey read-only memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flash
Device, disk or CD.
Power supply module 806 provides electric power for the various assemblies of device 80.Power supply module 806 can include power management system
System, one or more power supplys and other generate, manage and distribute electric power associated component with for device 80.
Multimedia component 808 is included in the screen of one output interface of offer between described device 80 and user.One
In a little embodiments, screen can include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel, screen
Curtain may be implemented as touch screen, to receive input signal from the user.Touch panel includes one or more touch sensings
Device is to sense the gesture on touch, slide, and touch panel.The touch sensor can not only sense touch or sliding action
Boundary, but also detect duration and pressure associated with the touch or slide operation.In some embodiments, more matchmakers
Body component 808 includes a front camera and/or rear camera.When device 80 is in operation mode, such as screening-mode or
During video mode, front camera and/or rear camera can receive external multi-medium data.Each front camera and
Rear camera can be a fixed optical lens system or have focusing and optical zoom capabilities.
Audio component 810 is configured as output and/or input audio signal.For example, audio component 810 includes a Mike
Wind (MIC), when device 80 is in operation mode, during such as call model, logging mode and speech recognition mode, microphone is configured
To receive external audio signal.The received audio signal can be further stored in memory 804 or via communication component
816 send.In some embodiments, audio component 810 further includes a loud speaker, for exports audio signal.
I/O interfaces 812 provide interface between processing component 802 and peripheral interface module, and above-mentioned peripheral interface module can
To be keyboard, click wheel, button etc..These buttons may include but be not limited to:Home button, volume button, start button and lock
Determine button.
Sensor module 814 includes one or more sensors, for providing the status assessment of various aspects for device 80.
For example, sensor module 814 can detect opening/closed state of device 80, the relative positioning of component, such as the component
For the display and keypad of device 80, sensor module 814 can be with the position of 80 1 components of detection device 80 or device
Change, the existence or non-existence that user contacts with device 80,80 orientation of device or acceleration/deceleration and the temperature change of device 80.
Sensor module 814 can include proximity sensor, be configured to detect object nearby without any physical contact
Presence.Sensor module 814 can also include optical sensor, such as CMOS or ccd image sensor, in imaging applications
It uses.In some embodiments, which can also include acceleration transducer, gyro sensor, magnetic sensing
Device, pressure sensor or temperature sensor.
Communication component 816 is configured to facilitate the communication of wired or wireless way between device 80 and other equipment.Device
80 can access the wireless network based on communication standard, such as WiFi, 2G or 3G or combination thereof.In an exemplary implementation
In example, communication component 816 receives broadcast singal or broadcast related information from external broadcasting management system via broadcast channel.
In one exemplary embodiment, the communication component 816 further includes near-field communication (NFC) module, to promote short range communication.Example
Such as, NFC module can be based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra wide band (UWB) technology,
Bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, device 80 can be believed by one or more application application-specific integrated circuit (ASIC), number
Number processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), field programmable gate array
(FPGA), controller, microcontroller, microprocessor or other electronic building bricks are realized, for performing the above method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instructing, example are additionally provided
Such as include the memory 804 of instruction, above-metioned instruction can be performed to complete the above method by the processor 820 of device 80.For example, institute
State non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk and
Optical data storage devices etc..
A kind of non-transitorycomputer readable storage medium, when the instruction in the storage medium is by the processor of device 80
During execution so that device 80 is able to carry out above-mentioned face identification method, the method includes:
Obtain at least two field pictures for including face to be detected;
Intensive light stream figure is obtained according at least two field pictures, the intensive light stream figure is included in the two field pictures
The optical flow velocity value of each pixel of any frame image;
N number of human face region optical flow velocity histogram and N number of non-face is determined according to the optical flow velocity value of each pixel
Region optical flow velocity histogram;Wherein, the histogram spacing of each human face region optical flow velocity histogram is different, Ge Gesuo
The histogram spacing for stating non-face region optical flow velocity histogram is different;The N is the integer more than or equal to 2;
According to N number of human face region optical flow velocity histogram and N number of non-face region optical flow velocity histogram with
And the corresponding preset weights of each histogram spacing obtain human face region optical flow velocity histogram and non-face region optical flow velocity
Average distance between histogram;
When detecting that the average distance is less than pre-determined distance threshold value, it is prosthese face to determine the face to be detected.
The optical flow velocity value according to each pixel determines N number of human face region optical flow velocity histogram and N number of non-face
Region optical flow velocity histogram, including:
Obtain the minimum light velocity value in the optical flow velocity value of each pixel;
Determine first histogram spacing of the minimum light velocity value for the 1st face area light stream velocity histogram;
It is adjacent previous face area according to the first histogram spacing of the latter human face region optical flow velocity histogram
The preset multiple of first histogram spacing of domain optical flow velocity histogram determines each face area light stream velocity histogram
First histogram spacing;
N-th of face is determined according to the corresponding first histogram spacing of n-th of human face region optical flow velocity histogram
Each first optical flow velocity value section in the optical flow velocity histogram of region, the n take 1,2 ... N successively;
To each first optical flow velocity value section, in the optical flow velocity value for obtaining each pixel in the human face region
It is contained in first pixel quantity in the first optical flow velocity value section;
According to each first optical flow velocity value section and each first optical flow velocity value section corresponding first
Pixel quantity determines N number of human face region optical flow velocity histogram;
Determine the minimum light velocity value between the second histogram of the 1st non-face region optical flow velocity histogram
Away from;
It is adjacent previous inhuman according to the second histogram spacing of the non-face region optical flow velocity histogram of the latter
The preset multiple of second histogram spacing of face region optical flow velocity histogram determines each non-face area light flow velocity
Spend the second histogram spacing of histogram;
According to the corresponding second histogram spacing of n-th of non-face region optical flow velocity histogram determine described n-th it is non-
Each second optical flow velocity value section in human face region optical flow velocity histogram, the n take 1,2 ... N successively;
To each second optical flow velocity value section, the optical flow velocity value of each pixel in the non-face region is obtained
In be contained in second pixel quantity in the second optical flow velocity value section;
According to each second optical flow velocity value section and each second optical flow velocity value section corresponding second
Pixel quantity determines N number of non-face region optical flow velocity histogram.
It is described according to N number of human face region optical flow velocity histogram and N number of non-face region optical flow velocity Nogata
Figure and the corresponding preset weights of each histogram spacing obtain human face region optical flow velocity histogram and non-face region light stream
Average distance between velocity histogram, including:
The new matched pixel quantity in i-th pair optical flow velocity histogram is obtained, wherein, the i takes 1,2 ... N successively;It is described
I-th pair optical flow velocity histogram includes a face area light stream velocity histogram and a non-face region optical flow velocity is straight
Fang Tu, and the corresponding first histogram spacing of the human face region optical flow velocity histogram and the non-face region optical flow velocity
The corresponding second histogram spacing of histogram is identical;
It is straight according to the corresponding preset weights of histogram spacing of every a pair of of optical flow velocity histogram and every a pair of of optical flow velocity
New matched pixel quantity in square figure obtain human face region optical flow velocity histogram and non-face region optical flow velocity histogram it
Between average distance.
The new matched pixel quantity obtained in i-th pair optical flow velocity histogram, including:
It obtains in the matched pixel quantity and the i-th pair optical flow velocity histogram in (i-1)-th pair of optical flow velocity histogram
Matched pixel quantity;
Determine the matched pixel quantity in the i-th pair optical flow velocity histogram and (i-1)-th pair of optical flow velocity Nogata
The difference of matched pixel quantity in figure is the new matched pixel quantity in the i-th pair optical flow velocity histogram.
The matched pixel quantity obtained in i-th pair optical flow velocity histogram, including:
Obtain j-th of first light in the human face region optical flow velocity histogram in the i-th pair optical flow velocity histogram
The corresponding third pixel value of velocity value interzone spacing;
Obtain j-th second in the non-face region optical flow velocity histogram in the i-th pair optical flow velocity histogram
Corresponding 4th pixel value of optical flow velocity value interzone spacing, wherein, the j takes 1,2 ... M successively;The M is the i-th pair light
The quantity of the first optical flow velocity value interzone spacing in the human face region optical flow velocity histogram in velocity histogram is flowed, alternatively,
The M is the second optical flow velocity value in the non-face region optical flow velocity histogram in the i-th pair optical flow velocity histogram
The quantity of interzone spacing, and the M is the integer more than or equal to 1;
Determine the corresponding third pixel value of j-th of first optical flow velocity value interzone spacings and j-th of second light
Minimum value in 4th pixel value of velocity value interzone spacing;
Determine that the sum of corresponding minimum value of each optical flow velocity value interzone spacing is in the i-th pair optical flow velocity histogram
Matched pixel quantity in the i-th pair optical flow velocity histogram.
The preset weights of (i-1)-th pair of optical flow velocity histogram are more than the default of the i-th pair optical flow velocity histogram
Weights.
At least two field pictures of the face to be detected are:The adjacent two field pictures of the face to be detected.
The method further includes:
When detecting that the average distance is greater than or equal to the pre-determined distance threshold value, determine that the face to be detected is
Living body faces.
Figure 11 is the block diagram according to a kind of device 90 for recognition of face shown in an exemplary embodiment.For example, dress
It puts 90 and may be provided as a server.Device 90 includes processing component 902, further comprises one or more processors,
, can be by the instruction of the execution of processing component 902 for storing and as the memory resource representated by memory 903, it such as should
Use program.The application program stored in memory 903 can include it is one or more each correspond to one group of instruction
Module.In addition, processing component 902 is configured as execute instruction, to perform the above method.
Device 90 can also include the power management that a power supply module 906 is configured as executive device 90, and one wired
Or radio network interface 905 is configured as device 90 being connected to network and input and output (I/O) interface 908.Device 90
It can operate based on the operating system for being stored in memory 903, such as Windows ServerTM, Mac OS XTM, UnixTM,
LinuxTM, FreeBSDTM or similar.
A kind of non-transitorycomputer readable storage medium, when the instruction in the storage medium is by the processor of device 90
During execution so that device 90 is able to carry out above-mentioned face identification method, the method includes:
Obtain at least two field pictures for including face to be detected;
Intensive light stream figure is obtained according at least two field pictures, the intensive light stream figure is included in the two field pictures
The optical flow velocity value of each pixel of any frame image;
N number of human face region optical flow velocity histogram and N number of non-face is determined according to the optical flow velocity value of each pixel
Region optical flow velocity histogram;Wherein, the histogram spacing of each human face region optical flow velocity histogram is different, Ge Gesuo
The histogram spacing for stating non-face region optical flow velocity histogram is different;The N is the integer more than or equal to 2;
According to N number of human face region optical flow velocity histogram and N number of non-face region optical flow velocity histogram with
And the corresponding preset weights of each histogram spacing obtain human face region optical flow velocity histogram and non-face region optical flow velocity
Average distance between histogram;
When detecting that the average distance is less than pre-determined distance threshold value, it is prosthese face to determine the face to be detected.
The optical flow velocity value according to each pixel determines N number of human face region optical flow velocity histogram and N number of non-face
Region optical flow velocity histogram, including:
Obtain the minimum light velocity value in the optical flow velocity value of each pixel;
Determine first histogram spacing of the minimum light velocity value for the 1st face area light stream velocity histogram;
It is adjacent previous face area according to the first histogram spacing of the latter human face region optical flow velocity histogram
The preset multiple of first histogram spacing of domain optical flow velocity histogram determines each face area light stream velocity histogram
First histogram spacing;
N-th of face is determined according to the corresponding first histogram spacing of n-th of human face region optical flow velocity histogram
Each first optical flow velocity value section in the optical flow velocity histogram of region, the n take 1,2 ... N successively;
To each first optical flow velocity value section, in the optical flow velocity value for obtaining each pixel in the human face region
It is contained in first pixel quantity in the first optical flow velocity value section;
According to each first optical flow velocity value section and each first optical flow velocity value section corresponding first
Pixel quantity determines N number of human face region optical flow velocity histogram;
Determine the minimum light velocity value between the second histogram of the 1st non-face region optical flow velocity histogram
Away from;
It is adjacent previous inhuman according to the second histogram spacing of the non-face region optical flow velocity histogram of the latter
The preset multiple of second histogram spacing of face region optical flow velocity histogram determines each non-face area light flow velocity
Spend the second histogram spacing of histogram;
According to the corresponding second histogram spacing of n-th of non-face region optical flow velocity histogram determine described n-th it is non-
Each second optical flow velocity value section in human face region optical flow velocity histogram, the n take 1,2 ... N successively;
To each second optical flow velocity value section, the optical flow velocity value of each pixel in the non-face region is obtained
In be contained in second pixel quantity in the second optical flow velocity value section;
According to each second optical flow velocity value section and each second optical flow velocity value section corresponding second
Pixel quantity determines N number of non-face region optical flow velocity histogram.
It is described according to N number of human face region optical flow velocity histogram and N number of non-face region optical flow velocity Nogata
Figure and the corresponding preset weights of each histogram spacing obtain human face region optical flow velocity histogram and non-face region light stream
Average distance between velocity histogram, including:
The new matched pixel quantity in i-th pair optical flow velocity histogram is obtained, wherein, the i takes 1,2 ... N successively;It is described
I-th pair optical flow velocity histogram includes a face area light stream velocity histogram and a non-face region optical flow velocity is straight
Fang Tu, and the corresponding first histogram spacing of the human face region optical flow velocity histogram and the non-face region optical flow velocity
The corresponding second histogram spacing of histogram is identical;
It is straight according to the corresponding preset weights of histogram spacing of every a pair of of optical flow velocity histogram and every a pair of of optical flow velocity
New matched pixel quantity in square figure obtain human face region optical flow velocity histogram and non-face region optical flow velocity histogram it
Between average distance.
The new matched pixel quantity obtained in i-th pair optical flow velocity histogram, including:
It obtains in the matched pixel quantity and the i-th pair optical flow velocity histogram in (i-1)-th pair of optical flow velocity histogram
Matched pixel quantity;
Determine the matched pixel quantity in the i-th pair optical flow velocity histogram and (i-1)-th pair of optical flow velocity Nogata
The difference of matched pixel quantity in figure is the new matched pixel quantity in the i-th pair optical flow velocity histogram.
The matched pixel quantity obtained in i-th pair optical flow velocity histogram, including:
Obtain j-th of first light in the human face region optical flow velocity histogram in the i-th pair optical flow velocity histogram
The corresponding third pixel value of velocity value interzone spacing;
Obtain j-th second in the non-face region optical flow velocity histogram in the i-th pair optical flow velocity histogram
Corresponding 4th pixel value of optical flow velocity value interzone spacing, wherein, the j takes 1,2 ... M successively;The M is the i-th pair light
The quantity of the first optical flow velocity value interzone spacing in the human face region optical flow velocity histogram in velocity histogram is flowed, alternatively,
The M is the second optical flow velocity value in the non-face region optical flow velocity histogram in the i-th pair optical flow velocity histogram
The quantity of interzone spacing, and the M is the integer more than or equal to 1;
Determine the corresponding third pixel value of j-th of first optical flow velocity value interzone spacings and j-th of second light
Minimum value in 4th pixel value of velocity value interzone spacing;
Determine that the sum of corresponding minimum value of each optical flow velocity value interzone spacing is in the i-th pair optical flow velocity histogram
Matched pixel quantity in the i-th pair optical flow velocity histogram.
The preset weights of (i-1)-th pair of optical flow velocity histogram are more than the default of the i-th pair optical flow velocity histogram
Weights.
At least two field pictures of the face to be detected are:The adjacent two field pictures of the face to be detected.
The method further includes:
When detecting that the average distance is greater than or equal to the pre-determined distance threshold value, determine that the face to be detected is
Living body faces.
Those skilled in the art will readily occur to the disclosure its after considering specification and putting into practice disclosure disclosed herein
Its embodiment.This application is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes or
Person's adaptive change follows the general principle of the disclosure and including the undocumented common knowledge in the art of the disclosure
Or conventional techniques.Description and embodiments are considered only as illustratively, and the true scope and spirit of the disclosure are by following
Claim is pointed out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and
And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by appended claim.
Claims (18)
1. a kind of face identification method, which is characterized in that including:
Obtain the two field pictures for including face to be detected;
Intensive light stream figure is obtained according at least two field pictures, the intensive light stream figure includes any in the two field pictures
The optical flow velocity value of each pixel of frame image;
N number of human face region optical flow velocity histogram and N number of non-face region are determined according to the optical flow velocity value of each pixel
Optical flow velocity histogram;Wherein, the histogram spacing of each human face region optical flow velocity histogram is different, each described non-
The histogram spacing of human face region optical flow velocity histogram is different;The N is the integer more than or equal to 2;
According to N number of human face region optical flow velocity histogram and N number of non-face region optical flow velocity histogram and respectively
A corresponding preset weights acquisition human face region optical flow velocity histogram of histogram spacing and non-face region optical flow velocity Nogata
Average distance between figure;
When detecting that the average distance is less than pre-determined distance threshold value, it is prosthese face to determine the face to be detected.
2. according to the method described in claim 1, it is characterized in that, the optical flow velocity value according to each pixel determine it is N number of
Human face region optical flow velocity histogram and N number of non-face region optical flow velocity histogram, including:
Obtain the minimum light velocity value in the optical flow velocity value of each pixel;
Determine first histogram spacing of the minimum light velocity value for the 1st face area light stream velocity histogram;
It is adjacent previous human face region light according to the first histogram spacing of the latter human face region optical flow velocity histogram
The preset multiple of the first histogram spacing of velocity histogram is flowed, determines the first of each face area light stream velocity histogram
Histogram spacing;
N-th of human face region is determined according to the corresponding first histogram spacing of n-th of human face region optical flow velocity histogram
Each first optical flow velocity value section in optical flow velocity histogram, the n take 1,2 ... N successively;
To each first optical flow velocity value section, obtain and included in the optical flow velocity value of each pixel in the human face region
The first pixel quantity in the first optical flow velocity value section;
According to each first optical flow velocity value section the first pixel corresponding with each the first optical flow velocity value section
Quantity determines N number of human face region optical flow velocity histogram;
Determine second histogram spacing of the minimum light velocity value for the 1st non-face region optical flow velocity histogram;
It is adjacent previous non-face area according to the second histogram spacing of the non-face region optical flow velocity histogram of the latter
The preset multiple of second histogram spacing of domain optical flow velocity histogram determines that each non-face region optical flow velocity is straight
Second histogram spacing of square figure;
According to the corresponding second histogram spacing of n-th of non-face region optical flow velocity histogram determine described n-th it is non-face
Each second optical flow velocity value section in the optical flow velocity histogram of region, the n take 1,2 ... N successively;
To each second optical flow velocity value section, obtain in the non-face region and wrapped in the optical flow velocity value of each pixel
The second pixel quantity contained in the second optical flow velocity value section;
According to each second optical flow velocity value section the second pixel corresponding with each the second optical flow velocity value section
Quantity determines N number of non-face region optical flow velocity histogram.
It is 3. according to the method described in claim 1, it is characterized in that, described according to N number of human face region optical flow velocity Nogata
Figure preset weights corresponding with N number of non-face region optical flow velocity histogram and each histogram spacing obtain face area
Average distance between domain optical flow velocity histogram and non-face region optical flow velocity histogram, including:
The new matched pixel quantity in i-th pair optical flow velocity histogram is obtained, wherein, the i takes 1,2 ... N successively;Described i-th
Include a face area light stream velocity histogram and a non-face region optical flow velocity Nogata to optical flow velocity histogram
Figure, and the corresponding first histogram spacing of the human face region optical flow velocity histogram and the non-face region optical flow velocity are straight
It is identical that side schemes corresponding second histogram spacing;
According to the corresponding preset weights of histogram spacing of every a pair of of optical flow velocity histogram and per a pair of of optical flow velocity histogram
In new matched pixel quantity obtain between human face region optical flow velocity histogram and non-face region optical flow velocity histogram
Average distance.
4. according to the method described in claim 3, it is characterized in that, new obtained in i-th pair optical flow velocity histogram
With pixel quantity, including:
Obtain in the matched pixel quantity and the i-th pair optical flow velocity histogram in (i-1)-th pair of optical flow velocity histogram
With pixel quantity;
It determines in matched pixel quantity and the (i-1)-th pair of optical flow velocity histogram in the i-th pair optical flow velocity histogram
The difference of matched pixel quantity be the new matched pixel quantity in the i-th pair optical flow velocity histogram.
5. the according to the method described in claim 4, it is characterized in that, matching obtained in i-th pair optical flow velocity histogram
Pixel quantity, including:
Obtain j-th of first light streams speed in the human face region optical flow velocity histogram in the i-th pair optical flow velocity histogram
The corresponding third pixel value of angle value interzone spacing;
Obtain j-th of second light streams in the non-face region optical flow velocity histogram in the i-th pair optical flow velocity histogram
Corresponding 4th pixel value of velocity amplitude interzone spacing, wherein, the j takes 1,2 ... M successively;The M is i-th pair light stream speed
The quantity of the first optical flow velocity value interzone spacing in the human face region optical flow velocity histogram in histogram is spent, alternatively, the M
Between the second optical flow velocity value section in the non-face region optical flow velocity histogram in the i-th pair optical flow velocity histogram
Away from quantity, and the M is integer more than or equal to 1;
Determine the corresponding third pixel value of j-th of first optical flow velocity value interzone spacings and j-th of second light streams speed
Minimum value in 4th pixel value of angle value interzone spacing;
Determine that the sum of corresponding minimum value of each optical flow velocity value interzone spacing is described in the i-th pair optical flow velocity histogram
Matched pixel quantity in i-th pair optical flow velocity histogram.
6. according to claim 3-5 any one of them methods, which is characterized in that (i-1)-th pair of optical flow velocity histogram
Preset weights are more than the preset weights of the i-th pair optical flow velocity histogram.
7. according to the method described in claim 1, it is characterized in that, at least two field pictures of the face to be detected are:It is described
The adjacent two field pictures of face to be detected.
8. according to the method described in claim 1, it is characterized in that, the method further includes:
When detecting that the average distance is greater than or equal to the pre-determined distance threshold value, it is live body to determine the face to be detected
Face.
9. a kind of face identification device, which is characterized in that including:
First acquisition module, for obtaining at least two field pictures for including face to be detected;
Second acquisition module obtains intensive light stream for at least two field pictures according to first acquisition module acquisition
Figure, the intensive light stream figure include the optical flow velocity value of each pixel of any frame image in the two field pictures;
First determining module, the optical flow velocity value of each pixel for being obtained according to second acquisition module determine N
A face area light stream velocity histogram and N number of non-face region optical flow velocity histogram;Wherein, each human face region light stream speed
The histogram spacing for spending histogram is different, and the histogram spacing of each non-face region optical flow velocity histogram is different;The N is
Integer more than or equal to 2;
Third acquisition module, for the N number of human face region optical flow velocity histogram determined according to first determining module
Preset weights corresponding with N number of non-face region optical flow velocity histogram and each histogram spacing obtain human face region
Average distance between optical flow velocity histogram and non-face region optical flow velocity histogram;
Detection module, for detecting the human face region optical flow velocity histogram that the third acquisition module obtains and non-face
Whether the average distance between the optical flow velocity histogram of region is less than pre-determined distance threshold value;
Second determining module, for when the detection module detect the average distance be less than the pre-determined distance threshold value when,
It is prosthese face to determine the face to be detected.
10. device according to claim 9, which is characterized in that first determining module includes:First obtains submodule
Block, the first determination sub-module, the second determination sub-module, third determination sub-module, the second acquisition submodule, the 4th determining submodule
Block, the 5th determination sub-module, the 6th determination sub-module, the 7th determination sub-module, third acquisition submodule and the 8th determining submodule
Block;
First acquisition submodule, for obtaining in the optical flow velocity value for each pixel that second acquisition module obtains
Minimum light velocity value;
First determination sub-module, for determining that the minimum light velocity value that first acquisition submodule obtains is the
First histogram spacing of 1 face area light stream velocity histogram;
Second determination sub-module, for being according to the first histogram spacing of the latter human face region optical flow velocity histogram
The preset multiple of first histogram spacing of adjacent previous human face region optical flow velocity histogram, determines each face area
First histogram spacing of domain optical flow velocity histogram;
The third determination sub-module, for according between corresponding first histogram of n-th of human face region optical flow velocity histogram
Away from each first optical flow velocity value section determined in n-th of human face region optical flow velocity histogram, the n takes 1 successively,
2…N;
Second acquisition submodule, for each first optical flow velocity value area determined to the third determination sub-module
Between, it obtains and the first of the first optical flow velocity value section is contained in the optical flow velocity value of each pixel in the human face region
Pixel quantity;
4th determination sub-module, for according to each first optical flow velocity value section and each first light stream speed
Corresponding first pixel quantity in angle value section determines N number of human face region optical flow velocity histogram;
5th determination sub-module, for determining that the minimum light velocity value that first acquisition submodule obtains is the
Second histogram spacing of 1 non-face region optical flow velocity histogram;
6th determination sub-module, for the second histogram spacing according to the non-face region optical flow velocity histogram of the latter
The preset multiple of the second histogram spacing for adjacent previous non-face region optical flow velocity histogram, determines each
Second histogram spacing of a non-face region optical flow velocity histogram;
7th determination sub-module, for according to corresponding second histogram of n-th of non-face region optical flow velocity histogram
Spacing determines each second optical flow velocity value section in described n-th non-face region optical flow velocity histogram, and the n is successively
Take 1,2 ... N;
The third acquisition submodule, for each second optical flow velocity value area determined to the 7th determination sub-module
Between, it obtains and is contained in the of the second optical flow velocity value section in the non-face region in the optical flow velocity value of each pixel
Two pixel quantities;
8th determination sub-module, for according to each second optical flow velocity value section and each second light stream speed
Corresponding second pixel quantity in angle value section determines N number of non-face region optical flow velocity histogram.
11. device according to claim 9, which is characterized in that the third acquisition module includes:4th acquisition submodule
With the 5th acquisition submodule;
4th acquisition submodule, for obtaining the new matched pixel quantity in i-th pair optical flow velocity histogram, wherein, institute
It states i and takes 1,2 ... N successively;The i-th pair optical flow velocity histogram includes a face area light stream velocity histogram and one
Non-face region optical flow velocity histogram, and the corresponding first histogram spacing of the human face region optical flow velocity histogram and institute
It is identical to state the corresponding second histogram spacing of non-face region optical flow velocity histogram;
5th acquisition submodule, for according to the corresponding preset weights of histogram spacing per a pair of of optical flow velocity histogram
With what the 4th acquisition submodule obtained human face region is obtained per the new matched pixel quantity in a pair of of optical flow velocity histogram
Average distance between optical flow velocity histogram and non-face region optical flow velocity histogram.
12. according to the devices described in claim 11, which is characterized in that the 4th acquisition submodule includes:6th obtains son
Module and the 9th determination sub-module;
6th acquisition submodule, for obtaining the matched pixel quantity and described i-th in (i-1)-th pair of optical flow velocity histogram
To the matched pixel quantity in optical flow velocity histogram;
9th determination sub-module, for determining the i-th pair optical flow velocity Nogata of the 6th acquisition submodule acquisition
The difference of matched pixel quantity in figure and the matched pixel quantity in (i-1)-th pair of optical flow velocity histogram is described i-th
To the new matched pixel quantity in optical flow velocity histogram.
13. device according to claim 12, which is characterized in that the 6th acquisition submodule includes:7th obtains son
Module, the 8th acquisition submodule, the tenth determination sub-module and the 11st determination sub-module;
7th acquisition submodule is straight for obtaining the human face region optical flow velocity in the i-th pair optical flow velocity histogram
The corresponding third pixel value of j-th of first optical flow velocity value interzone spacings in square figure;
8th acquisition submodule, for obtaining the non-face region optical flow velocity in the i-th pair optical flow velocity histogram
Corresponding 4th pixel value of j-th of second optical flow velocity value interzone spacings in histogram, wherein, the j takes 1,2 ... M successively;
The M is the first optical flow velocity value area in the human face region optical flow velocity histogram in the i-th pair optical flow velocity histogram
Between spacing quantity, alternatively, the M be the i-th pair optical flow velocity histogram in non-face region optical flow velocity histogram
In the second optical flow velocity value interzone spacing quantity, and the M is integer more than or equal to 1;
Tenth determination sub-module, for determining the corresponding third pixel of j-th of first optical flow velocity value interzone spacings
Minimum value in 4th pixel value of value and j-th of second optical flow velocity value interzone spacings;
11st determination sub-module, for determining each optical flow velocity value section in the i-th pair optical flow velocity histogram
The sum of corresponding minimum value of spacing is the matched pixel quantity in the i-th pair optical flow velocity histogram.
14. according to claim 11-13 any one of them devices, which is characterized in that (i-1)-th pair of optical flow velocity histogram
Preset weights be more than the i-th pair optical flow velocity histogram preset weights.
15. device according to claim 9, which is characterized in that at least two field pictures of the face to be detected are:It is described
The adjacent two field pictures of face to be detected.
16. device according to claim 9, which is characterized in that described device further includes:Third determining module;
The third determining module, for work as the detection module detect the average distance be greater than or equal to it is described it is default away from
During from threshold value, it is living body faces to determine the face to be detected.
17. a kind of face identification device, which is characterized in that including:
Processor;
For storing the memory of processor-executable instruction;
Wherein, the processor is configured as:
Obtain at least two field pictures for including face to be detected;
Intensive light stream figure is obtained according at least two field pictures, the intensive light stream figure includes any in the two field pictures
The optical flow velocity value of each pixel of frame image;
N number of human face region optical flow velocity histogram and N number of non-face region are determined according to the optical flow velocity value of each pixel
Optical flow velocity histogram;Wherein, the histogram spacing of each human face region optical flow velocity histogram is different, each described non-
The histogram spacing of human face region optical flow velocity histogram is different;The N is the integer more than or equal to 2;
According to N number of human face region optical flow velocity histogram and N number of non-face region optical flow velocity histogram and respectively
A corresponding preset weights acquisition human face region optical flow velocity histogram of histogram spacing and non-face region optical flow velocity Nogata
Average distance between figure;
When detecting that the average distance is less than pre-determined distance threshold value, it is prosthese face to determine the face to be detected.
18. a kind of computer readable storage medium, is stored thereon with computer instruction, which is characterized in that the instruction is by processor
Claim 1-8 any one of them method and steps are realized during execution.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711310840.8A CN108154090B (en) | 2017-12-11 | 2017-12-11 | Face recognition method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711310840.8A CN108154090B (en) | 2017-12-11 | 2017-12-11 | Face recognition method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108154090A true CN108154090A (en) | 2018-06-12 |
CN108154090B CN108154090B (en) | 2021-10-01 |
Family
ID=62466119
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711310840.8A Active CN108154090B (en) | 2017-12-11 | 2017-12-11 | Face recognition method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108154090B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108875676A (en) * | 2018-06-28 | 2018-11-23 | 北京旷视科技有限公司 | Biopsy method, apparatus and system |
CN111047908A (en) * | 2018-10-12 | 2020-04-21 | 富士通株式会社 | Detection device and method for cross-line vehicle and video monitoring equipment |
WO2022127480A1 (en) * | 2020-12-15 | 2022-06-23 | 展讯通信(天津)有限公司 | Facial recognition method and related device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106204640A (en) * | 2016-06-29 | 2016-12-07 | 长沙慧联智能科技有限公司 | A kind of moving object detection system and method |
CN106228129A (en) * | 2016-07-18 | 2016-12-14 | 中山大学 | A kind of human face in-vivo detection method based on MATV feature |
CN107358206A (en) * | 2017-07-13 | 2017-11-17 | 山东大学 | Micro- expression detection method that a kind of Optical-flow Feature vector modulus value and angle based on area-of-interest combine |
-
2017
- 2017-12-11 CN CN201711310840.8A patent/CN108154090B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106204640A (en) * | 2016-06-29 | 2016-12-07 | 长沙慧联智能科技有限公司 | A kind of moving object detection system and method |
CN106228129A (en) * | 2016-07-18 | 2016-12-14 | 中山大学 | A kind of human face in-vivo detection method based on MATV feature |
CN107358206A (en) * | 2017-07-13 | 2017-11-17 | 山东大学 | Micro- expression detection method that a kind of Optical-flow Feature vector modulus value and angle based on area-of-interest combine |
Non-Patent Citations (3)
Title |
---|
WENZE YIN ET AL.: "A Face Anti-Spoofing Method Based on Optical Flow Field", 《2016 IEEE 13TH INTERNATIONAL CONFERENCE ON SIGNAL PROCESSING》 * |
姜波等: "光流模值估计的微表情捕捉", 《浙江大学学报(工学版)》 * |
王凌等: "一种基于光流场的复杂背景下人脸定位方法", 《计算机工程与应用》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108875676A (en) * | 2018-06-28 | 2018-11-23 | 北京旷视科技有限公司 | Biopsy method, apparatus and system |
CN108875676B (en) * | 2018-06-28 | 2021-08-10 | 北京旷视科技有限公司 | Living body detection method, device and system |
US11195037B2 (en) | 2018-06-28 | 2021-12-07 | Beijing Kuangshi Technology Co., Ltd. | Living body detection method and system, computer-readable storage medium |
CN111047908A (en) * | 2018-10-12 | 2020-04-21 | 富士通株式会社 | Detection device and method for cross-line vehicle and video monitoring equipment |
CN111047908B (en) * | 2018-10-12 | 2021-11-02 | 富士通株式会社 | Detection device and method for cross-line vehicle and video monitoring equipment |
WO2022127480A1 (en) * | 2020-12-15 | 2022-06-23 | 展讯通信(天津)有限公司 | Facial recognition method and related device |
Also Published As
Publication number | Publication date |
---|---|
CN108154090B (en) | 2021-10-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI781359B (en) | Face and hand association detection method and device, electronic device and computer-readable storage medium | |
CN106295566B (en) | Facial expression recognizing method and device | |
TWI766286B (en) | Image processing method and image processing device, electronic device and computer-readable storage medium | |
US10007841B2 (en) | Human face recognition method, apparatus and terminal | |
CN105608425B (en) | The method and device of classification storage is carried out to photo | |
CN107239535A (en) | Similar pictures search method and device | |
CN109522910A (en) | Critical point detection method and device, electronic equipment and storage medium | |
CN104850852B (en) | Feature vector computational methods and device | |
CN107688781A (en) | Face identification method and device | |
CN105426878B (en) | Face cluster method and device | |
CN107944367B (en) | Face key point detection method and device | |
CN107368810A (en) | Method for detecting human face and device | |
CN106980840A (en) | Shape of face matching process, device and storage medium | |
CN109801270A (en) | Anchor point determines method and device, electronic equipment and storage medium | |
CN105528078B (en) | The method and device of controlling electronic devices | |
CN109978891A (en) | Image processing method and device, electronic equipment and storage medium | |
CN109034150B (en) | Image processing method and device | |
CN105335714B (en) | Photo processing method, device and equipment | |
CN105100193B (en) | Cloud business card recommended method and device | |
CN106503682A (en) | Crucial independent positioning method and device in video data | |
CN108154090A (en) | Face identification method and device | |
CN108154466A (en) | Image processing method and device | |
CN104573642B (en) | Face identification method and device | |
CN108491177A (en) | Space appraisal procedure and device | |
CN107844766A (en) | Acquisition methods, device and the equipment of facial image fuzziness |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |