textLines method for region options only global?

Asked by matteoa on 2020-09-02

hello,
I'm using this method:
region..textLines()
to get all the lines in a region of the screen, the PSM is set to 6.
Trying to get better the OCR reconnaissance for one of the fields that contains acronyms I found some variables that make the OCR far better:
tessedit_char_whitelist:PCBU0123456789ABCDEF
load_system_dawg:F,
load_freq_dawg:F

Everything is ok, I have here a couple of doubts:
I have to change frequently this setting, since this setting is ok only for one of the fields I have to "read" while others have to be read with the standard behavior; I read all the page, then refresh and read again and so on.
Is there a way to reset only these variables without calling OCR.globalOptions().reset()?

The method like OCR.readLine can be used with a custom set of options, but the method I'm using seems to be a method of the region class, is this correct?
If so, how can I build a custom set of ocr options to be applied only when needed without the need to setup the globaloptions for a filed and then reset them for the other fields?

Another possibly silly question: the setting of the latter two variables is correct to disable the use of the standard dictionaries or is needed a "0" instead of the "N"?

Thanks for support and excuse me if this is a silly question...

This is my configuration:
2.0.4-2020-03-14_08:01/Windows10.0/Java8(64)1.8.0_251-b08

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2020-09-03
Last query:
2020-09-03
Last reply:
2020-09-03
Best RaiMan (raimund-hocke) said : #1

If you want to use your own options set instead of the implizit global options:

OCR.readlines(someRegion, myOptions)

matteoa (matteoa) said : #2

Thanks RaiMan, that solved my question.