how to use OCR.readLines?
hello,
first of all, my config is:
2.0.4-2020-
I have to do OCR on a table, it work rather well if I do it line by line.
I thought it could be faster to do it at once with OCR.readLines and psm = 6 so I tried to read the entire table in an image and then pass it to OCR.readLines.
This is my test code that uses manual screen region selection:
img=selectRegion()
imgFile=capture (img)
OCR.options.psm(6)
lstText=
print "lstLEN=" + str(len(lstText))
print "lst=" + str(lstText)
for i in range(len(
print "mat="+str( lstText[i])
print "Txt="+
exit(0)
From the output I see that there are 16 matches, that is correct, but then the
print "Txt="+
line gives an error:
error] script [ GM_DTC ] stopped with error in line 127
[error] java.lang.
[error] --- Traceback --- error source first
line: module ( function ) statement
344: Utility ( getLineText ) strOcr = OCR.readLine(rReg, self.options)
127: main ( <module> ) print "Txt="+
[error] --- Traceback --- end --------------
I suppose this is a stupid problem from my side, but once obtained the list of matches (as per the docs), how can I extract the strings in it?
Thanks for support
After having set the options (also smallfont)I print them and these are:
OCR.Options:
data = C:\Users\
language(eng) oem(3) psm(6) height(10,0) factor(3,00) dpi(96)
variables: user_defined_
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- matteoa
- Solved:
- Last query:
- Last reply: