Options
All
  • Public
  • Public/Protected
  • All
Menu

tesseract-wasm

Index

Type Aliases

BoxItem: { flags: number; rect: IntRect }

Item of text found in a document image by layout analysis.

Type declaration

CreateOCREngineOptions: { progressChannel?: MessagePort; wasmBinary?: Uint8Array | ArrayBuffer }

Type declaration

  • Optional progressChannel?: MessagePort
  • Optional wasmBinary?: Uint8Array | ArrayBuffer

    WebAssembly binary to load. This can be used to customize how the binary URL is determined and fetched. supportsFastBuild can be used to determine which build to load.

IntRect: { bottom: number; left: number; right: number; top: number }

Type declaration

  • bottom: number
  • left: number
  • right: number
  • top: number
OCRClientInit: { wasmBinary?: Uint8Array | ArrayBuffer; workerURL?: string; createWorker?: any }

Type declaration

  • Optional wasmBinary?: Uint8Array | ArrayBuffer

    WebAssembly binary to load in worker. If not set, it is loaded from the default location relative to the current script.

  • Optional workerURL?: string

    Location of worker script/module. If not set, it is loaded from the default location relative to the current script.

  • createWorker?:function
    • createWorker(url: string): Worker
    • Callback that creates the worker. The default implementation creates a Web Worker.

      Parameters

      • url: string

      Returns Worker

Orientation: { confidence: number; rotation: number }

Result of orientation detection.

Type declaration

  • confidence: number

    Confidence value in [0, 1]

  • rotation: number
ProgressListener: ((progress: number) => void)

Type declaration

    • (progress: number): void
    • Handler that receives OCR operation progress updates.

      Parameters

      • progress: number

      Returns void

TextItem: { confidence: number; flags: number; rect: IntRect; text: string }

Item of text found in a document image by layout analysis and OCR.

Type declaration

  • confidence: number

    Confidence score for this word in [0, 1]

  • flags: number

    Combination of flags from layoutFlags

  • rect: IntRect
  • text: string
TextUnit: "line" | "word"

Variables

layoutFlags: { EndOfLine: number; StartOfLine: number } = ...

Flags indicating position of a text item.

Keep this in sync with LayoutFlags in lib.cpp.

Type declaration

  • EndOfLine: number
  • StartOfLine: number

Functions

  • supportsFastBuild(): boolean
  • Return true if the current JS runtime supports all the WebAssembly features needed for the "fast" WebAssembly build. If not, the "fallback" version must be used.

    Returns boolean

Generated using TypeDoc