← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #689041]: OCR class features sikuli IDE

 

Question #689041 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/689041

RaiMan proposed the following answer:
SikuliX 2.0.x comes with eng.traineddata, that can only be used with oem(3) (standard).
If you try to use oem(0) in this state, your JVM will crash.

So you first have to provide eng.traineddata that are suitable for oem(0):
download from https://github.com/tesseract-ocr/tessdata
and put into the SikuliX app-data folder .../tessdata

If you decide later to switch again to the SikuliX provided
eng.traineddata (smaller, faster), then simply put the eng.traineddata
away (will be exported automatically the next time).

#define the region containing the word of digits
reg = Region(107,168,49,14)

# tell OCR to use oem 0
OCR.globalOptions().oem(OCR.OEM.TESSERACT_ONLY)

# tell OCR to globally use the digits config (comes with SikuliX)
OCR.globalOptions().configs("digits")

# show the OCR options status
OCR.status()

# read from the region as word (psm 8)
print OCR.readWord(reg)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.