# computeBackgroundUniformity method

BackgroundUniformity computeBackgroundUniformity(

1. Image image,
2. DetectedFace detectedFace

)

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.

param image Source image to process. param detectedFace Detected face to process. return 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. throws FaceException An error has occurred during Face Library execution.

## Implementation

    BackgroundUniformity computeBackgroundUniformity(Image image, DetectedFace detectedFace) {
      Pointer<id3FaceBackgroundUniformity> pBackgroundUniformity = calloc();
      var err = faceSDK.id3FaceAnalyser_ComputeBackgroundUniformity(_pHandle.value, image.handle, detectedFace.handle, pBackgroundUniformity);
      if (err != FaceError.success.value) {
      	calloc.free(pBackgroundUniformity);
      	throw FaceException(err);
      }
      return BackgroundUniformity(pBackgroundUniformity);
    }