Face Image Quality

ErrorCode Trueface::SDK::estimateFaceTemplateQuality(const TFFacechip &tfFacechip, bool &isTemplateQualityGood, float &score)

Template quality score is a metric defined to measure the biometric utility or effectiveness of a face sample for the purpose of face recognition. It does not measure the visual quality of the sample. Biometric utility is specifically about the sample’s effectiveness in a biometric system, which may not always align with human perception of image quality. For instance, a visually clear image might have low biometric utility if the facial features are not captured in a way conducive to accurate matching.

Parameters:
  • tfFacechip[in] The TFFacechip returned by extractAlignedFace().

  • isTemplateQualityGood[out] Indicates if the face chip is suitable for face recognition.

  • score[out] The quality score. Can be used for custom thresholding (default > 1.f is good quality).

Returns:

Error code, see ErrorCode.

ErrorCode Trueface::SDK::estimateFaceTemplateQualities(const std::vector<TFFacechip> &tfFacechips, std::vector<bool> &areTemplateQualitiesGood, std::vector<float> &scores)

Template quality score is a metric defined to measure the biometric utility or effectiveness of a face sample for the purpose of face recognition. It does not measure the visual quality of the sample. Biometric utility is specifically about the sample’s effectiveness in a biometric system, which may not always align with human perception of image quality. For instance, a visually clear image might have low biometric utility if the facial features are not captured in a way conducive to accurate matching. This batch processing method increases throughput when using GPU inference.

Parameters:
  • tfFacechips[in] A vector of TFFacechip

  • areTemplateQualitiesGood[out] indicates if the face chips are suitable for face recognition.

  • scores[out] The quality scores. Can be used for custom thresholding (default > 1.f is good quality).

Returns:

Error code, see ErrorCode.

ErrorCode Trueface::SDK::estimateFaceImageQuality(const TFFacechip &tfFacechip, float &quality)

Estimate the quality of the face image for recognition, with a score of 1 indicating perfect quality. This method currently calls detectFaceImageBlur() behind the scene and converts the score to either 1 or 0. In the future, more metrics will be added internally in this function

Parameters:
  • tfFacechip[in] The TFFacechip returned by extractAlignedFace().

  • quality[out] A value between 0 to 1. We suggest using a threshold of 0.5 as a filter for enrollment images.

Returns:

Error code, see ErrorCode.

ErrorCode Trueface::SDK::checkFaceImageExposure(const TFImage &tfImage, const FaceBoxAndLandmarks &faceBoxAndLandmarks, FaceImageQuality &result, float &percentImageBright, float &percentImageDark, float &percentFaceBright)

Determine if the image is over or under exposed, indicating suboptimal lighting conditions for face recognition. Refer to our FAQ page to understand the impact of image exposure on similarity score.

Parameters:
  • tfImage[in] The input image returned by preprocessImage().

  • faceBoxAndLandmarks[in] The FaceBoxAndLandmarks of the face to analyze.

  • result[out] The FaceImageQuality output.

  • percentImageBright[out] The percentage of pixels in the image which are above the brightness threshold.

  • percentImageDark[out] The percentage of pixels in the image which are below the darkness threshold.

  • percentFaceBright[out] The percentage of pixels in the face region which are above the brightness threshold.

Returns:

Error code, see ErrorCode.

ErrorCode Trueface::SDK::detectFaceImageBlur(const TFFacechip &tfFacechip, FaceImageQuality &result, float &score)

Determine if the face image is blurry or is of good quality for face recognition. Refer to our FAQ page to understand the impact of face blur on similarity score.

Parameters:
  • tfFacechip[in] The TFFacechip returned by extractAlignedFace().

  • result[out] The FaceImageQuality output.

  • score[out] The probability that the face is blurry.

Returns:

Error code, see ErrorCode.

ErrorCode Trueface::SDK::detectFaceImageBlurs(const std::vector<TFFacechip> &tfFacechips, std::vector<FaceImageQuality> &results, std::vector<float> &scores)

Determine if the provided face images are blurry or are of good quality for face recognition. This batch processing method increases throughput when using GPU inference. Refer to our FAQ page to understand the impact of face blur on similarity score.

Parameters:
  • tfFacechips[in] List of input TFFacechip.

  • results[out] The FaceImageQuality outputs.

  • scores[out] List of probabilities indicating if the faces are blurry.

Returns:

Error code, see ErrorCode.

enum class Trueface::FaceImageQuality

Describes the quality of a face image to be used for face recognition.

Values:

enumerator GOOD

The quality of the image is good for face recognition.

enumerator UNDER_EXPOSED

The image is under exposed.

enumerator OVER_EXPOSED

The image is over exposed.

enumerator BLURRY

The image is blurry.