Static Image Face Detection
Face Detection
Windows/Linux/Arm_Linux interface is described here, for Android interface please refer to Android Interface Description.
stid_facepro_detector_create_handle
Function: Create a detector handle by loading a model file.
Note:
1, The the current SDK version does not support multi-threaded calls, if you need to call multiple threads for multiple times, multiple handles need to be created: a separate handle for each thread.
2, For each thread, the initialization function only needs to be called one time; subsequent face detection functions can be called multiple times without creating a new handle.
Declaration:
Parameters:
[out] out_handle: Return the initialized handle, when not in use, call destroy_handle to release resource.
[in] alignment_model_filename: Pass the location of the alignment model file.
[in] config: Setup configuration options for the detector. For details, please refer to section Interface body and interface configuration parameter macro definition#config(detect).
Return:
[return] Return STID_OK if successful, otherwise return error code.
stid_facepro_detector_destroy_handle
Function: Release handle.
Declaration:
Parameters:
[in] handle: Handle to be released.
stid_facepro_detector_detect
Function: Input a frame of image, return information including face frame and key points.
Declaration:
Parameters:
[in] handle: Initialized handle.
[in] input_image: Input a frame of image.
[in] face_orientation: Specifies face orientation, a facing up image is preferred for efficiency purposes.
[out] out_detection_result_array: Return an array of face frame information, sorted by the rectangle size from large to small. The number of arrays is out_face_count; API is responsible for allocating memory, need to call stid_facepro_release_detection_results_array to release.
[out] out_landmarks_array: Return an array of detected face key points, the elements correspond to out_detection_result_array; API is responsible for allocating memory, need to call stid_facepro_release_landmarks_array to release.
[out] out_face_count: Return the number of faces detected.
Return:
[return] Return STID_OK if successful, otherwise return error code.
stid_facepro_set_detector_threshold
Function: Setup the face frame detection threshold. Once set, the stid_facepro_detector_detect interface filters frames based on the score returned by the stid_detection_result_t structure. Face frames with a score of less than or equal to the threshold will not be returned.
Declaration:
Parameters:
[in] handle: Initialized handle.
[in] threshold: Setup the threshold. Its valid range is (0.0, 1.0).
Return:
[return] Return STID_OK if successful, otherwise return error code.
stid_facepro_release_detection_results_array
Function: Release face information array.
Declaration:
Parameters:
[in] results_array: The beginning location of the face information array to be released.
[in] results_array_size: The size of face information arrays to be released.
stid_facepro_release_landmarks_array
Function: Release the detected face key points array.
Declaration:
Parameters:
[in] landmarks_array: The beginning location of the face information array to be released.
[in] landmarks_array_count: The number of face information arrays to be released.
Face frame
0-32
Nasal bridge
43-46
Left eyebrow
33-37,64-67
Right eyebrow
38-42,68-71
Left eye orbit
52-57
Right eye orbit
58-63
Left pupil
72-74,104
Right pupil
75-77,105
Nose tip
47-51
Nose wing
78-83
Upper lip
84-90,96-100
Lower lip
91-95,101-103
Last updated