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

# FaceAnalyser.computeBackgroundUniformity Method

Module: FaceAnalyser

## Definition

Computes the background uniformity behind a detected face.

This function must be used for a portrait image with only one face in it. A high uniformity score means that the background is uniform.

Important

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

Python

    compute_background_uniformity(self, image: Image, detected_face: DetectedFace) -> BackgroundUniformity

Parameters

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

Returns

> BackgroundUniformity
> The estimated background uniformity. Both color and texture scores are in the range [0:100]. The minimum recommended thresholds are respectively 80 for color and 80 for texture.

Exceptions

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

Dart

    BackgroundUniformity computeBackgroundUniformity(Image image, DetectedFace detectedFace)

Parameters

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

Returns

> BackgroundUniformity
> The estimated background uniformity. Both color and texture scores are in the range [0:100]. The minimum recommended thresholds are respectively 80 for color and 80 for texture.

Exceptions

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

C#

    public BackgroundUniformity ComputeBackgroundUniformity(Image image, DetectedFace detectedFace)

Parameters

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

Returns

> BackgroundUniformity
> The estimated background uniformity. Both color and texture scores are in the range [0:100]. The minimum recommended thresholds are respectively 80 for color and 80 for texture.

Exceptions

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

Java

    public BackgroundUniformity computeBackgroundUniformity(Image image, DetectedFace detectedFace) throws FaceException

Parameters

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

Returns

> BackgroundUniformity
> The estimated background uniformity. Both color and texture scores are in the range [0:100]. The minimum recommended thresholds are respectively 80 for color and 80 for texture.

Exceptions

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

Swift

    public func computeBackgroundUniformity(image: Image, detectedFace: DetectedFace) throws -> BackgroundUniformity

Parameters

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

Returns

> BackgroundUniformity
> The estimated background uniformity. Both color and texture scores are in the range [0:100]. The minimum recommended thresholds are respectively 80 for color and 80 for texture.

Exceptions

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

C

    int id3FaceAnalyser_ComputeBackgroundUniformity (
        ID3_FACE_ANALYSER hFaceAnalyser,
        ID3_FACE_IMAGE hImage,
        ID3_DETECTED_FACE hDetectedFace,
        id3FaceBackgroundUniformity * sBackgroundUniformity)

Parameters

> `hFaceAnalyser` ID3_FACE_ANALYSER
> in Handle to the FaceAnalyser object.
> `hImage` ID3_FACE_IMAGE
> in Source image to process.
> `hDetectedFace` ID3_DETECTED_FACE
> in Detected face to process.
> `sBackgroundUniformity` id3FaceBackgroundUniformity *
> out The estimated background uniformity. Both color and texture scores are in the range [0:100]. The minimum recommended thresholds are respectively 80 for color and 80 for texture.

Returns

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