huehuehuehue
huehuehuehue

Reputation: 305

What preprocessing operations are performed by Tesseract OCR?

I couldn't find a detailed documentation and I don't feel browsing the source code. I want not to redo canny edge detection for example if it is already done by Tesseract engine.

Upvotes: 5

Views: 2443

Answers (1)

cortex42
cortex42

Reputation: 234

This document provides an overview of the engine: https://github.com/tesseract-ocr/docs/blob/master/tesseracticdar2007.pdf

So it looks like you don't need to implement canny edge detection.

Tesseract uses Otsu thresholding to binarize the image before processing it https://github.com/tesseract-ocr/tesseract/blob/master/ccstruct/otsuthr.h

Edit: If you want to see the binarized image just create a new config file in "\tessdata\configs\", add this line: tessedit_write_images True and process your image: tesseract your_image out your_config_file. Tesseract saves the binarized image as tessinput.tif.

Upvotes: 5

Related Questions