Initialize the OCREngine.
Use createOCREngine rather than calling this directly.
Emscripten entry point for the compiled WebAssembly module.
Channel used to report progress updates when OCREngine is run on a background thread
Clear the current image and text recognition results.
This will clear the loaded image data internally, but keep the text recognition model loaded.
At present there is no way to shrink WebAssembly memory, so this will not
return the memory used by the image to the OS/browser. To release memory,
the OCREngine
instance needs to be destroyed via destroy.
Shut down the OCR engine and free up resources.
Perform layout analysis on the current image, if not already done, and return bounding boxes for a given unit of text.
This operation is relatively cheap compared to text recognition, so can provide much faster results if only the location of lines/words etc. on the page is required, not the text content. This operation can also be performed before a text recognition model is loaded.
This method may return a different number/positions of words on a line compared to getTextBoxes due to the simpler analysis. After full OCR has been performed by getTextBoxes or getText, this method should return the same results.
Perform layout analysis and text recognition on the current image, if not already done, and return the page text in hOCR format.
A text recognition model must be loaded with loadModel before this is called.
Attempt to determine the orientation of the document image in degrees.
This currently uses a simplistic algorithm [1] which is designed for non-uppercase Latin text. It will likely perform badly for other scripts or if the text is all uppercase.
[1] See http://www.leptonica.org/papers/skew-measurement.pdf
Perform layout analysis and text recognition on the current image, if not already done, and return the page text as a string.
A text recognition model must be loaded with loadModel before this is called.
Perform layout analysis and text recognition on the current image, if not already done, and return bounding boxes and text content for a given unit of text.
A text recognition model must be loaded with loadModel before this is called.
Get the value, represented as a string, of a Tesseract configuration variable.
See setVariable for available variables.
Load a document image for processing by subsequent operations.
This is a cheap operation as expensive processing is deferred until bounding boxes or text content is requested.
Load a trained text recognition model.
Set the value of a Tesseract configuration variable.
For a list of configuration variables, see https://github.com/tesseract-ocr/tesseract/blob/677f5822f247ccb12b4e026265e88b959059fb59/src/ccmain/tesseractclass.cpp#L53
If you have Tesseract installed locally, executing tesseract --print-parameters
will also display a list of configuration variables.
Generated using TypeDoc
Low-level synchronous API for performing OCR.
Instances are constructed using createOCREngine.