I am using tesseract for OCR, mainly on invoices. However, tesseract requires to specify the language before it starts processing a file.
I thought I am going to perform ocr based on a predefined default language. Then I'd like use the resulting text to check which language is used. If it is not the default language, I process it again in order to get a better result from tesseract.
But how can I implement a language detection algorithm? Is there a C++ library I could use?
This paper "Natural Language Identification for OCR Applications" describes techniques involved in identification tasks similar to your requirements.
I am not sure if this would help as the library is in Java. But I found it really cool as it is able to detect around 50 languages from the given text and with a pretty good precision level. You may like to have a look at it and as it is open source, you may rewrite the code in C++ and give it back to the open source community if your application requires to be written only in C++.
Here is the link for the same:
http://code.google.com/p/language-detection/
Note: It uses the Apache Nutch and Tika libraries for analysis.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With