batchDistance function

(Mat, Mat) batchDistance(
  1. InputArray src1,
  2. InputArray src2,
  3. int dtype, {
  4. OutputArray? dist,
  5. OutputArray? nidx,
  6. int normType = NORM_L2,
  7. int K = 0,
  8. InputArray? mask,
  9. int update = 0,
  10. bool crosscheck = false,
})

BatchDistance is a naive nearest neighbor finder.

For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga4ba778a1c57f83233b1d851c83f5a622

Implementation

(Mat dist, Mat nidx) batchDistance(
  InputArray src1,
  InputArray src2,
  int dtype, {
  OutputArray? dist,
  OutputArray? nidx,
  int normType = NORM_L2,
  int K = 0,
  InputArray? mask,
  int update = 0,
  bool crosscheck = false,
}) {
  dist ??= Mat.empty();
  nidx ??= Mat.empty();
  mask ??= Mat.empty();
  cvRun(
    () => ccore.Mat_BatchDistance(
      src1.ref,
      src2.ref,
      dist!.ref,
      dtype,
      nidx!.ref,
      normType,
      K,
      mask!.ref,
      update,
      crosscheck,
    ),
  );
  return (dist, nidx);
}