Structure and Interface Configuration Parameter Macro Definition

General type interface description

Windows/Linux/Arm_Linux interface is described here, for Android interface please refer to Android interface description.

Structure and macro definition description

st_handle_t

Function: Handle for saving functions and data, need to call its corresponding destruct function to release and recycle memory

Declaration:

typedef void *st_handle_t;

st_result_t

Function: Indicate returned error code.

Declaration:

typedef int st_result_t;

struct stid_detection_result

Function: Face frame information.

Declaration:

typedef struct stid_detection_result {
    cv_rect32i_t rect;        ///< Result rect
    float score;            ///< Result score
    int label;            ///< result label
    int orientation;        ///< result orientation
    unsigned int reserved1;
    unsigned int reserved2;
} stid_detection_result_t;

struct stid_landmarks

Function: Face key points information

Declaration:

typedef struct stid_landmarks {
    cv_point3D32f *points_array;    ///< Key points array
    unsigned char *points_available;    ///< Identify whether key points are available, contain points_count elements, corresponding to points_array, a value of 1 indicates available, and 0 indicates unavailable
    int points_count;    ///< Number of key points
    int label;    ///< Obtain by tracking
    float alignment_score;    ///< Key point alignment score
    float label_score;
    void* extra_info; ///< Key point intermediate information
    float* points_score;
    unsigned int reserved1;
    unsigned int reserved2;
} stid_landmarks_t;

struct stid_target

Function: Tracking result

Declaration:

typedef struct stid_target {
    stid_detection_result_t detect_result;            ///< Frame
    stid_landmarks_t landmarks;        ///< Key points
    int id;                ///< Face id, during face tracking, when the currently tracked face changes, increase the value by 1 (it only indicates change, does not identify whether it is the same person).
} stid_target_t;

stid_pose

Function: Posture angle information

Declaration:

typedef struct stid_pose{
    float yaw;    ///< Rotating angle around the Y axis
    float pitch;    ///< Rotating angle around the X axis
    float roll;    ///< Rotating angle around the Z axis
} stid_pose_t;

stid_face_quality

Function: Face quality information

Declaration:

typedef struct stid_face_quality {
    float distance2center;      ///< [0,1]. max(1-distance from the features center to image center/image short edge length, 0)
    float size;                 ///< [0,1]. area of the facial features in the image/image area
    float occlusion;            ///< [0,1]. uncovered facial features area/area of the facial features
    float brightness;           ///< [-1,1]. higher scores indicate higher brightness
    float sharpness;            ///< [0,1]. higher scores indicate higher sharpness
    float mouth_open;           ///< [0,1]. calculate the degree of mouth opening, higher scores indicate lower degrees of mouth opening
    float missing;              ///< [0,1]. area of the facial features in the image/area of the facial features
} stid_face_quality_t;

config (detect)

Function: Face detection mode

Declaration:

#define STID_FACEPRO_DETECTOR_CONFIG_LARGE_FACE 0x00000000 //Large face
#define STID_FACEPRO_DETECTOR_CONFIG_SMALL_FACE 0x00000200 //Small face
#define STID_FACEPRO_DETECTOR_CONFIG_ANY_FACE 0x00000400 //Large and small face combinations, slower

config (track)

Function: Use asynchronous tracking, recommend to use only when the detection model is slower and requires real-time preview

Declaration:

#define STID_FACEPRO_TRACKING_CONFIG_ASYNC (0x00010000)

config (track)

Function: Face tracking mode

Declaration:

#define STID_FACEPRO_TRACKING_CONFIG_LARGE_FACE 0x00000000 //Large face
#define STID_FACEPRO_TRACKING_CONFIG_SMALL_FACE 0x00000200 //Small face

config (track)

Function: Set the maximum number of targets to track as N. The valid range is [1, 32] with a default value of 1. Continue to track the detected N targets until the number of targets is less than N, before continuing to detect again. Set as 1 for single-face tracking

Declaration:

#define STID_FACEPRO_DETECTION_OPTION_TYPE_LIMIT    (0x0001)

Function: Face quality calculation flag

Declaration:

#define STID_FACEPRO_QUALITY_FLAG_DISTANCE2CENTER  (1 << 2)
#define STID_FACEPRO_QUALITY_FLAG_SIZE             (1 << 3)
#define STID_FACEPRO_QUALITY_FLAG_OCCLUSION        (1 << 4)
#define STID_FACEPRO_QUALITY_FLAG_BRIGHTNESS       (1 << 5)
#define STID_FACEPRO_QUALITY_FLAG_SHARPNESS        (1 << 6)
#define STID_FACEPRO_QUALITY_FLAG_MOUTH            (1 << 7)
#define STID_FACEPRO_QUALITY_FLAG_MISSING          (1 << 10)
#define STID_FACEPRO_QUALITY_FLAG_ALL              (0xffffffff)

Last updated