initAsync method

Future<void> initAsync(
  1. InputArray image,
  2. Rect boundingBox
)

Implementation

Future<void> initAsync(InputArray image, Rect boundingBox) async {
  cvAssert(boundingBox.x >= 0, "boundingBox.x must be >= 0");
  cvAssert(boundingBox.y >= 0, "boundingBox.y must be >= 0");
  cvAssert(
    boundingBox.right <= image.cols,
    "boundingBox.right=${boundingBox.right} must be <= image.cols=${image.cols}",
  );
  cvAssert(
    boundingBox.bottom <= image.rows,
    "boundingBox.bottom=${boundingBox.bottom} must be <= image.rows=${image.rows}",
  );

  return cvRunAsync0(
    (callback) => cvideo.cv_TrackerMIL_init(ref, image.ref, boundingBox.ref, callback),
    (c) {
      c.complete();
    },
  );
}