hocrText method

Future<String> hocrText(
  1. PixImage image
)

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

ref: https://en.wikipedia.org/wiki/HOCR

Implementation

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

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