Optical Character Recognition
The Scanbot SDK RN Module provides a simple and convenient API to run Optical Character Recognition (OCR) on images. The OCR feature is a part of the Scanbot SDK Data Capture Modules. As a result, you get:
- a searchable PDF document with the recognized text layer (aka. sandwiched PDF document);
- recognized text as plain text;
- bounding boxes of all recognized paragraphs, lines and words;
- text results and confidence values for each bounding box.
The Scanbot OCR feature is based on the Scanbot OCR engine created and polished by the Scanbot SDK team to provide the best text recognition speed and quality for our users.
The Scanbot OCR feature based on the Tesseract OCR engine is still available and can be enabled with passing TESSERACT
to the engineMode
arguments property:
engineMode: EngineMode
- the OCR engine mode, eitherSCANBOT_OCR
orTESSERACT
;languages: Array<String>
- a set of languages to be used for OCR (needed only forTESSERACT
mode);
For each desired language, a corresponding OCR training data file (.traineddata
) must be provided.
Furthermore, the special data file osd.traineddata
is required (used for orientation and script detection).
The Scanbot SDK package contains no language data files to keep the SDK small in size. You have to download and include the desired language files in your app.
Preconditions to achieve a good OCR result
Conditions while scanning
A perfect document for OCR is flat, straight, in the highest possible resolution and does not contain large shadows, folds, or any other objects that could distract the recognizer. Our UI and algorithms do their best to help you meet these requirements. But as in photography, you can never fully get the image information back that was lost during the shot.
Languages
The SCANBOT_OCR
engine supports German and English languages that are integrated into the SDK and works without any additional modules out of the box.
For TESSERACT
you can use multiple languages for OCR. But since the recognition of characters and words is a very complicated process, increasing the number of languages lowers the overall precision.
With more languages, there are more results that the detected word could match. We suggest using as few languages as possible.
Make sure that the language you are trying to detect is supported by the SDK and added to the project.