Trying to extract Date from the region and getting garbage values

Asked by monicar

Here is my code in Java:
               Settings.OcrTextRead= true;
                Settings.OcrTextSearch= true;
                screen.wait(TextExtract,20);
                String extractText = screen.find(TextExtract).text();
                System.out.println(extractText);

Result:
11i09;’2018

Expected:
11/09/2018

Please help

Question information

Language:
English Edit question
Status:
Expired
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
masuo (masuo-ohara) said :
#1

The extract result changes depending on the region surrounding characters.
I recommend you to examine what region is suitable to extract characters.

I tested this code by SikuliX1.1.4.
[example as python:]
tr = TextOCR.start()
tr.setLanguage("eng")
while True:
    r = selectRegion()
    s = r.text()
    App.setClipboard(s)
    popup(s)
    ans = popAsk("continue?")
    if ans == False:
        break

Revision history for this message
monicar (monicar) said :
#2

Thanks, I'll check it out.

On Sat, Nov 10, 2018, 9:12 AM masuo <<email address hidden>
wrote:

> Your question #676036 on Sikuli changed:
> https://answers.launchpad.net/sikuli/+question/676036
>
> Status: Open => Answered
>
> masuo proposed the following answer:
> The extract result changes depending on the region surrounding characters.
> I recommend you to examine what region is suitable to extract characters.
>
> I tested this code by SikuliX1.1.4.
> [example as python:]
> tr = TextOCR.start()
> tr.setLanguage("eng")
> while True:
> r = selectRegion()
> s = r.text()
> App.setClipboard(s)
> popup(s)
> ans = popAsk("continue?")
> if ans == False:
> break
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/sikuli/+question/676036/+confirm?answer_id=0
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/sikuli/+question/676036
>
> You received this question notification because you asked the question.
>

Revision history for this message
Launchpad Janitor (janitor) said :
#3

This question was expired because it remained in the 'Open' state without activity for the last 15 days.