Good, I have the inconvenience in which I need to make a facial comparison between faces and through my research I determined that it is done by the facial reference points found in a face. For now I can get and process this information using the Vision API with its simple way of getting faces and facial landmarks from them. For now I'm doing well but my drawbackIt occurs when trying to obtain the distance between facial points since these, according to the proximity of the camera, vary in size and it does not help me to be able to compare. In conclusion, what I am looking for is the way to be able to compare the distance between reference points regardless of the distance, only the image quality, I understand that in theory it is the best way to compare a face.
The code I use to get the Facial Reference Points:
for (int i = 0; i < faces.size(); ++i) {
Face face = faces.valueAt(i);
for (Landmark landmark : face.getLandmarks()) {
//aqui obtengo los tamaños pero estos varían
float x = landmark.getPosition().x;
float y = landmark.getPosition().y;
}
}
This small fraction of code allows me to obtain the Landmarks or Facial Reference Points . This way I get the distance between each point but this varies according to the proximity of the camera.
Thank you very much and I look forward to your support.
From my ignorance in facial recognition and daring I would try to do this:
would calculate the center point
It would calculate the distances to the center point of each landmark.
and normalize them
From prudence since I have never worked with facial recognition, I think that knowing the reference points of the source image, the distances are calculated (d1, d2, d3, d4, ...). Now in the image that you are going to compare, the reference points are taken and the same distances are also calculated (D1, D2, D3, D4, ...).
d1/D1 = to
d2/D2 = b
d3/D3 = c
d4/D4 = d
If a , b , c , and d are equal, then both compared images are equal. If, in addition, said value is 1, then we say that they are on the same scale. If the values a , b , c , and d do not match (are different) then the comparison is negative.
I hope that I have been understood.
Greetings.