spatialGradientAsync function

Future<(Mat, Mat)> spatialGradientAsync(
  1. Mat src, {
  2. Mat? dx,
  3. Mat? dy,
  4. int ksize = 3,
  5. int borderType = BORDER_DEFAULT,
})

SpatialGradient calculates the first order image derivative in both x and y using a Sobel operator.

For further details, please see: https:///docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga405d03b20c782b65a4daf54d233239a2

Implementation

Future<(Mat dx, Mat dy)> spatialGradientAsync(
  Mat src, {
  Mat? dx,
  Mat? dy,
  int ksize = 3,
  int borderType = BORDER_DEFAULT,
}) {
  dx ??= Mat.empty();
  dy ??= Mat.empty();
  return cvRunAsync0(
    (callback) => cimgproc.cv_spatialGradient(src.ref, dx!.ref, dy!.ref, ksize, borderType, callback),
    (c) {
      return c.complete((dx!, dy!));
    },
  );
}