4

I am using mlkit for face recognization from github link below:

https://github.com/firebase/quickstart-android/tree/master/mlkit

and to get distance, method below:

https://github.com/philiiiiiipp/Android-Screen-to-Face-Distance-Measurement

But this method needs to declare hard coded value

private var distance10 = 200
private var distance20 = 130
if (leftX != 0f && rightX != 0f) {distanceBetweenEyes = Math.abs(leftX - rightX)}

if((distanceBetweenEyes>distance20||distanceBetweenEyes>distance10){
Log.i("TAG_FACE","Face Detected Left Eye Right Distance:" + rightEye.position + "Right X" + rightX)}

But I am trying to do without hard coding.
Is there any other method to track the distance between face and screen.
Any library or methods to track the distance?

Giulio Caccin
  • 2,962
  • 6
  • 36
  • 57
  • Please see below link for similar answer https://ai.stackexchange.com/questions/20254/could-machine-learning-be-used-to-measure-the-distance-between-two-objects-from – app Jan 07 '22 at 11:11

0 Answers0