Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What preprocessing operations are performed by Tesseract OCR?

Tags:

tesseract

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.

like image 582
huehuehuehue Avatar asked Nov 19 '14 13:11

huehuehuehue


1 Answers

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.

like image 66
cortex42 Avatar answered Sep 29 '22 01:09

cortex42