From 7f406f438d910622174495fc1b24a4fffdb66bb7 Mon Sep 17 00:00:00 2001 From: Jerome Wu Date: Tue, 2 Jul 2019 16:42:16 +0800 Subject: [PATCH] Change default OCR engine mode to LSTM_ONLY --- docs/tesseract_parameters.md | 4 ++-- src/common/options.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tesseract_parameters.md b/docs/tesseract_parameters.md index 9d8105d..1dbe13a 100644 --- a/docs/tesseract_parameters.md +++ b/docs/tesseract_parameters.md @@ -13,7 +13,7 @@ const worker = new TesseractWorker(); worker .recognize(image, 'eng', { - tessedit_ocr_engine_mode: OEM.TESSERACT_LSTM_COMBINED, + tessedit_ocr_engine_mode: OEM.LSTM_ONLY, tessedit_pageseg_mode: PSM.SINGLE_BLOCK, }) .then(result => console.log(result.text)); @@ -21,7 +21,7 @@ worker | name | type | default value | description | | ---- | ---- | ------------- | ----------- | -| tessedit\_ocr\_engine\_mode | enum | OEM.TESSERACT\_LSTM\_COMBINED | Check [HERE](https://github.com/tesseract-ocr/tesseract/blob/4.0.0/src/ccstruct/publictypes.h#L268) for definition of each mode | +| tessedit\_ocr\_engine\_mode | enum | OEM.LSTM\_ONLY | Check [HERE](https://github.com/tesseract-ocr/tesseract/blob/4.0.0/src/ccstruct/publictypes.h#L268) for definition of each mode | | tessedit\_pageseg\_mode | enum | PSM.SINGLE\_BLOCK | Check [HERE](https://github.com/tesseract-ocr/tesseract/blob/4.0.0/src/ccstruct/publictypes.h#L163) for definition of each mode | | tessedit\_char\_whitelist | string | '' | setting white list characters makes the result only contains these characters, useful the content in image is limited | | tessedit\_create\_pdf | string | '0' | only 2 values, '0' or '1', when the value is '1', tesseract.js generates a pdf output | diff --git a/src/common/options.js b/src/common/options.js index 53f20c2..83fbf33 100644 --- a/src/common/options.js +++ b/src/common/options.js @@ -13,7 +13,7 @@ module.exports = { * default params for recognize() */ defaultParams: { - tessedit_ocr_engine_mode: OEM.TESSERACT_LSTM_COMBINED, + tessedit_ocr_engine_mode: OEM.LSTM_ONLY, tessedit_pageseg_mode: PSM.SINGLE_BLOCK, tessedit_char_whiltelist: '', tessedit_create_pdf: '0',