CN104268518A - Method for automatically optimizing canthus distance - Google Patents
Method for automatically optimizing canthus distance Download PDFInfo
- Publication number
- CN104268518A CN104268518A CN201410482983.7A CN201410482983A CN104268518A CN 104268518 A CN104268518 A CN 104268518A CN 201410482983 A CN201410482983 A CN 201410482983A CN 104268518 A CN104268518 A CN 104268518A
- Authority
- CN
- China
- Prior art keywords
- canthus
- distance
- face
- human eye
- ordinate
- 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
- 238000000034 method Methods 0.000 title claims abstract description 45
- 210000001747 pupil Anatomy 0.000 claims description 46
- 238000004364 calculation method Methods 0.000 claims description 15
- 238000001514 detection method Methods 0.000 claims description 11
- 230000000694 effects Effects 0.000 abstract description 6
- 230000009286 beneficial effect Effects 0.000 description 3
- 230000001815 facial effect Effects 0.000 description 2
- 210000001331 nose Anatomy 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
Classifications
-
- G06T3/04—
Abstract
The invention discloses a method for automatically optimizing the canthus distance. According to the method for automatically optimizing the canthus distance, firstly, the positions of eyes and the position of the face are obtained through the face detecting technology, then a needed eye length is calculated according to a ratio between a preset eye length and the face width, finally, the distance, needing to move, of the canthi of the eyes is calculated according to the eye length and the positions of the eyes, and the canthus stretching processing is carried out automatically. By means of the method for automatically optimizing the canthus distance, the micro processing of the canthi brings out the crucial point in the optimizing processing of the entire face, the sense of reality and naturalness of an original image are remained to a large extent, and the effect is the image is better.
Description
Technical field
The present invention relates to a kind of image processing method, particularly the method for a kind of Automatic Optimal canthus distance.
Background technology
Along with the day by day rise of autodyning, U.S. face camera audient is more and more wider, and in order to the picture making U.S. face camera obtain has better effect, the picture of groups of people needs pulling eye angle to process.From the angle of face aesthetics, comparatively perfectly the ratio of eyes and face should meet in " three five, front yards ", and " three front yards " is that the facial length of people is divided into trisection, and external nose length is just in time wherein 1/3rd; " five " are allowing your facial width be divided into five deciles, and the width of eyes is just in time wherein 1/5th; The width i.e. distance at two intraocular canthus, left and right of eyes should be the length of eyes, is not perfect ratio for most people.
Summary of the invention
The present invention, for solving the problem, provides the method for a kind of Automatic Optimal canthus distance, and it makes the better effects if of picture by the process of pulling eye angle, maintains the sense of reality and the naturality of former figure to a great extent simultaneously.
For achieving the above object, the technical solution used in the present invention is:
A method for Automatic Optimal canthus distance, is characterized in that, comprise the following steps:
10. receive pending image, obtained the position of human eye and face by human face detection tech;
The ratio of the human eye length that 20. bases are preset and face width, calculates the human eye length of needs;
30. canthus calculating human eye according to described human eye length and position of human eye need the distance of movement, and carry out the process of automatic pulling eye angle.
Preferably, in described step 10, obtained the position of human eye and face by human face detection tech, mainly judge whether face to be detected by human face detection tech, if face detected, calculate the position of two pupils of human eye and the position of face left and right sides.
Preferably, in described step 20, the computing method of human eye length are as follows:
eyeLength=(faceRight-faceLeft)*scale;
Wherein, eyeLength is the human eye length needed, and scale is the number percent that human eye length accounts for face width, and faceRight, faceLeft are respectively right side coordinate and the left side coordinate of face.
Preferably, in described step 30, the canthus calculating human eye according to described human eye length and position of human eye needs the distance of movement, and its computing method are further comprising the steps:
31. determine the slope of left and right eyes according to the position of pupil;
32. calculate the initial position at canthus according to described slope;
33. calculating canthus need the distance of movement, and obtain the final position at canthus according to this distance.
Preferably, in described step 31, determine the slope of left and right eyes according to the position of pupil, computing method are as follows:
K=(rightPupilY-leftPupilY)/(rightPupilX-leftPupilX);
Wherein, K is the slope of eyes, and rightPupilY, leftPupilY, rightPupilX, leftPupilX are the ordinate of right pupil, the ordinate of left pupil, the horizontal ordinate of right pupil, the horizontal ordinate of left pupil respectively.
Preferably, in described step 32, calculate the initial position at canthus according to described slope, computing method are as follows:
The horizontal ordinate at left eye angle: leftPupilX+eyeLength*LfaceK;
The ordinate at left eye angle: leftPupilY+K*eyeLength/2.0+eyeLength/9.0;
The horizontal ordinate at right eye angle: rightPupilX-eyeLength* (1-LfaceK);
The ordinate at right eye angle: rightPupilY-K*eyeLength/2.0+eyeLength/9.0;
Wherein, LfaceK is the degree of the face to the left in the face situation of side, K is the slope of eyes, eyeLength is human eye length, faceRight, faceLeft are respectively right side coordinate figure and the left side coordinate figure of face, and rightPupilY, leftPupilY, rightPupilX, leftPupilX are the ordinate of right pupil, the ordinate of left pupil, the horizontal ordinate of right pupil, the horizontal ordinate of left pupil respectively.
Preferably, the computing method of the degree of face are as follows to the left:
LfaceK=(faceRight-rightPupilX)/(faceRight-rightPupilX+leftPupilX-faceLeft);
Wherein, LfaceK is the degree of the face to the left in the face situation of side, and faceRight, faceLeft are respectively right side horizontal ordinate and the left side horizontal ordinate of face, and rightPupilX, leftPupilX are respectively right pupil horizontal ordinate and left pupil horizontal ordinate.
Preferably, in described step 33, calculating canthus needs the method for the distance of movement as follows:
The horizontal ordinate at canthus needs the distance of movement:
Detax=(rightPupilX-leftPupilX-2.0*eyeLength)/2.0;
The ordinate at canthus needs the distance of movement:
Detay=K*Detax;
The coordinate in the final position at left eye angle is:
(left eye angle horizontal ordinate+Detax, left eye angle ordinate+Detay);
The coordinate in the final position at right eye angle is:
(right eye angle horizontal ordinate-Detax, right eye angle horizontal ordinate-Detay).
Preferably, the process of automatic pulling eye angle is carried out in described step 30, mainly according to the initial position at canthus, final position and need the distance of movement to determine deformation radius and the deformation intensity of image being carried out to deformation process, and also quadratic linear interpolation processing is carried out to the position of deformation in the deformation process process of image.
Preferably, described deformation radius is the deformation range of the pixel of image, and it is mainly determined according to the pupil size of human eye; Described deformation intensity is the obvious degree of anamorphose.
The invention has the beneficial effects as follows:
The method of a kind of Automatic Optimal canthus of the present invention distance, first it obtain the position of human eye and face by human face detection tech, then the human eye length that basis is default and the ratio of face width calculate the human eye length of needs, the canthus that human eye length described in last basis and position of human eye calculate human eye needs the distance of movement, and carry out the process of automatic pulling eye angle, by the micro-process to canthus, it is made to serve the effect of crucial touch to the optimization process of whole shape of face, and maintain the sense of reality and the naturality of original image to a great extent, make the better effects if of image.
Accompanying drawing explanation
Accompanying drawing described herein is used to provide a further understanding of the present invention, forms a part of the present invention, and schematic description and description of the present invention, for explaining the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is the general flow chart of the method for a kind of Automatic Optimal canthus of the present invention distance.
Embodiment
In order to make technical matters to be solved by this invention, technical scheme and beneficial effect clearly, understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
As shown in Figure 1, the method for a kind of Automatic Optimal canthus of the present invention distance, it comprises the following steps:
10. receive pending image, obtained the position of human eye and face by human face detection tech;
The ratio of the human eye length that 20. bases are preset and face width, calculates the human eye length of needs;
30. canthus calculating human eye according to described human eye length and position of human eye need the distance of movement, and carry out the process of automatic pulling eye angle.
In described step 10, obtained the position of human eye and face by human face detection tech, mainly judge whether face to be detected by human face detection tech, if face detected, calculate the position of two pupils of human eye and the position of face left and right sides; In addition, human face detection tech adopts existing conventional means, does not repeat at this.
In described step 20, the computing method of human eye length are as follows:
eyeLength=(faceRight-faceLeft)*scale;
Wherein, eyeLength is the human eye length needed, and scale is the number percent that human eye length accounts for face width, and faceRight, faceLeft are respectively right side coordinate and the left side coordinate of face.This human eye length is the ideal length needed, and the number percent that human eye length accounts for face width is determine according to the perfect eyes in " three five, front yards " and the ratio of face.
In described step 30, the canthus calculating human eye according to described human eye length and position of human eye needs the distance of movement, and its computing method are further comprising the steps:
31. determine the slope of left and right eyes according to the position of pupil;
32. calculate the initial position at canthus according to described slope;
33. calculating canthus need the distance of movement, and obtain the final position at canthus according to this distance.
In the present embodiment, in described step 31, determine the slope of left and right eyes according to the position of pupil, computing method are as follows:
K=(rightPupilY-leftPupilY)/(rightPupilX-leftPupilX);
Wherein, K is the slope of eyes, and rightPupilY, leftPupilY, rightPupilX, leftPupilX are the ordinate of right pupil, the ordinate of left pupil, the horizontal ordinate of right pupil, the horizontal ordinate of left pupil respectively.
In the present embodiment, in described step 32, calculate the initial position at canthus according to described slope, computing method are as follows:
The horizontal ordinate at left eye angle: leftPupilX+eyeLength*LfaceK;
The ordinate at left eye angle: leftPupilY+K*eyeLength/2.0+eyeLength/9.0;
The horizontal ordinate at right eye angle: rightPupilX-eyeLength* (1-LfaceK);
The ordinate at right eye angle: rightPupilY-K*eyeLength/2.0+eyeLength/9.0;
Wherein, LfaceK is the degree of the face to the left in the face situation of side, K is the slope of eyes, eyeLength is human eye length, faceRight, faceLeft are respectively right side coordinate figure and the left side coordinate figure of face, and rightPupilY, leftPupilY, rightPupilX, leftPupilX are the ordinate of right pupil, the ordinate of left pupil, the horizontal ordinate of right pupil, the horizontal ordinate of left pupil respectively.
The computing method of the degree of above-mentioned face are to the left as follows:
LfaceK=(faceRight-rightPupilX)/(faceRight-rightPupilX+leftPupilX-faceLeft);
Wherein, LfaceK is the degree of the face to the left in the face situation of side, and faceRight, faceLeft are respectively right side horizontal ordinate and the left side horizontal ordinate of face, and rightPupilX, leftPupilX are respectively right pupil horizontal ordinate and left pupil horizontal ordinate.
Above-mentioned left eye angle and the horizontal ordinate (x) at right eye angle relevant with side face degree, above-mentioned left eye angle and the ordinate (y) at right eye angle relevant with the position slope of eyes; In the present embodiment, assuming that pupil is 1/2 of human eye length to the horizontal ordinate length at canthus, pupil is 1/3 of human eye width to the ordinate at canthus, and, assuming that human eye width is 1/3 of human eye length, and suppose that the distance of pupil is the length of two eyes, then in described step 33, calculating canthus needs the method for the distance of movement as follows:
The horizontal ordinate at canthus needs the distance of movement:
Detax=(rightPupilX-leftPupilX-2.0*eyeLength)/2.0;
The ordinate at canthus needs the distance of movement:
Detay=K*Detax;
The coordinate in the final position at left eye angle is:
(left eye angle horizontal ordinate+Detax, left eye angle ordinate+Detay);
The coordinate in the final position at right eye angle is:
(right eye angle horizontal ordinate-Detax, right eye angle horizontal ordinate-Detay).
The process of automatic pulling eye angle is carried out in described step 30, mainly according to the initial position at canthus, final position and need the distance of movement to determine deformation radius and the deformation intensity of image being carried out to deformation process, and also quadratic linear interpolation processing is carried out to the position of deformation in the deformation process process of image; Described deformation radius is the deformation range of the pixel of image, and it is mainly determined according to the pupil size of human eye, and larger with the distance of the nearlyer translation of home position distance, overall movement is beneficial to the naturality of deformation; Described deformation intensity is the obvious degree of anamorphose.Because the size of different face has very big difference, so deformation radius is herein associated with the pupil size of human eye, there is following formula:
eyeLength/(3.0)*3.4;
Wherein, the determination of 3.4 determines according to its effect, and in the present embodiment, deformation intensity is preferably 0.15; Can different parameters be set as the case may be.
The deformation principle that above-mentioned deformation process adopts, the determination of its deformation function is as follows:
pow(((cos(M_PI*sqrt(i/(FILTER_SIZE-1)))+1)/2),0.7);
Wherein, FILTER_SIZE is that the scope of 1000, i is from 0 to 999.Above-mentioned deformation function needs to obtain when obtaining deformation extent, and the mode obtained is according to point in deformation radius to the distance in the center of circle, and with deformation intensity direct proportionality.
Above-mentioned explanation illustrate and describes the preferred embodiments of the present invention, be to be understood that the present invention is not limited to the form disclosed by this paper, should not regard the eliminating to other embodiments as, and can be used for other combinations various, amendment and environment, and can in invention contemplated scope herein, changed by the technology of above-mentioned instruction or association area or knowledge.And the change that those skilled in the art carry out and change do not depart from the spirit and scope of the present invention, then all should in the protection domain of claims of the present invention.
Claims (10)
1. a method for Automatic Optimal canthus distance, is characterized in that, comprises the following steps:
10. receive pending image, obtained the position of human eye and face by human face detection tech;
The ratio of the human eye length that 20. bases are preset and face width, calculates the human eye length of needs;
30. canthus calculating human eye according to described human eye length and position of human eye need the distance of movement, and carry out the process of automatic pulling eye angle.
2. the method for a kind of Automatic Optimal canthus according to claim 1 distance, it is characterized in that: in described step 10, the position of human eye and face is obtained by human face detection tech, mainly judge whether face to be detected by human face detection tech, if face detected, calculate the position of two pupils of human eye and the position of face left and right sides.
3. the method for a kind of Automatic Optimal canthus according to claim 2 distance, it is characterized in that: in described step 20, the computing method of human eye length are as follows:
eyeLength=(faceRight-faceLeft)*scale;
Wherein, eyeLength is the human eye length needed, and scale is the number percent that human eye length accounts for face width, and faceRight, faceLeft are respectively right side coordinate and the left side coordinate of face.
4. the method for a kind of Automatic Optimal canthus according to claim 2 distance, it is characterized in that: in described step 30, the canthus calculating human eye according to described human eye length and position of human eye needs the distance of movement, and its computing method are further comprising the steps:
31. determine the slope of left and right eyes according to the position of pupil;
32. calculate the initial position at canthus according to described slope;
33. calculating canthus need the distance of movement, and obtain the final position at canthus according to this distance.
5. the method for a kind of Automatic Optimal canthus according to claim 4 distance, it is characterized in that: in described step 31, determine the slope of left and right eyes according to the position of pupil, computing method are as follows:
K=(rightPupilY-leftPupilY)/(rightPupilX-leftPupilX);
Wherein, K is the slope of eyes, and rightPupilY, leftPupilY, rightPupilX, leftPupilX are the ordinate of right pupil, the ordinate of left pupil, the horizontal ordinate of right pupil, the horizontal ordinate of left pupil respectively.
6. the method for a kind of Automatic Optimal canthus according to claim 5 distance, is characterized in that: in described step 32, and calculate the initial position at canthus according to described slope, computing method are as follows:
The horizontal ordinate at left eye angle: leftPupilX+eyeLength*LfaceK;
The ordinate at left eye angle: leftPupilY+K*eyeLength/2.0+eyeLength/9.0;
The horizontal ordinate at right eye angle: rightPupilX-eyeLength* (1-LfaceK);
The ordinate at right eye angle: rightPupilY-K*eyeLength/2.0+eyeLength/9.0;
Wherein, LfaceK is the degree of the face to the left in the face situation of side, K is the slope of eyes, eyeLength is human eye length, faceRight, faceLeft are respectively right side coordinate figure and the left side coordinate figure of face, and rightPupilY, leftPupilY, rightPupilX, leftPupilX are the ordinate of right pupil, the ordinate of left pupil, the horizontal ordinate of right pupil, the horizontal ordinate of left pupil respectively.
7. the method for a kind of Automatic Optimal canthus according to claim 6 distance, is characterized in that: the computing method of the degree of face are as follows to the left:
LfaceK=(faceRight-rightPupilX)/(faceRight-rightPupilX+leftPupilX-faceLeft);
Wherein, LfaceK is the degree of the face to the left in the face situation of side, and faceRight, faceLeft are respectively right side horizontal ordinate and the left side horizontal ordinate of face, and rightPupilX, leftPupilX are respectively right pupil horizontal ordinate and left pupil horizontal ordinate.
8. the method for a kind of Automatic Optimal canthus according to claim 6 distance, is characterized in that: in described step 33, and calculating canthus needs the method for the distance of movement as follows:
The horizontal ordinate at canthus needs the distance of movement:
DetaX=(rightPupilX-leftPupilX-2.0*eyeLength)/2.0;
The ordinate at canthus needs the distance of movement:
Detay=K*Detax;
The coordinate in the final position at left eye angle is:
(left eye angle horizontal ordinate+Detax, left eye angle ordinate+Detay);
The coordinate in the final position at right eye angle is:
(right eye angle horizontal ordinate-Detax, right eye angle horizontal ordinate-Detay).
9. the method for a kind of Automatic Optimal canthus according to claim 1 distance, it is characterized in that: in described step 30, carry out the process of automatic pulling eye angle, mainly according to the initial position at canthus, final position and need the distance of movement to determine deformation radius and the deformation intensity of image being carried out to deformation process, and also quadratic linear interpolation processing is carried out to the position of deformation in the deformation process process of image.
10. the method for a kind of Automatic Optimal canthus according to claim 9 distance, is characterized in that: described deformation radius is the deformation range of the pixel of image, and it is mainly determined according to the pupil size of human eye; Described deformation intensity is the obvious degree of anamorphose.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410482983.7A CN104268518B (en) | 2014-09-19 | 2014-09-19 | A kind of method of Automatic Optimal canthus distance |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410482983.7A CN104268518B (en) | 2014-09-19 | 2014-09-19 | A kind of method of Automatic Optimal canthus distance |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104268518A true CN104268518A (en) | 2015-01-07 |
CN104268518B CN104268518B (en) | 2018-03-30 |
Family
ID=52160038
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410482983.7A Active CN104268518B (en) | 2014-09-19 | 2014-09-19 | A kind of method of Automatic Optimal canthus distance |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104268518B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106548117A (en) * | 2015-09-23 | 2017-03-29 | 腾讯科技(深圳)有限公司 | A kind of face image processing process and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6584210B1 (en) * | 1998-03-27 | 2003-06-24 | Hitachi, Ltd. | Digital watermark image processing method |
CN103605975A (en) * | 2013-11-28 | 2014-02-26 | 小米科技有限责任公司 | Image processing method and device and terminal device |
CN103745429A (en) * | 2013-08-22 | 2014-04-23 | 厦门美图移动科技有限公司 | Method for rapidly realizing eye image processing |
CN103955675A (en) * | 2014-04-30 | 2014-07-30 | 上海华博信息服务有限公司 | Facial feature extraction method |
-
2014
- 2014-09-19 CN CN201410482983.7A patent/CN104268518B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6584210B1 (en) * | 1998-03-27 | 2003-06-24 | Hitachi, Ltd. | Digital watermark image processing method |
CN103745429A (en) * | 2013-08-22 | 2014-04-23 | 厦门美图移动科技有限公司 | Method for rapidly realizing eye image processing |
CN103605975A (en) * | 2013-11-28 | 2014-02-26 | 小米科技有限责任公司 | Image processing method and device and terminal device |
CN103955675A (en) * | 2014-04-30 | 2014-07-30 | 上海华博信息服务有限公司 | Facial feature extraction method |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106548117A (en) * | 2015-09-23 | 2017-03-29 | 腾讯科技(深圳)有限公司 | A kind of face image processing process and device |
Also Published As
Publication number | Publication date |
---|---|
CN104268518B (en) | 2018-03-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101339606B (en) | Human face critical organ contour characteristic points positioning and tracking method and device | |
KR102212209B1 (en) | Method, apparatus and computer readable recording medium for eye gaze tracking | |
KR101260287B1 (en) | Method for simulating spectacle lens image using augmented reality | |
CN102662476B (en) | Gaze estimation method | |
CN104793741A (en) | Imaging system and method for guiding eyeballs to trace virtual reality | |
CN103793693A (en) | Method for detecting face turning and facial form optimizing method with method for detecting face turning | |
CN105589551A (en) | Eye tracking method for human-computer interaction of mobile device | |
CN104113680A (en) | Sight line tracking system and method | |
CN102125422A (en) | Pupil center-corneal reflection (PCCR) based sight line evaluation method in sight line tracking system | |
WO2013052132A3 (en) | Image-based head position tracking method and system | |
CN102915044B (en) | A kind of robot head eye coordinate motion control method based on bionic principle | |
CN103677270A (en) | Human-computer interaction method based on eye movement tracking | |
CN204480564U (en) | The eye imaging principle myopia long sight origin cause of formation and rectification apparatus for demonstrating | |
CN104615978A (en) | Sight direction tracking method and device | |
US10778953B2 (en) | Dynamic convergence adjustment in augmented reality headsets | |
CN105487782A (en) | Method and system for automatically adjusting scroll speed based on eye identification | |
WO2018138140A3 (en) | Population of an eye model using measurement data in order to optimize spectacle lenses | |
NZ739054A (en) | Virtual/augmented reality system having dynamic region resolution | |
CN105593896A (en) | Image processing device, image display device, image processing method and medium | |
WO2021239284A1 (en) | Methods, devices and systems enabling determination of eye state variables | |
CN104268518A (en) | Method for automatically optimizing canthus distance | |
WO2015094496A3 (en) | Method for assessing residual accommodation in presbyopic eyes | |
CN106066538A (en) | Frivolous Fresnel Lenses for the Virtual Reality helmet | |
CN205282063U (en) | Medical treatment image display system | |
Wang et al. | Fisheye omnidirectional camera calibration—Pinhole or spherical model? |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |