API Reference

setActivation

public static native int setActivation(String var0);

Name

setActivation

Description

Activate SDK

Input

  • var0 (String): The license string

Output

The SDK activation status code.

  • 0: Success

  • Non-zero: Activation failed

init

public static native int init(AssetManager var0);

Name

init

Description

Initiate SDK

Input

  • var0 (AssetManager): An instance of AssetManager used to access application assets

Output

The SDK initialization status code.

  • 0: Success

  • -1: License Key Error

  • -2: License AppID Error

  • -3: License Expired

  • -4: Activate Error

  • -5: Initialize SDK Error

yuv2Bitmap

public static native Bitmap yuv2Bitmap(byte[] nv21, int width, int height, int orientation);

Name

yuv2Bitmap

Description

Convert YUV camera frame to Bitmap image

Input

  • nv21 (byte[]): Byte array representing the YUV image data in NV21 format

  • width (int): Width of the image

  • height (int): Height of the image

  • orientation (int): Orientation of the image

1 -> No processing 2 -> Flip horizontally 3 -> Flip horizontally first and then flip vertically 4 -> Vertical flip 5 -> Transpose 6 -> Rotate 90° clockwise 7 -> Horizontal and vertical flip --> Transpose 8 -> Rotate 90° counterclockwise

Output

A Bitmap object representing the converted image

faceDetection

public static native List<FaceBox> faceDetection(Bitmap var0, FaceDetectionParam var1);

Name

faceDetection

Description

Detect Face

Input

Output

A list of FaceBox objects representing the detected faces.

FaceDetectionParam

public class FaceDetectionParam {
    public boolean check_liveness = false;
    public int check_liveness_level = 0; // 0: more accurate model, 1: lighter model
}

FaceBox

public class FaceBox {
    public int x1;
    public int y1;
    public int x2;
    public int y2;
    public float liveness;
    public float yaw;
    public float roll;
    public float pitch;
}

The liveness score ranges from 0.0 to 1.0 Default Liveness Threshold is 0.7

templateExtraction

public static native byte[] templateExtraction(Bitmap var0, FaceBox var1);

Name

templateExtraction

Description

Extract face feature

Input

  • var0 (Bitmap): The Bitmap image

  • var1 (FaceBox): The bounding box of the detected face

Output

A byte array representing the extracted template from the face

similarityCalculation

public static native float similarityCalculation(byte[] var0, byte[] var1);

Name

similarityCalculation

Description

Calculate similarity between two face features

Input

  • var0 (byte[]): The byte array representing the first face template

  • var1 (byte[]): The byte array representing the second face template

Output

A float value representing the similarity score between the two face templates The score ranges from 0.0 to 1.0 Default Threshold is 0.8

Last updated