based on my quick search I couldn't find any mature Java OCR libraries, and as I wanna try something so I will not go with any commercial solution>
Also after quick search I found recommendations about Open Source OCR library called Tesseract
below I will list the steps I did to have a running java OCR example:
- Download and install Tesseract from the following url https://code.google.com/p/tesseract-ocr/downloads/list
I have downloaded and installedtesseract-ocr-setup-3.02.02.exe
- As I have 64-bit operating system then we will have to adjust/download Tesseract 64-bit DLLs from the following path
- Copy the downloaded files (liblept168.dll, libtesseract302.dll, tesseract.exe, ...) to your Tesseract installation folder.
Mine: C:\Program Files (x86)\Tesseract-OCR
- If you tried to run the tesseract.exe it will raise the following error
The Program can't start because MSVCR110.dll is missing from your computer. Try reinstalling the program to fix this problem.
This means that you don't have "Microsoft Visual C++ Redistributable 2012" installed.
- To fix the above problem download vcredist_x64.exe from the following URL
- Install vcredist_x64.exe and re run the tesseract.exe to make sure that no problems have been raised.
- Now we need to download the Tess4J java library to be able to write and run Java OCR applications
Download it from the following url http://sourceforge.net/projects/tess4j/
- You will find example on the same site with guide lines to setup and configure your project
Now we are done and you can write and run your java OCR projects.