MediaPipeUnityPlugin icon indicating copy to clipboard operation
MediaPipeUnityPlugin copied to clipboard

Can I obtain the distance between my face and the camera?

Open JackeAstray opened this issue 1 year ago • 2 comments

Plugin Version or Commit ID

v0.16.1

Unity Version

6000.0.33

Your Host OS

Windows 11

Target Platform

Android

Description

I have a function to measure pupil distance that requires Unity to implement, but I don't know how to do it. Can it be achieved using MediaPipe? Or can we first obtain the distance between the face and the camera and then calculate the pupillary distance based on this?

Code to Reproduce the issue

No response

Additional Context

No response

JackeAstray avatar Jun 17 '25 04:06 JackeAstray

In the past, a depth estimation logic was also implemented, which calculated depth using the camera's field of view and the size of a human pupil. In other words, based on the assumption that pupil size varies little between individuals, if you know how much of the image’s vertical or horizontal length the pupil occupies, you can calculate the distance to the camera using proportional reasoning.

ref. https://research.google/blog/mediapipe-iris-real-time-iris-tracking-depth-estimation/

I believe a similar calculation could be applied to the distance between the pupils as well. However, depending on the required accuracy, this method may not be sufficient, and in that case, it would be difficult to achieve using only MediaPipe.

homuler avatar Jun 17 '25 06:06 homuler

Understood,thank you for your answer.

JackeAstray avatar Jun 17 '25 06:06 JackeAstray