How to make sure that text is present in the image

Asked by sneha

Hi,

I have one screen shot and in that image text is written as
" What I want my daughters to know about poverty (2:37)"

I have to validate this text and I have written below code

Region regResult = Region.create(199, 633,388, 59);
 regResult.highlight(2);
  String txtResult = regResult.text();
 if(txtResult.contains("What I want my daughters to know about poverty (2:37)"))
 {
  System.out.println("Pass: " + txtResult);
 }
  else
   System.out.println("Fail");

The script is running as expected but in console I am getting message as

[info] Sikuli vision engine loaded.
[info] VDictProxy loaded.
[log] highlight Region[199,633 388x59]@Screen(0)[0,0 1366x768] E:Y, T:3.0 E:Y, T:3.0 for 2.0 secs
[info] Text Recognizer inited.
Fail

Please Help.
There should be output as Pass:What I want my daughters to know about poverty (2:37

Please help

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

you should also printout with Fail:
System.out.println("Fail: " + txtResult);

to see, what Sikuli really has detected as result of the OCR.

Might not be, what you expect, because of the known fact, that the text feature has much room for improvement ;-)

See various bugs and questions.

Can you help with this problem?

Provide an answer of your own, or ask sneha for more information if necessary.

To post a message you must log in.