Summary of the invention
The method that the object of the invention is to consider the problems referred to above and provide a kind of angle removal search human face posture from three-dimensional to change uses the method can improve the accuracy of people's face ASM shape search, and then improves precision and the efficient of whole face identification system.
Technical scheme of the present invention is:
The three-dimensional transformation search method of feature point extraction in a kind of facial image, at first make up the standard three-dimensional model of people's face, secondly obtain the third dimension coordinate of two-dimension human face unique point as the basis take this standard three-dimensional model, carry out the search of three-dimension varying ASM shape as the basis take three-dimensional coordinate at last, namely comprise the steps:
(1) makes up the standard three-dimensional model of people's face, comprise the three-dimensional coordinate (x, y, z) (wherein the front of people's face is the XY plane) of human face characteristic point in the three-dimensional model;
(2) take three-dimensional master pattern as the basis, according to the Two-dimensional Statistical model (x of the human face characteristic point of ASM training set
1, y
1, x
2, y
2..., x
n, y
n), determine in proportion the third dimension coordinate (z of each unique point in the Two-dimensional Statistical model
i);
(3) with the basic configuration that comprises three-dimensional coordinate respectively from around Z axis, X-axis, Y direction rotation, zooming and panning, the result with conversion projects to the XY plane at last, goes to approach the shape of current search by the result of projection.
Described step (1) people's face standard three-dimensional model takes the method for actual measurement to make up, and at first selects the people's face more than 50 in training set, the three-dimensional coordinate (x of each unique point of actual measurement
1, y
1, z
1, x
2, y
2, z
2..., x
n, y
n, z
n), wherein third dimension coordinate (z axle) begins to measure as zero plane with the central plane of neck, and above data are carried out normalized, then asks its mean value, just obtains the standard faces three-dimensional model.
Described step (2) realizes as follows:
1) the foundation third dimension (Z direction) the coordinate array SZ=[z corresponding with the Two-dimensional Statistical model of the human face characteristic point of ASM training set
1, z
2..., z
n], it is data from the third dimension coordinate of standard faces three-dimensional model, and with the ASM training set in human face characteristic point corresponding one by one;
2) in people's face standard three-dimensional model, choose three unique points, and record its two dimensional surface coordinate figure (x, y), calculate accordingly by these three points.Described three unique points are tail of the eyes of choosing two eyes and nose totally three points (P1, P2, P3) (with point 13,26 among Fig. 2,41 corresponding), in the standard faces three-dimensional model, this two dimensional surface coordinate of 3 is known, if coordinate is respectively (xc1, yc1), (xc2, yc2), (xc3, yc3); Corresponding three point coordinate also are known in the Two-dimensional Statistical model of the human face characteristic point of ASM training set, establish its coordinate and are respectively (x1, y1), (x2, y2), (x3, y3).
3) ask horizontal zoom factor C by a P1, P2
x, ask vertical zoom factor C by mid point and the P3 of P1 and P2
y, as follows respectively:
Get both mean value at the zoom factor of Z direction, that is:
C
z=(C
x+C
y)/2
Pass through C
zThe third dimension coordinate that multiplies each other and just can obtain two-dimension human face image with third dimension coordinate array SZ, i.e. Z axis coordinate.
Described step (3) is the anglec of rotation θ that needs to seek three directions
x, θ
y, θ
z, zooming parameter S
x, S
y, S
z, and the side-play amount T of three directions
x, T
y, T
z, calculate T for convenient
zBe made as 0, the original shape vector x of given people's face and target shape vector x ', both three-dimensional face carries out geometric transformation M to obtain the minor increment of x and x ' in the projection on XY plane, namely minimizes following formula:
E(θ
x,θ
y,θ
z,S
x,S
y,S
z,T
x,T
y)=|M(x)-x′|
2 (1)
Adopt the method for two step conversion iteration approximations to make formula (1) approach optimum parameter value.
The first step conversion of described two step conversion is to rotate and translation around Z axis on the XY plane; Detailed process is as follows: given two similar shape x and x ', seek anglec of rotation θ, yardstick convergent-divergent s, translational movement t, to x make geometric transformation X=M (s, θ) [x]+t so that the x after x ' and the conversion apart from minimum:
E=(M(s,θ)[x]+t-x′)
T(M(s,θ)[x]+t-x′) (2)
Wherein:
t=(t
x,t
y,...t
x,t
y)
T
Make a=scos θ, b=ssin θ has like this: s
2=a
2+ b
2, θ=tan
-1(b/a)
So:
Wherein a, b, t
x, t
yBe exactly calculative four attitude parameters, by seeking these four parameters so that in (2) formula the value of E minimum, thereby so that actual variation be consistent with calculating.
The second step conversion of described quadratic transformation is to rotate around Y-axis and Z axis respectively, and projects on the XY plane, and implementation procedure is as follows:
If (X
z, Y
z) be through horizontally rotating (around Z axis) and the displacement after coordinate (the z coordinate is constant), it at first rotates θ around Y-axis
yAngle, zoom factor are S
y, transversal displacement is T
X ', then have:
Rotate θ around X-axis again
xAngle, zoom factor is S simultaneously
x, the vertical misalignment amount is T
Y ', then have:
Above two formulas of simultaneous, and to the XY plane projection can get the coordinate after the conversion:
Make in the equation (8) a
y=S
y* cos θ
y, b
y=S
y* sin θ
y, a
x=S
x* cos θ
x, b
x=S
x* sin θ
x, and the actual coordinate of establishing after the conversion is (x ', y '), getting in equation (8) the substitution formula (1):
|X
z*a
y+Z*b
y+T
x′-x′|
2+|Y
z*a
x-(-X
z*b
y+Z*a
y)*b
x+T
y′-y′|
2 (9)
Make (9) formula minimum, parameter wherein asked local derviation, can get:
X
z*a
y+Z*b
y+T
x′-x′=0 (10)
Y
z*a
x-(-X
z*b
y+Z*a
y)*b
x+T
y′-y′=0 (11)
By formula (10) is carried out multiple linear regression analysis, can be in the hope of parameter value a wherein
y, b
y, T
X 'If total n unique point, detailed process is as follows:
1) averages
A
y, b
y, T
X 'Value substitution formula (11), using the same method can be in the hope of a
x, b
x, T
Y 'Second portion conversion M
2Expression, then:
The most approaching with impact point.
Described iterative approach refer to unique point the XY plane around Z axis rotate and translation after coordinate (X
z, Y
z) intermediateness be to adopt repeatedly the method for iterative approach,
If intermediateness is (X
z, Y
z), concrete steps are as follows:
1) initial seasonal (X
z, Y
z) be end value (x ', y ');
2) (X
z, Y
z) substitution formula (1) replaces x ' wherein, tries to achieve in the formula (3) four transformation parameter a, b, t according to the ASM transform method of current two dimension
x, t
y
3) parameter a, b, t
x, t
ySubstitution formula (3) is obtained intermediateness (X
z, Y
z);
4) (X
z, Y
z) carry out second portion conversion (M
2), obtain parameter a
y, b
y, T
X ', a
x, b
x, T
Y '
5) be the basis with (x ', y '), calculate M
2Inverse transformation, can draw intermediateness (X '
z, Y '
z) namely:
(X '
z, Y '
z) substitution formula (1), try to achieve in the formula (3) four transformation parameter a, b, t according to two-dimentional ASM transform method
x, t
yThen changed for (3) step over to, carry out iterative computation, iteration just can obtain meeting 10 parameters of accuracy requirement for 10 times.
The present invention with respect to the beneficial effect of prior art is: the three-dimensional transformation search method of ASM of the present invention is compared with current two-dimensional search method, has reflected more truly the variation of human face posture, thereby has better unique point search Approximation effect.
Embodiment
The process flow diagram of people's face three-dimensional transformation search method of the present invention as shown in Figure 1, people's head and face organ according to this point, can construct the three-dimensional face model of a standard having similarity aspect shape and the position; The present invention determines the three-dimensional coordinate of face features point just by this master pattern, then carry out the ASM shape search of three-dimension varying as the basis take three-dimensional coordinate; Because be two dimensional image during actual search, so need to project to two dimensional surface at last, the process of three-dimensional search conversion is:
The first, the standard three-dimensional model (x of structure people face
1, y
1, z
1, x
2, y
2, z
2..., x
n, y
n, z
n) (wherein the front of people's face is the XY plane), the unique point in the three-dimensional model should comprise unique point in the actual two dimensional image (be the adaptability of embodiment standard three-dimensional model, can more than the unique point in the actual two dimensional image).
The second, carrying out people's face two dimensional image when search, take three-dimensional master pattern as the basis, according to Two-dimensional Statistical model (the basic configuration) (x of the human face characteristic point of ASM training set
1, y
1, x
2, y
2..., x
n, y
n), determine in proportion the third dimension coordinate (zi) of each unique point in the Two-dimensional Statistical model.
The 3rd, when shape search conversion, basic configuration is respectively from around Z axis, X-axis, Y direction rotation, zooming and panning, and the result with conversion projects to the XY plane at last, goes to approach the shape of current search by the result of projection.
Below the main content of describing three aspects, the one, the three-dimensional coordinate of the standard obtaining three-dimensional model two-dimension human face unique point by people's face; The 2nd, adopt the method for two step conversion and iteration to obtain 10 transformation parameters when carrying out three-dimensional search; The 3rd, the implementation result test.
(1) third dimension coordinate of the Two-dimensional Statistical model of human face characteristic point obtains
Generally speaking, people's face section organ is not only fixed at the relative position of two dimensional surface, and the height of the third dimension (face contour) also is basically identical.Although the height of people's face section organ may have certain difference, such as: it is low that people's nose has height to have, if but with the reference plane as third dimension coordinate of the central plane (center of three-dimensional rotation) of neck, then this difference is just very little, does not affect search precision when actual search is approached.The standard three-dimensional model of people's face also consists of with unique point, specifically represents with the three-dimensional coordinate form, that is: (x
1, y
1, z
1, x
2, y
2, z
2..., x
n, y
n, z
n); Wherein should comprise all unique points selected in the two-dimension human face, when Fig. 2 was test, the unique point schematic diagram that two dimensional image is selected had been chosen altogether 59 unique points.The acquisition methods of the third dimension coordinate of the Two-dimensional Statistical model of human face characteristic point is as follows:
(1) the foundation third dimension (Z direction) the coordinate array SZ=[z corresponding with the Two-dimensional Statistical model of the human face characteristic point of ASM training set
1, z
2..., z
n], it is data from the third dimension coordinate of standard faces three-dimensional model, and with the ASM training set in human face characteristic point corresponding one by one.
(2) in the standard faces three-dimensional model, choose three unique points, and record its planimetric coordinates value.During actual test, what choose is three points of the tail of the eye and nose (P1, P2, P3) (with point 13,26 among Fig. 2,41 corresponding) of two eyes.In the standard faces three-dimensional model, this planar coordinate of 3 is known, establishes coordinate and is respectively (xc1, yc1), (xc2, yc2), (xc3, yc3); Correspondence three point coordinate of the Two-dimensional Statistical model of the human face characteristic point of ASM training set also are known, establish its coordinate and are respectively (x1, y1), (x2, y2), (x3, y3).
(3) ask horizontal zoom factor C by a P1, P2
x, ask vertical zoom factor C by mid point and the P3 of P1 and P2
y, as follows respectively:
Get both mean value at the zoom factor of Z direction, that is:
C
z=(C
x+C
y)/2
Pass through C
zThe third dimension coordinate that multiplies each other and just can obtain two-dimension human face image with third dimension coordinate array SZ, i.e. Z axis coordinate.
(2) three-dimension varying search
The original shape vector x of given people's face and target shape vector x ', both three-dimensional face is in the projection on XY plane.Realized the three dimensional stress of original shape vector x by the operation of first, the three-dimensional search conversion be exactly carry out on the x basis of three dimensional stress the three-dimension varying removal search approach the target shape vector x '.Compare with the ASM searching method of current facial image, three-dimensional ASM searching method need to be sought the anglec of rotation θ of three directions
x, θ
y, θ
z, zooming parameter S
x, S
y, S
z, and the side-play amount T of three directions
x, T
y, T
z(owing to finally will project to the XY plane, calculate for convenient, Tz can be made as 0) carries out geometric transformation M to obtain the minor increment of x and x ', namely minimizes following formula:
E(θ
x,θ
y,θ
z,S
x,S
y,S
z,T
x,T
y)=|M(x)-x′|
2 (1)
Conventional minimized method is that the parameters on the left side in the following formula is asked partial derivative, and then making it is 0, unites at last to find the solution separate equation and draw the parameters value.But because its parameter is numerous, and parameter all with certain any (x, y) coordinates correlation, above-mentioned conventional method may be obtained its parameter value hardly.Therefore, adopted the method for two step conversion and iteration to remove to approach optimum parameter value.
1) two step conversion
Whole three-dimension varying is divided into two parts: first rotates and translation around Z axis on the XY plane; Second portion is to rotate around Y-axis and Z axis respectively, and projects on the XY plane.Wherein: the conversion of first is consistent with current ASM search shape process, and detailed process is as follows: given two similar shape x and x ', seek anglec of rotation θ, yardstick convergent-divergent s, translational movement t, to x make geometric transformation X=M (s, θ) [x]+t so that the x after x ' and the conversion apart from minimum:
E=(M(s,θ)[x]+t-x′)
T(M(s,θ)[x]+t-x′) (2)
Wherein:
t=(t
x,t
y,...t
x,t
y)
T
Make a=scos θ, b=ssin θ has like this: s
2=a
2+ b
2, θ=tan
-1(b/a)
So:
Wherein a, b, t
x, t
yBe exactly calculative four attitude parameters, by seeking these four parameters so that in the formula (2) value of E minimum, thereby so that actual variation be consistent with calculating.Computing method are identical with the ASM transform method of current two dimension.Be provided with n unique point, computation process is as follows:
(1) wushu (3) substitution formula (2) gets:
(2) describe for convenient, define following and value:
(3) each parameter in the formula (4) is asked partial derivative, and makes equation equal 0 can getting:
(4) to top system of equations (5) simultaneous solution, calculate for simplifying, the center of original state x is moved on to initial point, like this S
x=S
y=0.So, can obtain the value of 4 parameters:
t
x=S
x′;t
y=S
y′
a=(S
xx′+S
yy′)/(S
xx+S
yy)
b=(S
xy′-S
yx′)/(S
xx+S
yy)
The implementation procedure of second portion conversion is as follows:
If (X
z, Y
z) be through horizontally rotating (around Z axis) and the displacement after coordinate (the z coordinate is constant), it at first rotates θ around Y-axis
yAngle, zoom factor are S
y, transversal displacement is T
X ', then have:
Rotate θ around X-axis again
xAngle, zoom factor is S simultaneously
x, the vertical misalignment amount is T
Y ', then have:
Above two formulas of simultaneous, and to the XY plane projection can get the coordinate after the conversion:
Make in the equation (8) a
y=S
y* cos θ
y, b
y=S
y* sin θ
y, a
x=S
x* cos θ
x, b
x=S
x* sin θ
x, and the actual coordinate of establishing after the conversion is (x ', y '), and getting in equation (8) the substitution formula (1): | X
z* a
y+ Z*b
y+ T
X '-x ' |
2+ | Y
z* a
x-(X
z* b
y+ Z*a
y) * b
x+ T
Y '-y ' |
2(9)
Make (9) formula minimum, parameter wherein asked local derviation, can get:
X
z*a
y+Z*b
y+T
x′-x′=0 (10)
Y
z*a
x-(-X
z*b
y+Z*a
y)*b
x+T
y′-y′=0 (11)
By formula (10) is carried out multiple linear regression analysis, can be in the hope of parameter value a wherein
y, b
y, T
X 'If total n unique point, detailed process is as follows:
(1) averages
A
y, b
y, T
X 'Value substitution formula (11), using the same method can be in the hope of a
x, b
x, T
Y 'Second portion conversion M
2Expression, then:
The most approaching with impact point.
2) iterative approach
How to obtain unique point the XY plane around Z axis rotate and translation after coordinate (X
z, Y
z) be the key of carrying out the second step conversion, because wherein intermediateness is unknown, when design, adopts repeatedly the method for iterative approach to obtain actual intermediateness, and finally obtain actual transformation parameter.If intermediateness is (X
z, Y
z) concrete steps are as follows:
(1) initial seasonal (X
z, Y
z) be end value (x ', y '),
(2) (X
z, Y
z) substitution formula (4), try to achieve in the formula (4) four transformation parameter a, b, t according to the ASM transform method of current two dimension
x, t
y
(3) parameter a, b, t
x, t
ySubstitution formula (3) is obtained intermediateness (X
z, Y
z)
(4) (X
z, Y
z) carry out second portion conversion (M
2), obtain parameter a
y, b
y, T
X ', a
x, b
x, T
Y '
(5) be the basis with (x ', y '), calculate M
2Inverse transformation, can draw intermediateness (X '
z, Y '
z) namely:
(6) (X '
z, Y '
z) substitution formula (4), try to achieve in the formula (4) four transformation parameter a, b, t according to two-dimentional ASM transform method
x, t
yThen changed for (3) step over to, carry out loop iteration and calculate, general iteration just can reach accuracy requirement 10 times.
Can finally obtain 10 parameters of image three-dimensional conversion by above-mentioned alternative manner, that is: 6 parameters of 4 parameters of for the first time conversion (rotate and translation around Z axis on the XY plane) and for the second time conversion (rotate and project on the XY plane around Y-axis and Z axis respectively).
(3) implementation result test
By the human face characteristic point extraction system that adopts three-dimensional ASM method is tested, aspect the feature point extraction of carrying out non-training set data, the method improves a lot aspect accuracy than the ASM method of two dimension.The below has carried out two types test: the one, and then given concrete face characteristic point coordinate goes to approach with two kinds of methods, tests its approximation ratio; The 2nd, given concrete people's face is also pressed same searching algorithm removal search unique point, the then difference between comparison search result and the fact characteristic point with two kinds of methods respectively.Wherein every type test all includes the test to training set data and non-training set data.Result's demonstration, not obvious to the improvement degree of training set data this method, but non-training set data then is greatly increased.Because in actual applications, most view data should belong to non-training set, so this method has higher practical value.
When the structure test macro, selected the facial image of the different attitudes of 100 width of cloth as training set data, other has 30 width of cloth images as test data, wherein image resolution-ratio is 125*150, all images are all carried out manual unique point demarcate, as shown in Figure 2, each image has been chosen 59 unique points.In order to compare more exactly both effects, defined the concept of a relative approximation degree.If the unique point that D1 calculates when approaching for employing three-dimensional transformation search method of the present invention and the mean distance between the actual calibration point, D2 is the unique point that adopts conventional two-dimensional transform search and calculate when approaching and the mean distance between the actual calibration point, and relative approximation degree RN is expressed as:
RN=(D2-D1)/D1*100%
Obviously RN represents then that for just three-dimensional Approximation effect is better, represents then that for bearing two-dimentional Approximation effect is good, and its numerical values recited then represents the degree of approaching.
1. the test search approaches concrete coordinate
We have chosen 12 width of cloth images in training set, the direct substitution of its coordinate is approached with two kinds of methods respectively, its result as shown in Figure 3, as can be seen from the figure, as a rule, both Approximation effects are consistent.Fig. 4 then is the relative approximation degree when image directly approaches in the non-training set, therefrom can find out, in most of the cases, three-dimensional approach method can more approach desired value.
2. test the search of concrete people's face
When the concrete people's face of search, from training set, chosen 15 width of cloth images and searched for its result such as Fig. 5.Basically identical with expected results, both difference is not obvious.Fig. 6 searches for result after the coupling to image in 30 non-training sets, can find out that therefrom three-dimension varying obviously is better than two dimension, and the relative approximation effect is better than directly the approaching of objectives, this be since in approximate procedure target may repeatedly adjust.