The content of the invention
In view of the foregoing, it is necessary to provide it is a kind of can the efficient identification age method.
A kind of age recognition methods based on face feature, comprises the following steps:
Facial image is obtained, and captures face area;
Characteristic point is set on the face area image of crawl;
Age characteristics region is determined on face area according to the coordinate of characteristic point;
The age characteristics in age characteristics region is extracted, and obtains corresponding age value;And
Age value is judged into the age compared with default threshold value.
Preferably, it is described characteristic point is set on the face area image of crawl the step of including obtaining the position of eyebrow, eyes, nose, oral area this four organs in face area image, and these organs are indicated with characteristic point.
Preferably, left eyebrow eyebrow tail, left eyebrow brows, right eyebrow brows, right eyebrow eyebrow tail, the left eye tail of the eye, left eye center, left eye inner eye corner, right eye inner eye corner, right eye center, the right eye tail of the eye, the left nose wing, nose midpoint, the right wing of nose, the left corners of the mouth, mouth top midpoint, the right corners of the mouth and mouth bottom midpoint are indicated with characteristic point.
Preferably, before determining on face area age characteristics region according to the coordinate of characteristic point, two midpoint distances and the vertical range at two midpoints and nose midpoint are obtained by the position coordinates at left eye center, right eye center and nose midpoint, the abscissa that wherein two midpoints distance is equal to left eye midpoint subtracts the abscissa at right eye midpoint, the vertical range at two midpoints and nose midpoint be equal to nose midpoint ordinate subtract two midpoints ordinate draw value.
Preferably, region, the left nose wing to corners of the mouth region and the right wing of nose under region, right eye under left eye tail region domain, right eye tail region domain, left eye to corners of the mouth region are included according to the age characteristics region that the coordinate of characteristic point determines on face area.
Preferably, before the step of age characteristics in the extraction age characteristics region, the age characteristics region of same type is adjusted to an equal amount of region.
Preferably, left eye tail region domain and right eye tail region domain are the age characteristics region of same type, and region is the age characteristics region of same type, the left nose wing to corners of the mouth region and the right wing of nose to the age characteristics region that corners of the mouth region is same type under region and right eye under left eye.
Preferably, after the age characteristics region of same type being adjusted into an equal amount of region, the image in age characteristics region is converted into readily identified image by counting change scaling method.
Preferably, the default threshold value includes a first threshold and a Second Threshold, if the age value and the first threshold relatively after be more than the first threshold, by the age value compared with the Second Threshold.
Compared to prior art, in the above-mentioned age recognition methods based on face feature, by setting characteristic point on face area image, obtain age characteristics region, and the age is judged by the processing to a little age characteristics regions, the treating capacity of data is smaller, and judging efficiency is higher.
Embodiment
Fig. 1 is a kind of flow chart of the age recognition methods based on face feature of the present invention, and for identifying the age of people, the age recognition methods comprises the following steps:
Step 101, facial image is obtained, and captures face area.
Referring to Fig. 2, the facial image generally obtained can include the other parts of human body, such as neck etc., in a step 101, by the human face model pre-established and the facial image obtained, the image of face area is captured, and the image of other parts is removed.
Step 102, characteristic point is set on the face area image of crawl.
Refer to Fig. 3, it is compared by characteristic model with face area image, obtains the position of eyebrow, eyes, nose, oral area this four organs in face area image, and these organs is indicated with characteristic point, just as shown in Figure 3, left eyebrow eyebrow tail is indicated with characteristic point 1(Left and right definition is on the basis of the personnel for checking accompanying drawing),Left eyebrow brows are indicated with characteristic point 2,Right eyebrow brows are indicated with characteristic point 3,Right eyebrow eyebrow tail is indicated with characteristic point 4,The left eye tail of the eye is indicated with characteristic point 5,Left eye center is indicated with characteristic point 6,Left eye inner eye corner is indicated with characteristic point 7,Right eye inner eye corner is indicated with characteristic point 8,Right eye center is indicated with characteristic point 9,The right eye tail of the eye is indicated with characteristic point 10,The left nose wing is indicated with characteristic point 11,Nose midpoint is indicated with characteristic point 12,The right wing of nose is indicated with characteristic point 13,The left corners of the mouth is indicated with characteristic point 14,Indicated with the lip-syncing top midpoint of characteristic point 15,The right corners of the mouth is indicated with characteristic point 16,Indicated with the lip-syncing bottom midpoint of characteristic point 17,Then face area image is indicated with 17 characteristic points in the present embodiment;In other embodiments, also eyebrow, eyes, nose, oral area this four organs can be indicated using more characteristic points or less characteristic point as needed, also according to judgement this organ to ear can be needed to carry out the mark of characteristic point, or other features of human body face are identified.
Step 103, two midpoint distance W and the vertical range H at two midpoints and nose midpoint are calculated according to the positional information of characteristic point.
Referring to Fig. 4, be typically that two midpoint distance W and the vertical range H at two midpoints and nose midpoint are calculated according to the coordinate of these characteristic points, such as the coordinate of characteristic point 6 is(X6, Y6), the coordinate of characteristic point 9 is(X9, Y9), the right of characteristic point 12 is(X12, Y12), then two midpoint distance W=X9-X6, the vertical range H=Y12- (Y6+Y9)/2 at two midpoints and nose midpoint.
Step 104, the age characteristics region of face is determined according to the coordinate of each coordinate points and distance W, H.
Refer to Fig. 5, in the present embodiment, choose eye tail region domain a and b, now the age characteristics region of region c and d, the wing of nose to corners of the mouth region e and f as face, because the age characteristics in these regions of the face of people is more obvious, such as wrinkle difference of the face in these regions of the people of all ages and classes is larger;In other embodiments, also other face areas can be added according to different needs to be judged, such as forehead region etc..
Refer to Fig. 6, it is the schematic diagram for determining an a left eye tail region domain a and right eye tail region domain b, left eye tail region domain a is a square region, it includes upper left corner end points a1, upper right corner end points a2, lower left corner end points a3 and lower right corner end points a4, and the X-axis coordinate and Y-axis coordinate of each angle end points are calculated by formula listed in Table.
Endpoint names |
X-axis coordinate calculation |
Y-axis coordinate calculation |
Left eye tail region domain upper left corner end points a1 |
X=X6–W*0.6 |
Y=(Y6+Y9)/2 |
Left eye tail region domain upper right corner end points a2 |
X=X6–W*0.4 |
Y=(Y6+Y9)/2 |
Left eye tail region domain lower left corner end points a3 |
X=X6–W*0.6 |
Y=(Y6+Y9)+H*0.8 |
Left eye tail region domain lower right corner end points a4 |
X=X6–W*0.4 |
Y=(Y6+Y9)+H*0.8 |
Equally, right eye tail region domain b is a square region, and it includes upper left corner end points b1, upper right corner end points b2, lower left corner end points b3 and lower right corner end points b4, and the X-axis coordinate and Y-axis coordinate of each angle end points are calculated by formula listed in Table.
Endpoint names |
X-axis coordinate calculation |
Y-axis coordinate calculation |
Right eye tail region domain upper left corner end points b1 |
X=X9+W*0.4 |
Y=(Y6+Y9)/2 |
Right eye tail region domain upper right corner end points b2 |
X=X9+W*0.6 |
Y=(Y6+Y9)/2 |
Right eye tail region domain lower left corner end points b3 |
X=X9+W*0.4 |
Y=(Y6+Y9)+H*0.8 |
Right eye tail region domain lower right corner end points b4 |
X=X9+W*0.6 |
Y=(Y6+Y9)+H*0.8 |
Referring to Fig. 7, region c is a square region under left eye, it includes upper left corner end points c1, upper right corner end points c2, lower left corner end points c3 and lower right corner end points c4, and the X-axis coordinate and Y-axis coordinate of each angle end points are calculated by formula listed in Table.
Endpoint names |
X-coordinate calculation |
Y-coordinate calculation |
Region upper left corner end points c1 under left eye |
X=X6–W*0.4 |
Y=(Y6+Y9)/2+H*0.35 |
Region upper right corner end points c2 under left eye |
X=X6+W*0.3 |
Y=(Y6+Y9)/2+H*0.35 |
Region lower left corner end points c3 under left eye |
X=X6–W*0.4 |
Y=(Y6+Y9)/2+H*0.8 |
Region lower right corner end points c4 under left eye |
X=X6+W*0.3 |
Y=(Y6+Y9)/2+H*0.8 |
Equally, region d is a square region under right eye, and it includes upper left corner end points d1, upper right corner end points d2, lower left corner end points d3 and lower right corner end points d4, and the X-axis coordinate and Y-axis coordinate of each angle end points are calculated by formula listed in Table.
Endpoint names |
X-coordinate calculation |
Y-coordinate calculation |
Region upper left corner end points d1 under right eye |
X=X9–W*0.4 |
Y=(Y6+Y9)/2+H*0.35 |
Region upper right corner end points d2 under right eye |
X=X9+W*0.3 |
Y=(Y6+Y9)/2+H*0.35 |
Region lower left corner end points d3 under right eye |
X=X9–W*0.4 |
Y=(Y6+Y9)+H*0.8 |
Region lower right corner end points d4 under right eye |
X=X9+W*0.3 |
Y=(Y6+Y9)+H*0.8 |
Referring to Fig. 8, the left nose wing is a square region to corners of the mouth region e, it includes upper left corner end points e1, upper right corner end points e2, lower left corner end points e3 and lower right corner end points e4, and the X-axis coordinate and Y-axis coordinate of each angle end points are calculated by formula listed in Table.
Endpoint names |
X-coordinate calculation |
Y-coordinate calculation |
The left nose wing is to corners of the mouth region upper left corner end points e1 |
X=X6–W*0.32 |
Y=Y12 |
The left nose wing is to corners of the mouth region upper right corner end points e2 |
X=X6+W*0.05 |
Y=Y12 |
The left nose wing is to corners of the mouth region lower left corner end points e3 |
X=X6–W*0.32 |
Y=(Y14+Y16)/2 |
The left nose wing is to corners of the mouth region lower right corner end points e4 |
X=X6+W*0.05 |
Y=(Y14+Y16)/2 |
Equally, the right wing of nose is a square region to corners of the mouth region f, and it includes upper left corner end points f1, upper right corner end points f2, lower left corner end points f3 and lower right corner end points f4, and the X-axis coordinate and Y-axis coordinate of each angle end points are calculated by formula listed in Table.
Endpoint names |
X-coordinate calculation |
Y-coordinate calculation |
The right wing of nose is to corners of the mouth region upper left corner end points e1 |
X=X9+W*0.05 |
Y=Y12 |
The right wing of nose is to corners of the mouth region upper right corner end points e2 |
X=X9+W*0.32 |
Y=Y12 |
The right wing of nose is to corners of the mouth region lower left corner end points e3 |
X=X9+W*0.05 |
Y=(Y14+Y16)/2 |
The right wing of nose is to corners of the mouth region lower right corner end points e4 |
X=X9+W*0.32 |
Y=(Y14+Y16)/2 |
So as to which the method more than sets each age characteristics region a-f position and size.
Step 105, the age characteristics region of same type is adjusted to an equal amount of region.
In above-mentioned age characteristics region a, b, c, d, in e and f, left eye tail region domain a and right eye tail region domain b is the age characteristics region of same type, region d is the age characteristics region of same type under region c and right eye under left eye, age characteristics region of the left nose wing to corners of the mouth region e and the right wing of nose to corners of the mouth region f for same type, such as if left eye tail region domain a length is 9, height is 6, right eye tail region domain b length is 6, width is 8, then can be by the way that left eye tail region domain a length be shortened into 6 from 9, left eye tail region domain a height is stretched to 8 from 6, and make left eye tail region domain a identical with right eye tail region domain b size.
Step 106, readily identified image is converted into by counting change scaling method to the image in each age characteristics region.
It is that every 3*3 of image pixel is being divided into a region that statistics, which becomes scaling method, then calculate the pixel average of all pixels point in the region, then by the pixel value of each pixel in the region compared with the pixel average, if the pixel value of certain point is more than pixel average, the pixel value of the point is changed into 1;If the pixel value of certain point is less than pixel average, the pixel value of the point is changed into 0.
Step 107, the age characteristics of the image after extraction conversion, and corresponding age value is obtained, by the age value compared with a first threshold, if age value is more than or equal to first threshold, then to step 108;If age value is less than first threshold, to step 109.
Step 108, it is judged as the elderly, and by the age value compared with a Second Threshold;If age value is more than or equal to the Second Threshold, to step 110;If age value is more than or equal to the Second Threshold, to step 111.
Step 109, it is judged as young people.
Step 110, it is judged as the elderly.
Step 111, it is judged as a middle-aged person.
In the above-mentioned age recognition methods based on face feature, by setting characteristic point on face area image, age characteristics region is obtained, and judge that the treating capacity of data is smaller, and judging efficiency is higher to judge the age by the processing to a little age characteristics regions.