utf8Text method

Future<String> utf8Text(
  1. PixImage image
)

Executes character recognition on the given document image and returns the detected text.

Implementation

Future<String> utf8Text(PixImage image) async {
  if (_needsInit) {
    _init();
  }

  bindings.flusseract.SetPixImage(
    handle,
    image.handle,
  );
  final text = bindings.flusseract.UTF8Text(handle);
  try {
    return text.cast<Utf8>().toDartString();
  } finally {
    calloc.free(text);
  }
}