Text recognition is not working with sikuli for some words

痴心易碎 提交于 2020-01-06 23:51:32

问题


I am new to use Sikuli for testing with IntelliJ. I am using Sikuli jars from version 1.1.0. I have extracted the libs folder. I have put the tessdata contents(github) inside libs/tessdata folder.I have put the settings for OCR text search, read and also put in environment variable(libs/tessdata).

However the screen.click("text") is working good. But I found out that it is not working at some cases.

  1. When the text size is less than the 9 as per word.
  2. The font color and style is different, the findFailed exception occurs.
  3. S is taken as 5 sometimes.
  4. some words are recognized as different.

Can anyone help me what's wrong with this kind of usage?


回答1:


It is a known problem. Just as you found it yourself, small and sometimes "thin" fonts won't be recognized properly. There is not much you can do on the Sikuli side but what you can try is:

  1. Play with tesseract settings
  2. Try to apply some image processing techniques to the text areas before you perform the recognition. For example to increase the fond size
  3. There are few more tricks for when you are just wanting to recognize text in a known area (rather than when you want to find text on the screen), which is to use Sikuli to double click the text and copy its contents to buffer.



回答2:


screen.click("text") — this wont work, it will search for text.png.

You can try:

String text ="SEARCH";
screen.findText(text).click();


来源:https://stackoverflow.com/questions/36744457/text-recognition-is-not-working-with-sikuli-for-some-words

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!