extractRoiWithColor method

Image extractRoiWithColor(
  1. Rectangle bounds,
  2. int colorRed,
  3. int colorGreen,
  4. int colorBlue
)

Extracts a region of interest in the image according to the given bounds.

param bounds Bounds of the crop to extract. param colorRed Background color red (from 0 to 255) param colorGreen Background color green (from 0 to 255) param colorBlue Background color blue (from 0 to 255) return The extracted region of interest. throws FaceException An error has occurred during Face Library execution.

Implementation

Image extractRoiWithColor(Rectangle bounds, int colorRed, int colorGreen, int colorBlue) {
  Image imageRoi = Image();
  var err = faceSDK.id3FaceImage_ExtractRoiWithColor(_pHandle.value, bounds.handle, colorRed, colorGreen, colorBlue, imageRoi.handle);
  if (err != FaceError.success.value) {
    imageRoi.dispose();
    throw FaceException(err);
  }
  return imageRoi;
}