Search code examples
affdex-sdk

Get face coordinates using affdex sdk


It's possible to get face coordinates in image source file or frame? Some thing like:

            face.Height = Affdex.Face[0].PositionHeight;
            face.Left = Affdex.Face[0].PositionLeft;
            face.Top = Affdex.Face[0].PositionTop;
            face.Width = Affdex.Face[0].PositionWidth;

http://developer.affectiva.com/fpi/


Solution

  • The bounding box for each face is not provided directly via the Affdex SDKs, but they do provide coordinates for all the face points, so to determine a face's bounding box, all you need to do is iterate through its face points and track the max/min values in each dimension.

    As an example, see the drawFacePoints method in the DrawingView class of the AffdexMe sample app: https://github.com/Affectiva/affdexme-android/blob/master/app/src/main/java/com/affectiva/affdexme/DrawingView.java