The method for building up of multi-orientation Face picture library
Technical field
The invention belongs to technical field of face recognition, and in particular to the method for building up of multi-orientation Face picture library.
Background technology
Recognition of face, is a kind of biological identification technology that facial feature information based on people carries out identification.With shooting
Machine or photographic head image of the collection containing face or video flowing, and automatic detect and track face in the picture, and then to detection
To face carry out a series of correlation techniques of face, generally also referred to as Identification of Images, facial recognition.
The basis of recognition of face is face picture storehouse, only establishes complete effectively face picture storehouse, after just carrying out
Continuous recognition of face step.The method for building up in face picture storehouse has following two at present:1st, the field of certificate is handled in public security bureau etc.
Close, the positive face picture of gathered person is shot using photographic head, and is stored in data base, be also adopted by recognition of face in future by
The positive face picture of identification person is compared, and this kind of face picture storehouse and corresponding recognition methodss can be only applied to gathered person, quilt
The special occasions that identification person coordinates, such as bank, entry and exit port etc., restricted application;2nd, it is unaware of in collected people, not
In the case of cooperation, facial image is gathered in video streaming using CCTV camera and face picture storehouse is set up, but is had
The restriction of body equipment, the image definition of video flowing are relatively low, and the face picture unsystematic and correlation in face picture storehouse
Property, leverage the accuracy rate of recognition of face.
The content of the invention
The purpose of the present invention is to propose to a kind of method for building up of multi-orientation Face picture library, using the polygonal of the method foundation
Degree face picture storehouse can provide comprehensively, the face information of system, very convenient follow-up recognition of face.
The method for building up of the multi-orientation Face picture library of the present invention comprises the steps:
A:Image acquisition:Obtain the human face photo of multiple different angles of the same personnel that are taken;
B:Angle mark:Angle computing is carried out to the face in human face photo, only retains the human face photo in predetermined angular,
And the human face photo to remaining marks its X deflection angle x and vertical deflection angle y;
C:Matrixing:The human face photo matrix of a M rows N row is set up, each matrix element [a, b] corresponds to one and makes a reservation for
The angular range of the human face photo corresponding to the human face photo in angular range, wherein matrix element [a, b] is as follows:[(a-(M-
1)/2 ± 0.5) × K/M, (b- (N-1)/2 ± 0.5) × J/N], wherein K is predetermined face level angle maximum span, and J is
Predetermined face vertical angle maximum span, M, N are the odd number more than 1, and a is the integer in [0, M-1] scope, and b is [0, N-
1] integer in scope;The human face photo with angle mark obtained in step B is filled into into face according to its angle mark
Correspondence position in matrix of photos, specific fill method are as follows:By the people that X deflection angle is x, vertical deflection angle is y
Face photo is filled in matrix element [a, b], wherein a=(M-1) ÷ 2+ROUND (x ÷ (K ÷ M)), b=(N-1) ÷ 2+ROUND
(y÷(J÷N));
D:Populated human face photo matrix is stored in into data base.
In above-mentioned method, the human face photo of clearly different angles is got first by shooting, then by square
The form of battle array storing the human face photo of different angles, the human face photo in the range of each matrix element correspondence certain angle, from
And the human face photo matrix in predetermined angular range is established, the characteristic information of all angles of face can be embodied.In the future
During recognition of face, target human face photo is obtained first, and angle computing is carried out to target human face photo, obtain target human face photo
X deflection angle x and vertical deflection angle y, further according to deflection angle and the matrix element transformational rule of above-mentioned steps C, obtain
To the matrix subscript of target human face photo;It is last that all personnel is extracted from data base to should target human face photo under matrix
Compare, when characteristic similarity is higher than predetermined threshold value, be then judged as same person, if target people under all personnel matrix
Face photo all compares and finishes and be not judged as same person, then by the matrix subscript phase in the target human face photo and data base
Adjacent matrix element is compared, the lookup until completing whole data base.
Further, in the step C, if the human face photo corresponding to same matrix element is more than one, only
Retain wherein one photo closest to the matrix element angular centre, abandon unnecessary photo, so can ensure quality
On the premise of, overall amount of data is reduced as far as possible, and facilitates follow-up recognition of face.
Further, the image acquisition of the step A has following two:
1st, shoot when, the face of the personnel of being taken is continuously shot, and require be taken personnel head with just right
Video camera is original state, carries out different degrees of horizontal and vertical twisting.This kind of mode is applied to the personnel's cooperation that is taken
Occasion, for example, say public security bureau etc..
2nd, shoot when, the people in pickup area is continuously shot using image capture device, the personnel of being taken without
Image acquisition need to be completed in the case of knowing the inside story, obtain the portrait photo of the different angles of the personnel of being taken, then again portrait is shone
Face in piece detected and extracted, and generates the human face photo of multiple different angles.This kind of mode is applied to and need not be taken
Personnel coordinate occasion, for example say on the way, the monitoring camera of each cell can gather, expanded collection approach, have
Beneficial to quick, the comprehensive foundation of data base.
In above-mentioned second acquisition mode, using Haar classifier and adaboost algorithms to the face in portrait photo
Detected and extracted.
M in above-mentioned step C is the odd number more than 1, and this allows for, and face is generally symmetrical, and such face shines
The axis matrix element of piece matrix corresponds to the axis of face just, and especially, in the step C, matrix element is provided with
Symmetrical photo property and shooting photo property;When often increasing a new human face photo in matrix, the human face photo to be detected
Whether symmetry elements in a matrix are empty, and if sky, then the flip horizontal human face photo is to be packed into as symmetry elements
In matrix, while the attribute of the labelling symmetry elements is symmetrical photo, if be somebody's turn to do during follow-up matrix fill-in
Human face photo obtained by the shooting of angle corresponding to symmetry elements, then replace flip horizontal using the human face photo obtained by the shooting
Resulting symmetrical photo, and the attribute of the symmetry elements is changed to shoot photo;The symmetry elements of matrix element [a, b] are
[M-1-a, b].
Using monitoring camera in the people that is taken it is ignorant or ill-matched in the case of gather picture, typically can all deposit
In the incomplete situation of collection information(The human face photo of i.e. some angles is not collected), under this kind of situation, human face photo square
The element of battle array occurs vacancy and reduces the feasibility of follow-up recognition of face.The present invention is according to the general symmetrical original of face
The human face photo for photographing is carried out flip horizontal and is filled in the symmetrical position for failing to collect by reason, is ensureing certain
On the premise of accuracy, the foundation of human face photo matrix accelerated, and during follow-up improving, can also be using shooting institute
The human face photo for obtaining replaces the symmetrical photo obtained by flip horizontal, improves the accuracy of data.
Due to utilizing the monitoring camera of different regions, diverse location come gathered data, and same person may
Where occurring in difference captured by different monitoring cameras, and different human face photo matrixes are set up, it is now single
May there is symmetrical photo more, vacancy as data volume is fewer in the human face photo matrix set up by monitoring camera
Matrix element hands over the larger situation of the angular deviation of many, practical photograph and the matrix element angular centre, and said circumstances all can shadow
Ring accuracy, the availability of human face photo matrix.In order to improve the method for replanting, it is necessary to by captured by each monitoring camera
Human face photo matrix carries out integrated treatment, to obtain more accurate, comprehensive human face data information.For the problems referred to above, this
Bright following methods especially set out:
In the D steps, data base is received by the human face photo matrix acquired in different acquisition approach;Will be populated
Human face photo matrix when being stored in data base, enter line retrieval first in data base, see whether have in data base and to be stored in
Human face photo similar matrixes degree exceedes the human face photo matrix of predetermined similarity:If it is not, the populated face is shone
Piece matrix is stored in data base;If it has, then by the human face photo of the homography element in two similar human face photo matrixes
It is compared one by one, only retains the photo closest to the matrix element angular centre, abandon remaining photo, so as to by two phase
As human face photo matrix merge into a new human face photo matrix, and human face photo matrix original in replacement data storehouse and
It is stored in data base.Thus the human face photo matrix of the corresponding same person acquired in multiple collection approach can be closed
And so that the human face photo of the human face photo matrix of the people more accurately, completely, effectively improves the convenience of follow-up recognition of face
And accuracy.
Further, the method for comparing two face matrix of photos similarities in above-mentioned D steps is as follows:Contrast two first
In human face photo matrix, whether the similarity of the minimum matrix element of face deflection angle is more than predetermined higher limit, if greater than
Higher limit, then judge two face matrix of photos it is corresponding be same person photo, two face matrix of photos are closed
And;If in two face matrix of photos the similarity of the minimum matrix element of face deflection angle be less than predetermined higher limit and
More than predetermined lower limit, then continue to compare the similarity of other matrix elements in two face matrix of photos, if two
In human face photo matrix, similarity exceedes the 2/ of matrix element total number more than the quantity of the matrix element of predetermined lower limit
3, then judge two face matrix of photos it is corresponding be same person photo, two face matrix of photos are merged, it is no
Then judge two face matrix of photos it is corresponding be not same person photo, do not merge.
The method for building up of the multi-orientation Face picture library of the present invention is not only suitable for the data of the occasions such as traditional public security bureau
Collection, and data acquisition can be carried out using widely distributed monitoring camera, so as to rapidly set up multi-orientation Face figure
Valut, and data are caused as far as possible accurately during foundation, while reducing the data volume of data base, it is very suitable for big at present
The application of data industry, for example succeed in reaching an agreement the recognition of face at row port to monitor etc., with good practicality and commercial promise.
Description of the drawings
Fig. 1 is the flow chart of the method for building up of the multi-orientation Face picture library of embodiment 1.
Fig. 2 is face deflection angle schematic diagram in the present invention.
Fig. 3 is human face photo matrix structure schematic diagram in the present invention.
Fig. 4 is the flow chart of the method for building up of the multi-orientation Face picture library of embodiment 2.
Specific embodiment
It is below against accompanying drawing, by the description to embodiment, each as involved by the specific embodiment of the present invention
The shape of component, the mutual alignment between construction, each several part and annexation, the effect of each several part and operation principle etc. are made into one
The detailed description of step.
Embodiment 1:
As shown in figure 1, the method for building up of the multi-orientation Face picture library of the present embodiment comprises the steps:
A:Image acquisition:The face of the personnel of being taken is continuously shot, and require be taken personnel head with just
It is original state to video camera, carries out different degrees of horizontal and vertical twisting, so as to obtain many of the same personnel that are taken
The human face photo of Zhang Butong angles(This kind of mode is applied to the occasion of the personnel's cooperation that is taken, for example, say public security bureau etc., therefore claim
For formula image acquisition);
B:Angle mark:As shown in Fig. 2 carrying out angle computing to the face in human face photo, only retain in predetermined angular
Human face photo, and the human face photo to remaining marks its X deflection angle x and vertical deflection angle y;Wherein just
It is as follows to the face deflection angle during original state of video camera:X=0, y=0;
C:Matrixing:As shown in figure 3, setting up the human face photo matrix of a M rows N row, each matrix element [a, b] is right
Answer the human face photo in a predetermined angular range, the wherein angular range of the human face photo corresponding to matrix element [a, b] such as
Under:[(a- (M-1)/2 ± 0.5) × K/M, (b- (N-1)/2 ± 0.5) × J/N], wherein K be predetermined face level angle most
Large span, J is predetermined face vertical angle maximum span, and M, N are the odd number more than 1, in the present embodiment, M=9, N=5,
K=90, J=50;A is the integer in [0, M-1] scope, and b is the integer in [0, N-1] scope;By having for obtaining in step B
The human face photo of angle mark is filled into the correspondence position in human face photo matrix, specific fill method according to its angle mark
It is as follows:The human face photo that X deflection angle is x, vertical deflection angle is y is filled in matrix element [a, b], wherein a=
(M-1) ÷ 2+ROUND (x ÷ (K ÷ M)), b=(N-1) ÷ 2+ROUND (y ÷ (J ÷ N));For example say, if the water of human face photo
It is 2.5 that flat deflection angle x is -5, vertical deflection angle y, then:
a=(M-1)÷2+ROUND(x÷(K÷M))=(9-1)÷2+ROUND(-5÷(90÷9))=4+ROUND(-0.5)
=4;
b=(N-1)÷2+ROUND(y÷(J÷N))=(5-1)÷2+ROUND(2.5÷(50÷5))=2+ROUND
(0.25)=2;
That is, the human face photo that X deflection angle x is -5, vertical deflection angle y is 2.5 is filled into square
In array element element [4,2], calculated by [(a- (M-1)/2 ± 0.5) × K/M, (b- (N-1)/2 ± 0.5) × J/N] formula,
The corresponding angular range of the matrix element [4,2] is [- 5~5, -5~5], i.e., matrix element [4,2] is in this matrix
Most middle element;
Certainly, different calculating platforms may be -1 or 0 to ROUND (- 0.5) value, but this can ensure same
Human face photo one matrix element of correspondence of deflection angle, rather than the multiple matrixes of human face photo correspondence of same deflection angle
Element, therefore do not result in matrix fill-in mistake;
D:Populated human face photo matrix is stored in into data base.
In above-mentioned method, the human face photo of clearly different angles is got first by shooting, then by square
The form of battle array storing the human face photo of different angles, the human face photo in the range of each matrix element correspondence certain angle, from
And the human face photo matrix in predetermined angular range is established, the characteristic information of all angles of face can be embodied.In the future
During recognition of face, target human face photo is obtained first, and angle computing is carried out to target human face photo, obtain target human face photo
X deflection angle x and vertical deflection angle y, further according to deflection angle and the matrix element transformational rule of above-mentioned steps C, obtain
To the matrix subscript of target human face photo;It is last that all personnel is extracted from data base to should target human face photo under matrix
Compare, when characteristic similarity is higher than predetermined threshold value, be then judged as same person, if target people under all personnel matrix
Face photo all compares and finishes and be not judged as same person, then by the matrix subscript phase in the target human face photo and data base
Adjacent matrix element is compared, the lookup until completing whole data base.
In above-mentioned step C, surpass if as the human face photo caused the reason for shooting corresponding to same matrix element
One is crossed, then only retains wherein one photo closest to the matrix element angular centre, abandon unnecessary photo, so can be with
On the premise of quality is ensured, overall amount of data is reduced as far as possible, and facilitates follow-up recognition of face.
Embodiment 2:
As shown in figure 4, the method for building up of the multi-orientation Face picture library of the present embodiment comprises the steps:
A:Image acquisition:The people in pickup area is continuously shot using video camera or monitoring camera, is being clapped
Image acquisition is completed in the case of personnel are taken the photograph without the need for knowing the inside story, the portrait photo of the different angles of the personnel of being taken is obtained(This kind of side
Formula is applied to the occasion of the personnel's cooperation that need not be taken, therefore referred to as non-formula image acquisition), then reuse Haar classification
Device and adaboost algorithms detected and extracted to the face in portrait photo, generates the human face photo of multiple different angles,
So as to obtain the human face photo of multiple different angles of the same personnel that are taken;
B:Angle mark:Angle computing is carried out to the face in human face photo, only retains the human face photo in predetermined angular,
And the human face photo to remaining marks its X deflection angle x and vertical deflection angle y;
C:Matrixing:The human face photo matrix of a M rows N row is set up, each matrix element [a, b] corresponds to one and makes a reservation for
The angular range of the human face photo corresponding to the human face photo in angular range, wherein matrix element [a, b] is as follows:[(a-(M-
1)/2 ± 0.5) × K/M, (b- (N-1)/2 ± 0.5) × J/N], wherein K is predetermined face level angle maximum span, and J is
Predetermined face vertical angle maximum span, M, N are the odd number more than 1, and a is the integer in [0, M-1] scope, and b is [0, N-
1] integer in scope;The human face photo with angle mark obtained in step B is filled into into face according to its angle mark
Correspondence position in matrix of photos, specific fill method are as follows:By the people that X deflection angle is x, vertical deflection angle is y
Face photo is filled in matrix element [a, b], wherein a=(M-1) ÷ 2+ROUND (x ÷ (K ÷ M)), b=(N-1) ÷ 2+ROUND
(y÷(J÷N));
Matrix element is provided with symmetrical photo property and shoots photo property;Often increase a new human face photo to matrix
When middle, to detect that whether human face photo symmetry elements in a matrix are empty, if sky, then flip horizontal human face photo
To be packed in matrix as symmetry elements, while the attribute of the labelling symmetry elements is symmetrical photo, if in follow-up square
The human face photo corresponding to the symmetry elements obtained by the shooting of angle is obtained in battle array filling process, then using obtained by the shooting
Human face photo replaces the symmetrical photo obtained by flip horizontal, and changes the attribute of the symmetry elements to shoot photo;Matrix element
The symmetry elements of plain [a, b] are [M-1-a, b];
D:Populated human face photo matrix is stored in into data base:Data base is received by acquired in different acquisition approach
Human face photo matrix;When populated human face photo matrix is stored in data base, enters line retrieval first in data base, see number
According to the human face photo matrix whether having in storehouse with the human face photo similar matrixes degree to be stored in more than predetermined similarity:If not yet
Have, then the populated human face photo matrix is stored in into data base;If it has, then by two similar human face photo matrixes
The human face photo of homography element is compared one by one, is only retained the photo closest to the matrix element angular centre, is abandoned
Remaining photo, so as to two similar human face photo matrixes are merged into a new human face photo matrix, and replacement data
Human face photo matrix original in storehouse and be stored in data base.
The method for comparing two face matrix of photos similarities in above-mentioned D steps is as follows:Two human face photos are contrasted first
In matrix, whether the similarity of the minimum matrix element of face deflection angle is more than predetermined higher limit, if greater than higher limit,
Then judge two face matrix of photos it is corresponding be same person photo, two face matrix of photos are merged;If
In two face matrix of photos, the similarity of the minimum matrix element of face deflection angle is less than predetermined higher limit and more than pre-
Fixed lower limit, then continue to compare the similarity of other matrix elements in two face matrix of photos, if two faces shine
In piece matrix, similarity exceedes the 2/3 of matrix element total number more than the quantity of the matrix element of predetermined lower limit, then sentence
It is the photo of same person that disconnected two face matrix of photos are corresponding, two face matrix of photos is merged, is otherwise judged
It is not the photo of same person that two face matrix of photos are corresponding, is not merged.
The present embodiment is applied to the occasion of the personnel's cooperation that need not be taken, for example say on the way, the monitoring of each cell takes the photograph
The approach of collection as head can be gathered, is expanded, has been conducive to quick, the comprehensive foundation of data base, and can be adopted multiple
The human face photo matrix of the corresponding same person acquired in collection approach is merged so that the face of the human face photo matrix of the people
Photo more accurately, completely, effectively improves the convenience and accuracy of follow-up recognition of face.