Example: Tesseract Optical Character Recognition (OCR) Demo With Source

I received some feedback from a visitor who checked out the recently posted source code for Sudoku solving using computer vision, and was trying to implement the OCR within an app they are developing – asking how to make it more accurate, and without having to pay for a commercial framework.

OpenCV is a great project, but there is another open source project specifically for OCR known as Tesseract.  The key benefit of Tesseract is that it is easy to train, and a large community has been built over the years with the specific purpose of character recognition.  Tesseract has even been used for handwriting recognition, and the recognition of Kanji and Arabic characters.  I’ve heard it has been used in some of the available business card reader apps.

Robert Carlsen has been posting information and tools on compiling and using Tesseract on iOS for some time, here’s a video of his open source Pocket OCR demo project in action:

This You can find the source code for Pocket OCR on Github here
http://robertcarlsen.net/dev/pocket-ocr

You will need to build the source yourself, and Robert has instructions on doing that on iOS for Tesseract v3 here.

You may not want to build Tesseract yourself if you are just testing it out.  There is a working demo of Tesseract on iOS complete with a pre-built copy of the Tesseract v2 library. As you can see from this screenshot Tesseract works well even on words that aren’t even in the project’s dictionary with this very simple demo project:


You can find the source for this demo from Nolan Brown on Github here:
https://github.com/nolanbrown/Tesseract-iPhone-Demo

If you would like to implement OCR within your apps this is a great starting point, be sure to check out the Tesseract Google Code page, and especially the Tesseract Wiki and Google Group (which has a wealth of information and downloadable examples on other platforms) for more information.

©2011 iPhone, iOS 4, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.

.

DeliciousTwitterTechnoratiFacebookLinkedInEmail


Leave a Reply

Your email address will not be published. Required fields are marked *