knnMatchAsync method

Future<VecVecDMatch> knnMatchAsync(
  1. Mat query,
  2. Mat train,
  3. int k
)

KnnMatch Finds the k best matches for each descriptor from a query set.

For further details, please see: https://docs.opencv.org/master/db/d39/classcv_1_1DescriptorMatcher.html#aa880f9353cdf185ccf3013e08210483a

Implementation

Future<VecVecDMatch> knnMatchAsync(Mat query, Mat train, int k) async {
  final rval = cvRunAsync<VecVecDMatch>(
    (callback) => cffi.FlannBasedMatcher_KnnMatch_Async(
      ref,
      query.ref,
      train.ref,
      k,
      callback,
    ),
    (c, ret) => c.complete(VecVecDMatch.fromPointer(ret.cast<cvg.VecVecDMatch>())),
  );
  return rval;
}