Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
Toggle table of contents sidebar

# FacePad.computeColorBasedScore Method

Module: FacePad

## Definition

Computes the PAD score and confidence of a detected face using only the color image.

A high score means a high probability for the face to be bona-fide, hence not an attack. The minimum recommended score is 90.

A low confidence means that the quality of the image is not sufficient enough to take a decision. The minimum recommended confidence is 70.

Warning

A minimum IOD (64 pixels per default) for the detected face is required for this function, below this value it will output an error.

Important

Loading the `FaceColorBasedPad` model is required to use this function.

Python

    compute_color_based_score(self, image: Image, detected_face: DetectedFace) -> ColorBasedPadResult

Parameters

> `image` Image
> in Source image to process.
> `detected_face` DetectedFace
> in Detected face to process.

Returns

> ColorBasedPadResult
> The computed PAD result including score and confidence.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Dart

    ColorBasedPadResult computeColorBasedScore(Image image, DetectedFace detectedFace)

Parameters

> `image` Image
> in Source image to process.
> `detectedFace` DetectedFace
> in Detected face to process.

Returns

> ColorBasedPadResult
> The computed PAD result including score and confidence.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

C#

    public ColorBasedPadResult ComputeColorBasedScore(Image image, DetectedFace detectedFace)

Parameters

> `image` Image
> in Source image to process.
> `detectedFace` DetectedFace
> in Detected face to process.

Returns

> ColorBasedPadResult
> The computed PAD result including score and confidence.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Java

    public ColorBasedPadResult computeColorBasedScore(Image image, DetectedFace detectedFace) throws FaceException

Parameters

> `image` Image
> in Source image to process.
> `detectedFace` DetectedFace
> in Detected face to process.

Returns

> ColorBasedPadResult
> The computed PAD result including score and confidence.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Swift

    public func computeColorBasedScore(image: Image, detectedFace: DetectedFace) throws -> ColorBasedPadResult

Parameters

> `image` Image
> in Source image to process.
> `detectedFace` DetectedFace
> in Detected face to process.

Returns

> ColorBasedPadResult
> The computed PAD result including score and confidence.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

C

    int id3FacePad_ComputeColorBasedScore (
        ID3_FACE_PAD hFacePad,
        ID3_FACE_IMAGE hImage,
        ID3_DETECTED_FACE hDetectedFace,
        id3FaceColorBasedPadResult * sColorBasedPadResult)

Parameters

> `hFacePad` ID3_FACE_PAD
> in Handle to the FacePad object.
> `hImage` ID3_FACE_IMAGE
> in Source image to process.
> `hDetectedFace` ID3_DETECTED_FACE
> in Detected face to process.
> `sColorBasedPadResult` id3FaceColorBasedPadResult *
> out The computed PAD result including score and confidence.

Returns

> `int`
> An error code.
> See id3FaceError file for the list of possible error codes.