Face Quality Detection

Face quality detection and face angle calculation

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

stid_facepro_image_quality_assessment

Function: Calculate face image quality.

Declaration:

STID_SDK_API
stid_result_t
stid_facepro_image_quality_assessment(
    const stid_image_t* input_image,
    const stid_landmarks_t* input_landmarks,
    unsigned int face_quality_flag,
    stid_face_quality_t* out_face_quality_result
);

Parameters:

  • [in] input_image: Image to be calculated; support four orientations of up, down, left and right. Facing up is recommended for a better performance.

  • [in] input_landmarks: Face key points.

  • [in] face_quality_flag: Flag, set this flag to calculate a specified face quality index; can use '|' to combine and calculate multiple flags at the same time.

  • [out] out_face_quality_result: Return face quality result.

Return:

  • [return] Return STID_OK if successful, otherwise return error code.

stid_facepro_calcpose_create_handle

Function: Create head pose calculation handle.

Declaration:

STID_SDK_API
stid_result_t
stid_facepro_calcpose_create_handle(
    stid_handle_t *out_handle,
    const char *model_filename
);

Parameters:

  • [out] out_handle: Return the created handle pointer.

  • [in] model_filename: Pass in the model file location.

Return:

  • [return] Return STID_OK if successful, otherwise return error code.

stid_facepro_calcpose_destroy_handle(

Function: Release handle.

Declaration:

STID_SDK_API
void
stid_facepro_calcpose_destroy_handle(
    stid_handle_t handle
);

Parameters:

  • [in] handle: Initialized head pose calculation handle.

Return: None.

stid_facepro_calcpose_get_head_pose

Function: Determine the three-dimensional face rotation angle and the distance between the two eyeballs by locating the key points; first calculate the roll angle, then calculate the yaw and the pitch.

Declaration:

STID_SDK_API
stid_result_t
stid_facepro_calcpose_get_head_pose(
    stid_handle_t handle,
    const stid_landmarks_t* input_landmarks,
    stid_pose_t* out_head_pose
);

Parameters:

  • [in] handle: Initialized head pose calculation handle.

  • [in] input_landmarks: Face key points.

  • [out] out_head_pose: Output head pose.

Return:

  • [return]Return ST_OK if successful, otherwise return error type.

stid_facepro_quality_motion_sharpness_create_handle

Function: Create handle.

Declaration:

STID_SDK_API
stid_result_t
stid_facepro_quality_motion_sharpness_create_handle(
    stid_handle_t* out_handle
);

Parameters:

  • [out] out_handle: Returns frame selection handle.

Return:

  • [return] Return STID_OK if successful, otherwise return error code.

Note:

  • motion_sharpness module is used to select the least blurred frame from a video, which is the sharpest frame.

stid_facepro_quality_motion_sharpness_destroy_handle

Function: Destroy handle.

Declaration:

STID_SDK_API
void
stid_facepro_quality_motion_sharpness_destroy_handle(
    stid_handle_t handle
);

Parameters:

  • [in] handle: Handle to be destroyed.

stid_facepro_quality_motion_sharpness_reset

Function: Reset the frame selection handle to start a new frame selection process.

Declaration:

STID_SDK_API
stid_result_t
stid_facepro_quality_motion_sharpness_reset(
    stid_handle_t handle
);

Parameters:

  • [in] handle: Initialized frame selection handle.

Return:

  • [return] Return STID_OK if successful, otherwise return error code.

stid_facepro_quality_motion_sharpness_get_score

Function: Input a frame of moving living body data to get the quality score, larger score indicate better quality.

Declaration:

STID_SDK_API
stid_result_t
stid_facepro_quality_motion_sharpness_get_score(
    stid_handle_t handle,
    const stid_landmarks_t *input_landmarks,
    float *out_score
);

Parameters:

  • [in] handle: Initialized handle.

  • [in] landmarks: Key point information of the current frame.

  • [out] out_score: Return the score of the frame, commonly within [0, 1].

Return:

  • [return] Return STID_OK if successful, otherwise return error code.

Last updated