Overview
This node performs Optical Character Recognition (OCR) on images using the Tesseract OCR engine via the node-tesseract-ocr library. It converts images to text, supporting input images either as binary data from the input item or as a direct image URL. This node is useful for extracting text from scanned documents, photos, or any image containing text, enabling automation workflows that require text extraction from images.
Use Case Examples
- Extract text from an image URL to automate data entry from scanned forms.
- Process binary image data from previous workflow steps to convert handwritten notes into editable text.
- Use language and OCR engine settings to optimize text recognition for different languages and image types.
Properties
| Name | Meaning |
|---|---|
| Source | Determines the source of the image to be processed, either from a binary property of the input item or a direct image URL. |
| Binary Property | The name of the binary property in the input item where the image data is stored (used only if Source is 'Binary'). |
| Image URL | The direct URL to the image to be processed (used only if Source is 'URL'). |
| Language | The language code for Tesseract OCR to use during text recognition (e.g., 'eng' for English, 'spa' for Spanish). |
| OEM (Engine Mode) | The OCR Engine Mode setting for Tesseract (values 0 to 3), which affects the OCR engine used. Default is 3. |
| PSM (Page Segmentation) | The Page Segmentation Mode setting for Tesseract, which controls how the image is segmented for OCR (e.g., 3, 6, 7). |
Output
JSON
text- The recognized text extracted from the image by Tesseract OCR.language- The language code used for OCR processing.source- The source type of the image ('binary' or 'url').
Dependencies
- node-tesseract-ocr library for interfacing with the Tesseract OCR engine
Troubleshooting
- Error 'Input item X has no binary data in property "Y"' occurs if the specified binary property does not exist or is empty in the input item. Ensure the binary property name is correct and the input item contains binary data.
- Error 'Image URL is empty on item X' occurs if the image URL parameter is empty when the source is set to URL. Provide a valid image URL.
- Tesseract OCR errors may occur due to unsupported image formats, corrupted images, or incorrect OCR engine settings. Verify the image format and adjust the OEM and PSM parameters as needed.
- Ensure the Tesseract OCR engine is properly installed and accessible by the node-tesseract-ocr library to avoid runtime errors.