goodFeaturesToTrack function

VecPoint2f goodFeaturesToTrack(
  1. InputArray image,
  2. int maxCorners,
  3. double qualityLevel,
  4. double minDistance, {
  5. VecPoint2f? corners,
  6. InputArray? mask,
  7. int blockSize = 3,
  8. int? gradientSize,
  9. bool useHarrisDetector = false,
  10. double k = 0.04,
})

GoodFeaturesToTrack determines strong corners on an image. The function finds the most prominent corners in the image or in the specified image region.

For further details, please see: https:///docs.opencv.org/master/dd/d1a/group__imgproc__feature.html#ga1d6bb77486c8f92d79c8793ad995d541

Implementation

VecPoint2f goodFeaturesToTrack(
  InputArray image,
  int maxCorners,
  double qualityLevel,
  double minDistance, {
  VecPoint2f? corners,
  InputArray? mask,
  int blockSize = 3,
  int? gradientSize,
  bool useHarrisDetector = false,
  double k = 0.04,
}) {
  final c = corners?.ptr ?? calloc<cvg.VecPoint2f>();
  mask ??= Mat.empty();
  if (gradientSize == null) {
    cvRun(
      () => cffi.GoodFeaturesToTrack(
        image.ref,
        c,
        maxCorners,
        qualityLevel,
        minDistance,
        mask!.ref,
        blockSize,
        useHarrisDetector,
        k,
      ),
    );
  } else {
    cvRun(
      () => cffi.GoodFeaturesToTrackWithGradient(
        image.ref,
        c,
        maxCorners,
        qualityLevel,
        minDistance,
        mask!.ref,
        blockSize,
        gradientSize,
        useHarrisDetector,
        k,
      ),
    );
  }
  return corners ?? VecPoint2f.fromPointer(c);
}