scanbotsdk
    Preparing search index...

    Class OcrEngine

    API for optical character recognition. *

    • Required licence feature(s): Ocr.

    Since the class is backed by native resources and implements AsyncDisposable it's highly recommended to use the await using syntax when an instance is created to ensure the resource is disposed automatically:

    await using instance = await OcrEngine.create(...);
    

    Alternatively, one can explicitly call dispose method to release the native resource. If neither is used, the resource will be released when the instance is garbage collected which is not recommended.

    Implements

    • AsyncDisposable
    Index

    Methods

    • Returns Promise<void>

    • As the instance is backed by a native resource, it should be disposed when it is no longer needed. This method will release the native resource. As a recommended alternative since the class implements AsyncDisposable one can use 'await using' syntax to ensure the resource is disposed of automatically. If neither is used, the resource will be released when the instance is garbage collected which is not recommended.

      Returns Promise<void>

      A promise that resolves when the instance is disposed.

    • Recognize text in the given image.

      Parameters

      • image: ImageRef

        The image to recognize text in.

      Returns Promise<Page>

      Page recognized in the image.

    • Initialize the recognizer.

      Returns Promise<OcrEngine>

      Instance of OcrEngine.