findTransformECCAsync function

Future<(double, Mat)> findTransformECCAsync(
  1. InputArray templateImage,
  2. InputArray inputImage,
  3. InputOutputArray warpMatrix,
  4. int motionType,
  5. (int, int, double) criteria,
  6. InputArray inputMask,
  7. int gaussFiltSize,
)

FindTransformECC finds the geometric transform (warp) between two images in terms of the ECC criterion.

For futther details, please see: https://docs.opencv.org/4.x/dc/d6b/group__video__track.html#ga1aa357007eaec11e9ed03500ecbcbe47

Implementation

Future<(double ret, Mat warpMatrix)> findTransformECCAsync(
  InputArray templateImage,
  InputArray inputImage,
  InputOutputArray warpMatrix,
  int motionType,
  (int, int, double) criteria,
  InputArray inputMask,
  int gaussFiltSize,
) {
  final p = calloc<ffi.Double>();
  return cvRunAsync0(
    (callback) => cvideo.cv_findTransformECC(
      templateImage.ref,
      inputImage.ref,
      warpMatrix.ref,
      motionType,
      criteria.toTermCriteria().ref,
      inputMask.ref,
      gaussFiltSize,
      p,
      callback,
    ),
    (c) {
      final rval = (p.value, warpMatrix);
      calloc.free(p);
      return c.complete(rval);
    },
  );
}