how to use sikulix's ocr in eclipse

Asked by wu

i want to use the sikuli ocr in eclipse by java , why not use tess4j because simple ocr have to use photo to execution but sikuli ocr can

choose region and no photo (maybe have and put in the temp),so i want to use sikuli ocr by java in eclipse。

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:

This question was reopened

  • by wu
Revision history for this message
RaiMan (raimund-hocke) said :
#1

Just use the latest 2.0.2, where Text/OCR is completely revised (simplified on one hand and open for any Tesseract-tweaking on the other).

Read an overview:
https://sikulix-2014.readthedocs.io/en/latest/textandocr.html

javadocs about the new OCR features:
https://raiman.github.io/SikuliX1/javadocs/org/sikuli/script/OCR.html

The class OCR allows to read text from various SikuliX sources and to identify lines and words as matches/regions.

Come back, if you need to find text in a Region (since I am currently busy to revise/complete the docs).

But with some luck you might find what you need already in the current Region javadoc:
https://raiman.github.io/SikuliX1/javadocs/org/sikuli/script/Region.html

Revision history for this message
wu (chouhua) said :
#2

Thanks RaiMan, that solved my question.

Revision history for this message
wu (chouhua) said :
#3

 i have a new question how to set the oce language by java ?

Revision history for this message
RaiMan (raimund-hocke) said :
#4
Revision history for this message
wu (chouhua) said :
#5

i use your solution but have not change the languae。
any do i mistake?

my code:

OCR.Options o = new OCR.Options();
o.dataPath("C:\\Program Files (x86)\\Tesseract-OCR\\tessdata");
o.language("chi_tra");

Revision history for this message
Best RaiMan (raimund-hocke) said :
#6
Revision history for this message
wu (chouhua) said :
#7

Thanks RaiMan, that solved my question.