adaptiveThreshold static method

Future<Uint8List?> adaptiveThreshold({
  1. required Uint8List image,
  2. required double maxValue,
  3. required int adaptiveMethod,
  4. required int thresholdType,
  5. required int blockSize,
  6. required double constantValue,
})

Implementation

static Future<Uint8List?> adaptiveThreshold({
  required Uint8List image,
  required double maxValue,
  required int adaptiveMethod,
  required int thresholdType,
  required int blockSize,
  required double constantValue,
}) async {
  int adaptiveMethodTemp = (adaptiveMethod > 1)
      ? 1
      : (adaptiveMethod < 0)
          ? 0
          : adaptiveMethod;

  int thresholdTypeTemp = (thresholdType > 1)
      ? 1
      : (thresholdType < 0)
          ? 0
          : thresholdType;

  Uint8List? result = await platform.invokeMethod('adaptiveThreshold', {
    "data": image,
    'maxValue': maxValue,
    'adaptiveMethod': adaptiveMethodTemp,
    'thresholdType': thresholdTypeTemp,
    'blockSize': blockSize,
    'constantValue': constantValue
  });

  return result;
}