grabCutAsync function

Future<(Mat, Mat, Mat)> grabCutAsync(
  1. InputArray img,
  2. InputOutputArray mask,
  3. Rect rect,
  4. InputOutputArray bgdModel,
  5. InputOutputArray fgdModel,
  6. int iterCount, {
  7. int mode = GC_EVAL,
})

Grabcut runs the GrabCut algorithm. The function implements the GrabCut image segmentation algorithm. For further details, please see: https:///docs.opencv.org/master/d3/d47/group__imgproc__segmentation.html#ga909c1dda50efcbeaa3ce126be862b37f

Implementation

Future<(Mat mask, Mat bgdModel, Mat fgdModel)> grabCutAsync(
  InputArray img,
  InputOutputArray mask,
  Rect rect,
  InputOutputArray bgdModel,
  InputOutputArray fgdModel,
  int iterCount, {
  int mode = GC_EVAL,
}) async =>
    cvRunAsync0(
      (callback) => cffi.GrabCut_Async(
        img.ref,
        mask.ref,
        rect.ref,
        bgdModel.ref,
        fgdModel.ref,
        iterCount,
        mode,
        callback,
      ),
      (completer) => completer.complete((mask, bgdModel, fgdModel)),
    );