CN112364777A - Face distance estimation method based on face recognition - Google Patents
Face distance estimation method based on face recognition Download PDFInfo
- Publication number
- CN112364777A CN112364777A CN202011263555.7A CN202011263555A CN112364777A CN 112364777 A CN112364777 A CN 112364777A CN 202011263555 A CN202011263555 A CN 202011263555A CN 112364777 A CN112364777 A CN 112364777A
- Authority
- CN
- China
- Prior art keywords
- distance
- person
- calculating
- axis
- face
- 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
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/161—Detection; Localisation; Normalisation
- G06V40/165—Detection; Localisation; Normalisation using facial parts and geometric relationships
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/168—Feature extraction; Face representation
- G06V40/171—Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships
Abstract
The invention discloses a face distance estimation method based on face recognition. The method for calculating the human face distance according to the images obtained after a plurality of people are shot by the camera comprises the following steps: 1) acquiring a horizontal view angle value of a camera; 2) establishing a space rectangular coordinate system; 3) acquiring coordinates of face organs in the image; 4) calculating the distance between eyes and the distance between the eyebrow center and the mouth center of a person in the image, and 5) calculating the real distance between the person and the camera in the direction of the axis Oz; calculating the real distance from the person to the central point of the image in the direction of the axis Ox; 6) an estimated distance between any two persons is calculated. The invention obtains the coordinate information of the target eyes, nose and mouth in the picture by the face recognition technology based on deep learning, and obtains the face distance by using the projection geometric algorithm for the detection result, thereby realizing the face distance estimation with low cost.
Description
Technical Field
The invention relates to the field of computer vision, in particular to a face distance estimation method based on face recognition.
Background
The measurement of people and people's interval in the video picture is the important technique in many wisdom education, community's capital construction at present. Based on radar, ultrasonic wave and binocular camera and other traditional ranging methods, the wireless monitoring system has the defects of high deployment difficulty, low coupling degree with the existing monitoring equipment, high requirement on monitoring field environment and the like. In order to meet the requirement of distance measurement of field personnel during monitoring, research and development of a distance measurement algorithm applicable to most monitoring equipment are urgently needed.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides a face distance calculation method based on face recognition. The invention does not need extra hardware overhead, has low deployment cost, can directly utilize the existing monitoring equipment to measure the distance, and has low requirement on the stability of the environmental condition. The target detection frame is obtained through a face target detection method based on deep learning, and the face distance is obtained by using a projection geometric algorithm on the detection result, so that the face distance measurement can be realized with low cost.
A human face distance estimation method based on human face recognition is used for calculating human face distance according to images obtained after a plurality of people are shot by a camera, and comprises the following steps:
1) acquiring a value of a horizontal visual angle alpha of the camera;
2) establishing a space rectangular coordinate system: taking the top left vertex of the picture as an origin O, taking the right direction of the point O as the positive direction of an x axis, taking the downward direction of the point O as the positive direction of a y axis, and taking the direction which is vertical to the plane of the picture and is outward as the positive direction of a z axis;
3) acquiring coordinate information of a left eye pupil, a right eye pupil, a nose tip, a left mouth corner and a right mouth corner of a human face of a person from the image: eye _ left (x)1,y1),eye_right(x2,y2),nose(x3,y3),mouth_left(x4,y4),mouth_right(x5,y5);
4) Calculating the interocular distance g of the person in the image in the x-axis direction1=|x1-x2Calculating the center of the eyebrow to the mouth of the person in the imageDistance g in y-axis direction2=(|y1-y4|+|y2-y5I)/2, calculating the interocular distance of the person on the xOy plane in the imageCalculating the center-to-center distance of the eyebrow and the mouth of the person on the xOy plane in the imageLet triangle composed of eye _ left, eye _ right and nose be triangle A, let a be the distance between eye _ left and nose on the xOy surface, let b be the distance between eye _ right and nose on the xOy surface, and g be1The actual length is set to g1_real;
a) When a is more than or equal to b and a/b is less than 1.4 or a is more than or equal to b and b/a is less than 1.4, the face of the user raises, lowers, rotates clockwise, rotates anticlockwise or completely faces to the camera lens: g1_real=(L1/f1)×g1;
b) When a is more than or equal to b and a/b is more than 1.4 or a is more than or equal to b and b/a is more than 1.4, the human face rotates left, right, left-up, right-up, left-down or right-down:
when g1 < g2, g1_real=(L2/f2)×g1,
When g1 > g2, g1_real=(L1/f1)×g1;
5) Calculate g1Ratio R to image width W1=g1Calculating g from/W1Angle occupied in horizontal viewing angle of camera: beta ═ R1X alpha, and calculating the real distance n between the person and the camera as g1Absolute/tan β; and c is the real distance between the person and the camera in the direction of the number axis Oz, and the value of c is estimated: c is approximately equal to n; calculating the image distance e ═ x from the tip of the nose to the image center point in the direction of the axis Ox3-W/2|, calculating the ratio R of e to W2Calculating the angle of the horizontal visual angle of the camera occupied by e: eta ═ R2X alpha, calculating the direction of the axis Ox of the person to the center point of the imageThe true distance w ═ c × tan η;
6) to person Pi,PjRespectively executing 3) to 5) to respectively obtain the person PiAnd PjTrue distance c to camera in direction of axis OziAnd cjPerson PiAnd PjTrue distance w to the center of the picture in the direction of the axis OxiAnd wj;
7) Calculator PiAnd PjTrue distance in the direction of the axis Ox: when person PiAnd PjAll to the left or right of the image center point, x ═ wi-wjL, |; when person PiAnd PjWhen distributed at both sides of the image center point, x is wi+wj(ii) a Person PiAnd PjTrue distance z ═ c in the direction of the axis Ozi-cjL, |; calculating an estimated distance between any two persons
In the step 3), coordinate information of a left eye pupil, a right eye pupil, a nose tip, a left mouth corner and a right mouth corner of the face is obtained, and the method comprises the following steps: and acquiring the coordinate information of the human face organ by using a Retinaface human face detector based on deep learning training.
In the step 4), the values of L1 and L2 are from the average distance between the human face organs of adults in GB2428-81 head series of Chinese adults: eye distance L from left eye to right eye10.07m, and a distance L from the center of the eyebrow to the center of the mouth2=0.07m。
The invention has the following beneficial effects: the method has the advantages of no need of extra hardware overhead, low deployment cost, capability of directly utilizing the existing monitoring equipment for ranging, and low requirement on the stability of the environmental condition. Coordinate information of target eyes, a nose and a mouth in a picture is obtained through a face recognition technology based on deep learning, and a projection geometric algorithm is used for a detection result to obtain a face distance, so that face distance estimation can be realized at low cost.
Drawings
FIG. 1 is a picture taken by a camera at a time;
fig. 2 is a result diagram of a face distance calculation method based on face recognition.
Detailed description of the invention
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be further illustrated and described with reference to the accompanying drawings and examples. The technical features of the embodiments of the present invention can be combined correspondingly without mutual conflict.
As shown in fig. 1, a face distance estimation method based on face recognition, which performs face distance calculation according to images obtained after a plurality of people are shot by a camera, includes the following steps:
1) acquiring a value of a horizontal visual angle alpha of the camera;
2) establishing a space rectangular coordinate system: taking the top left vertex of the picture as an origin O, taking the right direction of the point O as the positive direction of an x axis, taking the downward direction of the point O as the positive direction of a y axis, and taking the direction which is vertical to the plane of the picture and is outward as the positive direction of a z axis;
3) acquiring coordinate information of a left eye pupil, a right eye pupil, a nose tip, a left mouth corner and a right mouth corner of a face of a person in an image: eye _ left (x)1,y1),eye_right(x2,y2),nose(x3,y3),mouth_left(x4,y4),mouth_right(x5,y5);
4) Calculating the interocular distance g of the person in the image in the x-axis direction1=|x1-x2L, calculating the distance g between the eyebrow center and the mouth center of the person in the image in the y-axis direction2=(|y1-y4|+|y2-y5I)/2, calculating the interocular distance of the person on the xOy plane in the imageCalculating the center-to-center distance of the eyebrow and the mouth of the person on the xOy plane in the imageEye _ left,The triangle formed by eye _ right and nose is set as triangle A, the distance between eye _ left and nose on the xOy surface is set as a, the distance between eye _ right and nose on the xOy surface is set as b, and g1The actual length is set to g1_real;
a) When a is more than or equal to b and a/b is less than 1.4 or a is more than or equal to b and b/a is less than 1.4, the face of the user raises, lowers, rotates clockwise, rotates anticlockwise or completely faces to the camera lens: g1_real=(L1/f1)×g1;
b) When a is more than or equal to b and a/b is more than 1.4 or a is more than or equal to b and b/a is more than 1.4, the human face rotates left, right, left-up, right-up, left-down or right-down:
when g1 < g2, g1_real=(L2/f2)×g1,
When g1 > g2, g1_real=(L1/f1)×g1;
5) Calculate g1Ratio R to image width W1=g1Calculating g from/W1Angle occupied in horizontal viewing angle of camera: beta ═ R1X alpha, and calculating the real distance n between the person and the camera as g1Absolute/tan β; and c is the real distance between the person and the camera in the direction of the number axis Oz, and the value of c is estimated: c is approximately equal to n; calculating the image distance e ═ x from the tip of the nose to the image center point in the direction of the axis Ox3-W/2|, calculating the ratio R of e to W2Calculating the angle of the horizontal visual angle of the camera occupied by e: eta ═ R2X α, calculating the true distance w in the direction of the axis Ox from the person to the image center point, which is c × tan η;
6) to person Pi,PjRespectively executing 3) to 5) to respectively obtain the person PiAnd PjTrue distance c to camera in direction of axis OziAnd cjPerson PiAnd PjTrue distance w to the center of the picture in the direction of the axis OxiAnd wj;
7) Calculator PiAnd PjTrue distance in the direction of the axis Ox: when the person isPiAnd PjAll to the left or right of the image center point, x ═ wi-wjL, |; when person PiAnd PjWhen distributed at both sides of the image center point, x is wi+wj(ii) a Person PiAnd PjTrue distance z ═ c in the direction of the axis Ozi-cjL, |; calculating an estimated distance between any two persons
In the step 3), coordinate information of a left eye pupil, a right eye pupil, a nose tip, a left mouth corner and a right mouth corner of the face is obtained, and the method comprises the following steps: acquiring coordinate information of a human face organ by using a Retinaface human face detector based on deep learning training;
in the step 4), the values of L1 and L2 are from the average distance between the human face organs of adults in GB2428-81 head series of Chinese adults: eye distance L from left eye to right eye10.07m, and a distance L from the center of the eyebrow to the center of the mouth2=0.07m。
Examples
To facilitate the understanding and realization of the present invention by those of ordinary skill in the art, a specific embodiment of the method of the present invention will now be given. The core idea of estimating the distance of the personnel by using the face recognition technology and the projection geometric algorithm is as follows: coordinate information of target eyes, a nose and a mouth in a picture is obtained through a face recognition technology based on deep learning, and a projection geometric algorithm is used for a detection result to obtain a face distance, so that face distance estimation can be realized at low cost.
A Haikang DS-2DC7423IW-A camera is installed in a room, and the ip address of the camera and the URL used for access in the program are obtained by using an iVMS-4200 client. In the program, an OpenCV function library of python language is used for accessing a camera according to a URL to acquire a picture.
And acquiring a picture of the changed place through a camera of a certain place. The picture size is: 1087 × 610, coordinate Pic (x) of center point of picturepic,ypic) (543.5, 305). Refer to the camera description toThe horizontal angle of view α of the camera is taken to be 60 °.
Establishing a space rectangular coordinate system: and taking the top left vertex of the picture as an origin O, taking the right direction of the point O as the positive direction of an x axis, taking the downward direction of the point O as the positive direction of a y axis, and taking the direction which is vertical to the plane where the picture is positioned and is outward as the positive direction of a z axis.
Obtaining person P in image by utilizing Retina face detector based on deep learning training1The left eye pupil, the right eye pupil, the nose tip, the left mouth corner and the right mouth corner: left _ eye1(636,447)、right_eye1(653,454)、nose1(634,463)、left_mouth1(636,472)、right_mouth1(647, 477); coordinate information of left eye pupil, right eye pupil, nose tip, left mouth corner, right mouth corner of person P2: left _ eye2(140,243)、right_eye2(151,240)、nose2(146,250)、left_mouth2(143,255)、right_mouth2(152,253)。
According to the average distance between the face organs of the adults in GB2428-81 head type series of Chinese adults, the distance between eyes L1 is 0.07m, and the distance between the eyebrow center and the mouth center L2 is 0.07 m.
Calculator P1G of1=|x1-x2|=17,g2=(|y1-y4|+|y2-y5|)/2=24, In this case, a is not more than b and b/a is less than 1.4, g1_real=(L1/f1)×g1=0.065m。R1=g1/W=0.016,β=R1×α=0.94°,ci≈n=g1_real/tanβ=3.95m。e=|x3-W/2|=90.5,R2=e/W=0.083,η=R2×α=4.995°,wi=ci×tanη=0.35m。
Calculator P2G of1=11,g2=12.5,f1=11.40,f212.66, 9.22 for a and 11.18 for b. In this case, a is not more than b and b/a is less than 1.4, g1_real=(L1/f1)×g1=0.068m。R1=g1/W=0.01,β=R1×α=0.61°,cj≈n=g1_real/tanβ=6.37m。e=|x3-W/2|=397.5,R2=e/W=0.37,η=R2×α=21.94°,wj=cj×tanη=2.57m。
Person P1X-axis coordinate of nose tip minus x-axis coordinate k of picture center190.5, person P2X-axis coordinate of nose tip minus x-axis coordinate k of picture center2-397.5, it can be determined that person P1 is to the right of the image, person P2On the left side of the image. To yield x ═ wi+wj=2.92m,z=|ci-cjTo derive an estimated distance between any two persons
Claims (3)
1. A face distance estimation method based on face recognition is characterized in that face distance calculation is carried out according to images obtained after a plurality of people are shot by a camera, and the method comprises the following steps:
1-1) obtaining the value of the horizontal visual angle alpha of the camera;
1-2) establishing a space rectangular coordinate system: taking the top left vertex of the picture as an origin O, taking the right direction of the point O as the positive direction of an x axis, taking the downward direction of the point O as the positive direction of a y axis, and taking the direction which is vertical to the plane of the picture and is outward as the positive direction of a z axis;
1-3) acquiring coordinate information of a left eye pupil, a right eye pupil, a nose tip, a left mouth corner and a right mouth corner of a human face of a person from an image: eye _ left (x)1,y1),eye_right(x2,y2),nose(x3,y3),mouth_left(x4,y4),mouth_right(x5,y5);
1-4) calculating the interocular distance g of the person in the x-axis direction in the image1=|x1-x2L, calculating the distance g between the eyebrow center and the mouth center of the person in the image in the y-axis direction2=(|y1-y4|+|y2-y5I)/2, calculating the interocular distance of the person on the xOy plane in the imageCalculating the center-to-center distance of the eyebrow and the mouth of the person on the xOy plane in the imageLet triangle composed of eye _ left, eye _ right and nose be triangle A, let a be the distance between eye _ left and nose on the xOy surface, let b be the distance between eye _ right and nose on the xOy surface, and g be1The actual length is set to g1_real;
a) When a is more than or equal to b and a/b is less than 1.4 or a is more than or equal to b and b/a is less than 1.4, the face of the user raises, lowers, rotates clockwise, rotates anticlockwise or completely faces to the camera lens: g1_real=(L1/f1)×g1;
b) When a is more than or equal to b and a/b is more than 1.4 or a is more than or equal to b and b/a is more than 1.4, the human face rotates left, right, left-up, right-up, left-down or right-down:
when g1 < g2, g1_real=(L2/f2)×g1,
When g1 > g2, g1_real=(L1/f1)×g1;
1-5) calculating g1Ratio R to image width W1=g1Calculating g from/W1Angle occupied in horizontal viewing angle of camera: beta ═ R1X alpha, and calculating the real distance n between the person and the camera as g1Absolute/tan β; and c is the real distance between the person and the camera in the direction of the number axis Oz, and the value of c is estimated: c is approximately equal to n; meterCalculating the image distance e ═ x from the tip of the nose to the image center point in the direction of the axis Ox3-W/2|, calculating the ratio R of e to W2Calculating the angle of the horizontal visual angle of the camera occupied by e: eta ═ R2X α, calculating the true distance w in the direction of the axis Ox from the person to the image center point, which is c × tan η;
1-6) to person Pi,PjRespectively executing 1-3) to 1-5), respectively obtaining the person PiAnd PjTrue distance c to camera in direction of axis OziAnd cjPerson PiAnd PjTrue distance w to the center of the picture in the direction of the axis OxiAnd wj;
1-7) the calculator PiAnd PjTrue distance in the direction of the axis Ox: when person PiAnd PjAll to the left or right of the image center point, x ═ wi-wjL, |; when person PiAnd PjWhen distributed at both sides of the image center point, x is wi+wj(ii) a Person PiAnd PjTrue distance z ═ c in the direction of the axis Ozi-cjL, |; calculating an estimated distance between any two persons
2. The method according to claim 1, wherein 1-3) the coordinate information of the left eye pupil, the right eye pupil, the nose tip, the left mouth corner and the right mouth corner of the human face is obtained by: and acquiring the coordinate information of the human face organ by using a Retinaface human face detector based on deep learning training.
3. The method of claim 1, wherein 1-4) said L1And L2The value of (A) is from the average distance between the face organs of the adult human in GB2428-81 head type series of Chinese adults: eye distance L from left eye to right eye10.07m, and a distance L from the center of the eyebrow to the center of the mouth2=0.07m。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011263555.7A CN112364777B (en) | 2020-11-12 | 2020-11-12 | Face distance estimation method based on face recognition |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011263555.7A CN112364777B (en) | 2020-11-12 | 2020-11-12 | Face distance estimation method based on face recognition |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112364777A true CN112364777A (en) | 2021-02-12 |
CN112364777B CN112364777B (en) | 2023-05-16 |
Family
ID=74514563
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011263555.7A Active CN112364777B (en) | 2020-11-12 | 2020-11-12 | Face distance estimation method based on face recognition |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112364777B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115409663A (en) * | 2022-09-02 | 2022-11-29 | 吉林农业科技学院 | Training system for improving enterprise employee quality |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110728215A (en) * | 2019-09-26 | 2020-01-24 | 杭州艾芯智能科技有限公司 | Face living body detection method and device based on infrared image |
CN110781712A (en) * | 2019-06-12 | 2020-02-11 | 上海荟宸信息科技有限公司 | Human head space positioning method based on human face detection and recognition |
CN111914783A (en) * | 2020-08-10 | 2020-11-10 | 深圳市视美泰技术股份有限公司 | Method and device for determining human face deflection angle, computer equipment and medium |
-
2020
- 2020-11-12 CN CN202011263555.7A patent/CN112364777B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110781712A (en) * | 2019-06-12 | 2020-02-11 | 上海荟宸信息科技有限公司 | Human head space positioning method based on human face detection and recognition |
CN110728215A (en) * | 2019-09-26 | 2020-01-24 | 杭州艾芯智能科技有限公司 | Face living body detection method and device based on infrared image |
CN111914783A (en) * | 2020-08-10 | 2020-11-10 | 深圳市视美泰技术股份有限公司 | Method and device for determining human face deflection angle, computer equipment and medium |
Non-Patent Citations (1)
Title |
---|
朱树先;张仁杰;: "人眼定位算法与人脸图像标准化" * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115409663A (en) * | 2022-09-02 | 2022-11-29 | 吉林农业科技学院 | Training system for improving enterprise employee quality |
Also Published As
Publication number | Publication date |
---|---|
CN112364777B (en) | 2023-05-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10353465B2 (en) | Iris and pupil-based gaze estimation method for head-mounted device | |
CN107545302B (en) | Eye direction calculation method for combination of left eye image and right eye image of human eye | |
WO2022012192A1 (en) | Method and apparatus for constructing three-dimensional facial model, and device and storage medium | |
US10628948B2 (en) | Image registration device, image registration method, and image registration program | |
CN110807364B (en) | Modeling and capturing method and system for three-dimensional face and eyeball motion | |
WO2021004257A1 (en) | Line-of-sight detection method and apparatus, video processing method and apparatus, and device and storage medium | |
WO2019062056A1 (en) | Smart projection method and system, and smart terminal | |
JP2008194146A (en) | Visual line detecting apparatus and its method | |
JP2008102902A (en) | Visual line direction estimation device, visual line direction estimation method, and program for making computer execute visual line direction estimation method | |
Malleson et al. | Rapid one-shot acquisition of dynamic VR avatars | |
Rocca et al. | Head pose estimation by perspective-n-point solution based on 2d markerless face tracking | |
CN111582036B (en) | Cross-view-angle person identification method based on shape and posture under wearable device | |
JP5349238B2 (en) | Facial expression recognition device, interpersonal emotion estimation device, facial expression recognition method, interpersonal emotion estimation method, and program | |
Otsuka et al. | Conversation scene analysis with dynamic bayesian network basedon visual head tracking | |
CN112364777A (en) | Face distance estimation method based on face recognition | |
JP6950644B2 (en) | Attention target estimation device and attention target estimation method | |
Pham et al. | Robust real-time performance-driven 3D face tracking | |
Heo et al. | Rapid 3D face modeling using a frontal face and a profile face for accurate 2D pose synthesis | |
CN112633217A (en) | Human face recognition living body detection method for calculating sight direction based on three-dimensional eyeball model | |
Elgharib et al. | Egoface: Egocentric face performance capture and videorealistic reenactment | |
US9940504B2 (en) | Method to produce consistent face texture | |
JP2007109126A (en) | Moving body distribution estimation device, moving body distribution estimation method, and moving body distribution estimation program | |
Tordoff et al. | Head pose estimation for wearable robot control. | |
CN111652045B (en) | Classroom teaching quality assessment method and system | |
CN110781712B (en) | Human head space positioning method based on human face detection and recognition |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |