Summary of the invention
The present invention is directed to the deficiencies in the prior art, a kind of man face characteristic point positioning method in conjunction with ASM and Lucas AAM is proposed, it is combined ASM and two methods of Lucas AAM (Fast Activities display model) carry out the face characteristic point location, the shortcoming that ASM global search precision is low can be compensated by the effective advantage of Lucas AAM global search like this, meanwhile, the characteristics of Lucas AAM Local Search difference also can be compensated by the effective advantage of ASM Local Search, therefore the two is combined and can make up for each other's deficiencies and learn from each other, Sou Suo characteristic point position can be very accurate like this.Simultaneously, because Lucas AAM method is relatively slow, incorporated the speed that also can improve the full feature point search after the ASM method greatly.
The present invention is achieved by the following technical solutions, comprises the steps:
(1) set up Lucas AAM model, calculate initial parameter, provide the initial position of model;
(2) set up the local grain of ASM model and unique point;
(3) initial position of the model that obtains with step (1) and with Lucas AAM method seeker face characteristic point;
(4) unique point that arrives with Lucas AAM pattern search is as initial position, with ASM method search characteristics point.
In the described step (1), set up Lucas AAM model, be meant: at first select the principal character point of k people's face on each training sample image of training set, the shape of this k unique point composition can be by a vector x (i)=[x
1, x
2..., x
k, y
1, y
2..., y
k] represent, unique point with identical numbering has been represented identical feature in different images, n training sample image makes their represented shapes the most approaching on size, direction and position just to n shape vector should be arranged thereby calibrate this n vector then.Then the shape vector after n the calibration is carried out PCA (pivot analysis) and handle, finally any one shape can be expressed as
Wherein
B has represented the situation of change of preceding t maximum pattern, has so just set up Lucas AAM shape.Set up the characteristic point position and the average shape of training sample image then with piecewise linearity affine deformation method
Between mapping relations, and training sample image is deformed to average shape with this relation
And the gray-scale value of each picture element in the average shape after the distortion pulled into a vector, i.e. the texture of this training sample image, the length of this texture is average shape
The number of inner picture element, n training sample image are carried out pivot analysis to n texture vector then and are handled just to n texture vector should be arranged, and finally any one texture can be expressed as
So just set up Lucas AAM texture model.
In the described step (1), calculate initial parameter, be meant: compute gradient decline image
Wherein
Be the gradient of average texture, and
It is the Jacobian of piecewise linearity affine deformation.According to
Calculate Hessian (a kind of Jacobi matrix) matrix H.
In the described step (1), the initial position of computation model is meant: find two positions with the variance projection function on facial image, and set in two point coordinate and be [x1, Y1].To above-mentioned average shape model of trying to achieve
The center of calculating four unique points around the eyeball of the left and right sides respectively is as left and right sides eye position, thereby obtains two middle point coordinate [X2, Y2], then whole average shape model
Translation [X1-X2, Y1-Y2] so just obtains the initial position of model, thereby can be used for search.
Described step (2) is meant: the foundation for the ASM model is the same with the foundation of shape in the previous step.Also need to set up its local grain for each unique point in the training sample image, be that m pixel respectively selected on the both sides, center on perpendicular to former and later two unique point line directions of current unique point promptly with current unique point, calculate this (2m+1) thus the gray-scale value derivative of individual pixel and normalization obtain a profile (vector that is made of the derivative of the gray-scale value of pixel).The profile that remembers j unique point in i the shape vector is g
Ij, then j unique point profile's is average,
Its variance is
K unique point all calculated the average and variance of its profile, thereby just obtained the local grain of k unique point.
Described step (3) is meant: the initial position of the model that obtains with step (1) is searched for Lucas AAM method, and concrete steps are as follows:
A) by current p basis
Calculated characteristics point position is arrived the deformation texture that current characteristic point position surrounds with the linear affine deformation method of segmentation
And obtain texture vector I (W (x; P)).
B) calculated difference image I (W (x; P))-A
0(x).
C) calculate
D) calculate
E) by formula W (x; P) ← W (x; P) ο W (x; Δ p)
-1Renewal obtains new P value.
After iterating, by formula
Obtain new shape, i.e. the position of unique point.
Described step (4) is meant: as initial position, and utilize the ASM searching method to carry out unique point search in image with the Search Results that obtains in the previous step, this search procedure mainly is that the variation by affined transformation and parameter b realizes.Specifically realize by following two steps that iterate:
A) calculate the reposition of each unique point
At first initial ASM model is covered on the image, for j unique point in the model, be that the individual pixel of 1 (1 greater than m) is respectively selected on the both sides, center on perpendicular to its former and later two unique point line directions with it, thereby the gray-scale value derivative and the normalization of calculating this 1 pixel then obtain a profile, in this new profile, get length and be designated as temp (P), define an energy function for the sub-profile of (2*m+1)
With this energy function pass judgment on current sub-profile with
Between similarity, select to make f
j(p) Zui Xiao position is as the reposition of this unique point, and calculates it and change dX
j, each unique point is all carried out such calculating just obtains k change in location dX
i, i=1,2 ..., k, and form a vectorial dX=(dX
1, dX
2..., dX
k).
B) renewal of parameter in the affined transformation and b
By formula X=M (s, θ) [x]+X
c: M (s (1+ds), (θ+d θ)) [x+dx]+(X
c+ dX
c)=(X+dX), M (s (1+ds), (θ+d θ)) [x+dx]=M (s, θ) [x]+dX+X
c-(X
c+ dX
c), by formula
Now wish to find db to make
By formula
Can get db=P
-1Dx so just can make following renewal: X to parameter
c=X
c+ w
tDX
c, Y
c=Y
c+ w
tDY
c, θ=θ+w
θD θ, b=b+W
bDb, w in the formula
i, w
θ, w
s, W
bBe to be used for the weights that controlled variable changes, like this by formula
Can obtain new shape.
The man face characteristic point positioning method in conjunction with ASM and these two kinds of methods of Lucas AAM that the present invention proposes has very high precision.Owing to use Lucas AAM method to carry out the coarse search of unique point at the beginning, this can find the approximate location of unique point, and then with faceted search before the ASM method to the position carry out the essence search of unique point as initial position, search precision is very high under this prerequisite, but also is difficult for being absorbed in local minimum.With man face characteristic point positioning method and original ASM method in conjunction with ASM and these two kinds of methods of Lucas AAM that the face database contrast the present invention who takes proposes, the average error of both positioning feature point of front and back is respectively 2.1 pixels and 4.5 pixels.Experiment shows that the method that the present invention proposes is more accurate than further feature independent positioning method.Replace Lucas AAM method with the ASM method simultaneously in subsequent searches, its speed also is greatly improved.
Embodiment
Below in conjunction with a specific embodiment technical scheme of the present invention is described in further detail.
The image that embodiment adopts is from the facial image database of taking.Whole implement process is as follows:
1. from face database, select 500 facial images of having marked unique point to set up the ASM model.Marked the facial image of unique point, as shown in Figure 1.Corresponding 500 shape vectors and texture vector are done the foundation that Lucas AAM model has promptly been finished in the pivot analysis processing respectively.Any one shape can be expressed as like this
Any one texture can be expressed as simultaneously
Calculate initial parameter: compute gradient decline image
Wherein
Be the gradient of average texture, and
It is the Jacobian of the linear affine deformation of segmentation.According to
Calculate the Hessian matrix H.
The initial position of computation model: two positions about finding with the variance projection function on the facial image, they are respectively [274,229] and [371,228], as shown in Figure 2, thereby can obtain point coordinate in two [322.5,228.5].To above-mentioned average shape model of trying to achieve
The center of calculating left and right sides eyeball four unique points on every side respectively is as left and right sides eye position, and they are respectively [52.79 ,-48.76] and [52.03 ,-49.22], thereby obtain two middle point coordinate [0.37 ,-48.99], then whole average shape model
Translation [322.5-(0.37), 228.5-(48.99)] so just obtains the initial position of model, as shown in Figure 3.
2. the same with the foundation of shape in the previous step for the foundation of ASM model.Also need to set up its local grain for each unique point in the training sample image, be that 5 pixels are respectively selected on the both sides, center on perpendicular to former and later two unique point line directions of current unique point promptly with current unique point, calculate this 11 (2*5+1) thus the gray-scale value derivative of individual pixel and normalization obtain a profile.The profile that remembers j unique point in i the shape vector is g
Ij, then j unique point profile's is average,
Its variance is
60 unique points are all calculated the average and variance of its profile, thereby just obtained the local grain of 60 unique points.
With resulting initial position in the first step as reference position, search for Lucas AAM method, iteration is 30 times altogether, Search Results is as shown in Figure 4.
With the Search Results that obtains in the previous step as initial position, and utilize the ASM searching method in image, to carry out unique point search.Just can finally locate 60 unique points through 5 step iteration, as shown in Figure 5.
By experiment, can find that method proposed by the invention all is greatly improved than two kinds of original methods on precision and speed.