niBlackThreshold static method

Mat niBlackThreshold(
  1. InputArray src,
  2. double maxValue,
  3. int type,
  4. int blockSize,
  5. double k, {
  6. OutputArray? dst,
  7. int binarizationMethod = BINARIZATION_NIBLACK,
  8. double r = 128,
})

Performs thresholding on input images using Niblack's technique or some of the popular variations it inspired.

https://docs.opencv.org/4.x/df/d2d/group__ximgproc.html#gab042a5032bbb85275f1fd3e04e7c7660

Implementation

static Mat niBlackThreshold(
  InputArray src,
  double maxValue,
  int type,
  int blockSize,
  double k, {
  OutputArray? dst,
  int binarizationMethod = BINARIZATION_NIBLACK,
  double r = 128,
}) {
  final p = dst?.ptr ?? calloc<ccontrib.Mat>();
  cvRun(
    () => ccontrib.ximgproc_niBlackThreshold(
      src.ref,
      p,
      maxValue,
      type,
      blockSize,
      k,
      binarizationMethod,
      r,
    ),
  );
  return dst ?? Mat.fromPointer(p);
}