I am using Tesseract's Java wrapper Tess4J in a Java project in order to get OCR of images which are in Turkish. This project has web methods which are called from a client. My question is: Where should I put Turkish language data file? Does Tesseract work if I put the tur.traineddata file somewhere in my project's folders? Or do I have to install the tesseract to the server machine and put tur.traineddata under tessdata folder?

有帮助吗?

解决方案 2

You can put the language data file anywhere. Be sure to specify its location in the Init method or set TESSDATA_PREFIX environment variable for it.

其他提示

There is a method in Tesseract class setDatapath(String path) you can call this method to tell Tesseract enging where to look for language file to perform ocr for example suppose your tessdata folder is in D:\My_Language_Files folder then you have to pass "D:\My_Language_Files" string in setDatapath() method for example

Tesseract instance = Tesseract.getInstance(); instance.setDatapath("D:\My_Language_Files"); instance.setLanguage("eng");

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top