Affdex SDK: which face will be captured when there are multiple faces in the camera view

97 Views Asked by At

I am trying to analyze the emotion data using the affdex sdk integration in my Unity game. Below is the piece of code that I am using to get the emotions from face.

public float currentJoy;
public override void onImageResults(Dictionary<int, Face> faces)
{
    if (faces.Count > 0)
    {
        // get emotions
        faces[0].Emotions.TryGetValue(Emotions.Joy, out currentJoy);
        // similarly get other emotions
    }
}

Usually, there is only one face in front of the camera, but often it happens that there is another smaller face in the camera view. For example, consider the following picture.

enter image description here

If something similar happens while recording emotions, a main face in front of the camera and a smaller face somewhere behind. faces.Count would be greater than 1 in such a case. Would faces[0] still refer to the main face in front of the camera, or will be be random. For me there is no way to verify it myself, since I can't really say with certainty that whose emotions are being captured.

0

There are 0 best solutions below