JCV顔認証SDK
2.0.5, English
2.0.5, English
  • Introduction
  • Function Description
  • Update log
  • Frequently Asked Questions
  • Quick start
    • Windows QuickStart
    • Linux QuickStart
    • ARM Linux QuickStart
    • Android QuickStart
  • Interface description
    • Authorization Instruction
    • C Interface description
      • Authorization Interface
      • Structure and Interface Configuration Parameter Macro Definition
      • Monocular Face Tracking
      • Binocular Face Tracking
      • Monocular Liveness Detection
      • Binocular Liveness Detection
      • Face Quality Detection
      • Static Image Face Detection
      • Extract Face Features
      • Face 1:1 Comparison and 1:N Search
      • Error Code
    • Java Interface Description-FaceproLibrary
    • Java Interface Description-Results
    • Android Interface Description
Powered by GitBook
On this page
  • Face Detection
  • stid_facepro_detector_create_handle
  • stid_facepro_detector_destroy_handle
  • stid_facepro_detector_detect
  • stid_facepro_set_detector_threshold
  • stid_facepro_release_detection_results_array
  • stid_facepro_release_landmarks_array

Was this helpful?

  1. Interface description
  2. C Interface description

Static Image Face Detection

PreviousFace Quality DetectionNextExtract Face Features

Last updated 5 years ago

Was this helpful?

Face Detection

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

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:

STID_SDK_API
stid_result_t
stid_facepro_detector_create_handle(
    stid_handle_t* out_handle,
    const char *alignment_model_filename,
    unsigned int config
);

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 .

Return:

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

stid_facepro_detector_destroy_handle

Function: Release handle.

Declaration:

STID_SDK_API
void
stid_facepro_detector_destroy_handle(
    stid_handle_t handle
);

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:

STID_SDK_API
stid_result_t
stid_facepro_detector_detect(
    stid_handle_t handle,
    const stid_image_t* input_image,
    stid_orientation_t face_orientation,
    stid_detection_result_t **out_detection_result_array,
    stid_landmarks_t **out_landmarks_array,
    int *out_face_count
);

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:

STID_SDK_API
stid_result_t
stid_facepro_set_detector_threshold(
    stid_handle_t handle,
    float threshold
);

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:

STID_SDK_API
void
stid_facepro_release_detection_results_array(
    const stid_detection_result_t *results_array,
    int results_array_size
);

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:

STID_SDK_API
void
stid_facepro_release_landmarks_array(
    const stid_landmarks_t *landmarks_array,
    int landmarks_array_count
);

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

Android Interface Description
Interface body and interface configuration parameter macro definition#config(detect)