0

I'm experimenting with creating a photo verification feature using Googles ML Kit face detection library (API reference). I'm get the following facial data:

{
  boundingBox: (rect),

  headEulerAngleX: (double),
  headEulerAngleY: (double),
  headEulerAngleZ: (double),

  landmarks: [
    {
      type: (bottomMouth, rightMouth, leftMouth, noseBase, etc etc),
      x: (int),
      y: (int),
    }
  ]
}

How can I calculate the distance between facial landmarks? I'm hoping with some measurements then I could compare with other facial data and see how similar they are. I assume I will need to calculate the distances between two landmarks whilst also considering the rotation of the head but I do not know the maths involved!

I realise it might be impossible to get measurement in millimetres without more data but hopefully I could make some relative landmark measurements such as the noseBase->leftEye is 56% of leftEye->rightEye (aka pupil distance).

desertnaut
  • 57,590
  • 26
  • 140
  • 166
jimmyff
  • 31
  • 5

0 Answers0