I have always found OCR technology to be behind on open source systems. I've also watched the Ocropus project since its infancy. I've tried what I've heard is the best OCR engine available for Linux, Tesseract, and have found it woefully lacking for business documents. Are there any other more promising OCR implementations? What about the even more hopeful goal for interpreting handwriting? What is possible on *nix systems in this field?
Example (produce a PDF file
output.pdf with a text layer for a scanned german document):
$ echo page-*.png > input.list $ tesseract --oem 1 -l deu input.list output pdf
--oem 1 enables the LSTM engine)
Print the recognized text to stdout:
$ tesseract --oem 1 -l deu page page-0001.png stdout
List installed languages:
$ tesseract --list-langs
Support for quite many languages/scripts is available in the form a downloadable trained data sets, e.g. there is even a data set for Fraktur.
With the new LSTM model, Tesseract takes some inspiration from the OCRopus research project.
The Tesseract version 3 performs relatively bad even on good quality input images, i.e. often it falsely detects single characters in dust pixels (outside of any textual context) and easily introduces single character errors in well-known words.
Cuneiform OCR performance isn't that bad, but it isn't actively maintained (last release in 2011, version 1.1) and easily crashes and has some other issues:
- Segmentation faults with various packages and releases
- its layout algorithm is simply broken, i.e. in one-column documents paragraphs are often randomly shuffled around
- it does not error out on unknown options
You can disable the layout algorithm like this:
$ cuneiform --singlecolumn -l ger -f text -o foo.txt image-0001
-l specifies the language of the source document)
Ocrad example call:
$ ocrad -F utf8 image-0001
Text is printed by default to stdout.
In a business document, it missed an underlined word, where cuneiform/tesseract/gocr didn't.
The Ocrad manual contains a section on the used algorithms, e.g.:
5) Detect characters and group them in lines.
6) Recognize characters (very ad hoc; one algorithm per character).
7) Correct some ambiguities (transform l.OOO into 1.000, etc).
GOCR example call:
$ gocr image-0001
Text is printed by default to stdout.
The GOCR documentation doesn't include much details on which models/methods are used for OCR.
Included with Sane is the
scanimage command line program which you can use to build scripted scan pipelines (cf. e.g. my
There are few popular OCR command-line tools:
An OCR Engine that was developed at HP Labs between 1985 and 1995... and now at Google. Tesseract is probably the most accurate open source OCR engine available.
tesseract [inputFile] [outputFile] [-l optionalLanguageFile] [PathTohOCRConfigFile]
Open-source character recognition. It converts scanned images of text back to text files. GOCR can be used with different front-ends, which makes it very easy to port to different OSes and architectures. It can open many different image formats, and its quality have been improving in a daily basis.
OCR system focusing on the use of large scale machine learning for addressing problems in document analysis, featuring pluggable layout analysis, pluggable character recognition, statistical natural language modeling, and multi-lingual capabilities.
The OCRopus engine is based on two research projects: a high-performance handwriting recognizer developed in the mid-90's and deployed by the US Census bureau, and novel high-performance layout analysis methods.
OCRopus is development is sponsored by Google and is initially intended for high-throughput, high-volume document conversion efforts. We expect that it will also be an excellent OCR system for many other applications.
Tessnet2 (Open source, OCR, Tesseract, .NET, DOTNET, C#, VB.NET, C++/CLI)
Tesseract is a C++ open source OCR engine. Tessnet2 is .NET assembly that expose very simple methods to do OCR. Tessnet2 is under Apache 2 license (like tesseract), meaning you can use it like you want, included in commercial products.
For more complete list, check: List of optical character recognition software at Wikipedia.
... OCR is more than "only character recognition". Image handling, preprocessing - page/layout analysis to find the texts, images, tables or barcodes. For the recognition, you have to deal with different fonts, sizes and languages. This is important because to get good results you have to use dictionaries and language definitions. Finally people expect more export options than text (e.g., XML, RTF, or searchable PDF). There are some commercial options for SDKs, but they are not cheap and for free.
Recently I found a CLI OCR for Linux from ABBYY. There is a free 100 page trial.
If you have a budget, I strongly recommend ABBYY FineReader Engine CLI for Linux. Our company has been using it in our web-application for a year and we plan to renew the license. Very good recognition quality, command-line interface, recognition in many languages.