Re: [Sikuli-driver] [Question #252621]: Automate using text not image
Question #252621 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/252621 JonyGreen posted a new comment: I find a free online ocr http://www.online-code.net/ocr.html to convert image to text. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #252621]: Automate using text not image
Question #252621 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/252621 Eugene S proposed the following answer: Hi, Sikuli has this feature to find text in Region: Region.text() Prior to using it, you have to switch the search on. There are 2 separate settings for dealing with text: Settings.OcrTextSearch = True Settings.OcrTextRead = True So if you want to look for a text in a certain Region, it might look like this: reg = Region(x, y, w, h) reg.find("text to be found") However be aware that this feature does not always working as expected as there are known issues of OCR (tesseract in this case) when working with rendered computer text. Take a look at this for more info where RaiMan mentions certain steps that steps that might be undertaken to improve the detection quality. https://bugs.launchpad.net/sikuli/+bug/710586 To get some idea what's actually being detected when you are working with certain region, try: print reg.text() Cheers, Eugene -- You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #252621]: Automate using text not image
Question #252621 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/252621 Status: Open => Answered Mark Weisler proposed the following answer: On Aug 4, 2014, at 11:36 AM, Anunaya wrote: > New question #252621 on Sikuli: > https://answers.launchpad.net/sikuli/+question/252621 > > Hi > > I am trying a automate a tool using sikuli which has some 100 test cases > which I used to execute manually. I tried automating using images but this > seems to be very hectic & there are times that sikuli does not get the > correct image because there might appear some pop and the script fails. > > I want to automate using text. I have learnt that OCR can be used to automate > using text. But can't really figure out how to use it or rather how to import > it in skuli. > > Can you please help? > > -- > You received this question notification because you are an answer > contact for Sikuli. > Here's a short illustration on how to get text from a region. You have to be careful to ensure the region is visible and in focus. # this script illustrates one way to use text myReg= Region(100,100,500,600) # to define and set a region to examine myReg.highlight(2) # highlight the region for 2 seconds to confirm we are looking at the right area myText = myReg.text() # get the text from my region and put the text into myText print myText You could branch your script execution based on the value of myText. -- Mark Weisler PGP Key ID 68E462B6 PGP Key fingerprint 87D5 A77B FC47 3CC3 DFF0 586D 23FF F8B4 68E4 62B6 You received this question notification because you are a member of Sikuli Drivers, which is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp