-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Face rotation/angle detection #95
Comments
You can get eye position from Face Landmarks which allows you to calculate to get angle. So solved! |
Hi @YanDevDe . I need that solution to find out multiple faces out from a video of student class room. |
Hello @gauravdhra I assume you can get position by using face landmark. With those position you can either calculate...
I'm sorry if I was not a help! Regards, Yan |
Also you may want to checkout at face-api.js since this face-recognition.js is obsolete. |
Hey @YanDevDe ,after two years you still have solution wow !!! I have all the position let me find the value of c :) eye_right [466.1014111340046, 199.98082201182842] |
@gauravdhra to be fair, I forgot that I was using this library lol. But this was a logical approach to detect the rotation/tilt of the faces. Yeah those values are more than enough! Now calculating is the only part left! =) Glad that I could help you! Regards, Yan |
Could you clarify this The shorter distance it is, the more you're looking down/up . |
the distance between both eyes should be equal to the distance between any eye and mouth . |
You can either calculate the center point (lets call For mouth position, let's call So that means in order to calculate the const distance_x = mp.x - cp.x;
const distance_y = mp.y - cp.y;
const distance = Math.sqrt(distance_x * distance_x + distance_y + distance_y); The distance is now the value which you can guess if the face is tilting or not. The smaller distance it is, the more you're looking down or looking up (by up, I mean like up and not front) The distance value may be bit different depending on face's different position / distances. So using simple equal operator may be not enough. But that's up to you to solve it. 😅 |
@YanDevDe I understand the distance will be calculated according to the close faces and the faces sitting behind . I have calculated the distance and I am stuck here how to decide the face rotation |
As far I've read from a while ago, almost every face has same eyes distance (left and right eye). So you can use eyes distance to tell on which distance your face is from camera. 🤷 But don't see this as confirmation, maybe I'm wrong as well. You can also use the rectangle detection sizes as distance between face and camera, if that works for you. |
Hi @YanDevDe that was helpful for me . |
@YanDevDe Please help me out |
Hi @YanDevDe @gauravdhra, Please help me
` |
Hi,
Did you have the detailed requirements ?such as pdf. Could you send another email.
…------------------ 原始邮件 ------------------
发件人: "justadudewhohacks/face-recognition.js" <[email protected]>;
发送时间: 2021年1月18日(星期一) 下午5:49
收件人: "justadudewhohacks/face-recognition.js"<[email protected]>;
抄送: "Subscribed"<[email protected]>;
主题: Re: [justadudewhohacks/face-recognition.js] Face rotation/angle detection (#95)
Hi @YanDevDe @gauravdhra, Please help me
I get position of mouth, left eye and right eye by blow code
const mouth = landmarks.getMouth(); const leftEye = landmarks.getLeftEye(); const rightEye = landmarks.getRightEye(); console.log("Left eye position ===>" + JSON.stringify(leftEye)); console.log("Right eye position ===>" + JSON.stringify(mouth)); console.log("Mouth position ===>" + JSON.stringify(mouth));
Result:
// mouth position [{"_x":203.203125,"_y":399.6875},{"_x":217.1484375,"_y":382.5},{"_x":230.7421875,"_y":383.4375},{"_x":245.625,"_y":376.5625},{"_x":254.296875,"_y":370.3125},{"_x":253.828125,"_y":365},{"_x":275.859375,"_y":371.875},{"_x":275.625,"_y":360.625},{"_x":283.125,"_y":396.875},{"_x":267.1874713897705,"_y":420.00003814697266},{"_x":258.28125,"_y":424.6875},{"_x":238.2421875,"_y":415.3125},{"_x":202.14845180511475,"_y":399.6875},{"_x":236.015625,"_y":381.5625},{"_x":246.5625,"_y":383.4375},{"_x":258.75,"_y":371.5625},{"_x":264.140625,"_y":366.5625},{"_x":269.296875,"_y":390.3125},{"_x":259.21875,"_y":405.9375},{"_x":252.1875,"_y":406.875}] // leftEye position [{"_x":98.14453125,"_y":344.0625},{"_x":106.99220180511475,"_y":331.875},{"_x":126.4453125,"_y":318.28125},{"_x":156.09375,"_y":314.0625},{"_x":140.390625,"_y":329.375},{"_x":112.32422590255737,"_y":333.75}] // rightEye position [{"_x":220.3125,"_y":286.7187690734863},{"_x":243.2812786102295,"_y":277.03125},{"_x":247.9687786102295,"_y":283.59375},{"_x":246.796875,"_y":269.0625},{"_x":243.2812786102295,"_y":292.1875},{"_x":243.2812786102295,"_y":286.25}]
How to calculate distance from left/right eye to mouth?
Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
add my weichat 13501901060
…------------------ 原始邮件 ------------------
发件人: "justadudewhohacks/face-recognition.js" <[email protected]>;
发送时间: 2021年1月18日(星期一) 下午5:49
收件人: "justadudewhohacks/face-recognition.js"<[email protected]>;
抄送: "Subscribed"<[email protected]>;
主题: Re: [justadudewhohacks/face-recognition.js] Face rotation/angle detection (#95)
Hi @YanDevDe @gauravdhra, Please help me
I get position of mouth, left eye and right eye by blow code
const mouth = landmarks.getMouth(); const leftEye = landmarks.getLeftEye(); const rightEye = landmarks.getRightEye(); console.log("Left eye position ===>" + JSON.stringify(leftEye)); console.log("Right eye position ===>" + JSON.stringify(mouth)); console.log("Mouth position ===>" + JSON.stringify(mouth));
Result:
// mouth position [{"_x":203.203125,"_y":399.6875},{"_x":217.1484375,"_y":382.5},{"_x":230.7421875,"_y":383.4375},{"_x":245.625,"_y":376.5625},{"_x":254.296875,"_y":370.3125},{"_x":253.828125,"_y":365},{"_x":275.859375,"_y":371.875},{"_x":275.625,"_y":360.625},{"_x":283.125,"_y":396.875},{"_x":267.1874713897705,"_y":420.00003814697266},{"_x":258.28125,"_y":424.6875},{"_x":238.2421875,"_y":415.3125},{"_x":202.14845180511475,"_y":399.6875},{"_x":236.015625,"_y":381.5625},{"_x":246.5625,"_y":383.4375},{"_x":258.75,"_y":371.5625},{"_x":264.140625,"_y":366.5625},{"_x":269.296875,"_y":390.3125},{"_x":259.21875,"_y":405.9375},{"_x":252.1875,"_y":406.875}] // leftEye position [{"_x":98.14453125,"_y":344.0625},{"_x":106.99220180511475,"_y":331.875},{"_x":126.4453125,"_y":318.28125},{"_x":156.09375,"_y":314.0625},{"_x":140.390625,"_y":329.375},{"_x":112.32422590255737,"_y":333.75}] // rightEye position [{"_x":220.3125,"_y":286.7187690734863},{"_x":243.2812786102295,"_y":277.03125},{"_x":247.9687786102295,"_y":283.59375},{"_x":246.796875,"_y":269.0625},{"_x":243.2812786102295,"_y":292.1875},{"_x":243.2812786102295,"_y":286.25}]
How to calculate distance from left/right eye to mouth?
Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@fredzhu008 I need to find if face is turned to left or right or straight looking faces. |
Could you send the original project description or other indormation,or example for that draw by handwriting?
I cannot get the goal for this project. It's you lab practice or commercial project?
…------------------ 原始邮件 ------------------
发件人: "justadudewhohacks/face-recognition.js" <[email protected]>;
发送时间: 2021年1月21日(星期四) 上午10:17
收件人: "justadudewhohacks/face-recognition.js"<[email protected]>;
抄送: "Fred"<[email protected]>;"Mention"<[email protected]>;
主题: Re: [justadudewhohacks/face-recognition.js] Face rotation/angle detection (#95)
@fredzhu008 I need to find if face is turned to left or right or straight looking faces.
Can you help me?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
It would be nice if there would be a way to detect the face's direction/rotation. You can calculate direction from both eyes.
The text was updated successfully, but these errors were encountered: