New question #254181 on Sikuli:
https://answers.launchpad.net/sikuli/+question/254181

I am trying write a code on Sikuli IDE to invert a captured image with IJ 
library. Then I will try to grab the text of that inverted image with Sikuli. 
Without inverting OCR is not successful (black background, white text).

But I couldn't import IJ to Sikuli. Here is my code:

import shutil
from ij import IJ

OpHp = capture(756,315,143,38)
path = 'C:\\photo\captured.tif'
shutil.copy(OpHp,path)

imp = IJ.openImage(path)
IJ.run(imp, "Invert", "")
IJ.save(imp, 'C:\\photo\captured-inverted.tif')
When I run, it gives: [error] ImportError ( No module named ij ). Is there a 
way to import it? Or is there any other way to invert an image with Sikuli?

Then I want to grab the text from the inverted image but as far as I know 
Sikuli only allows to grab text from a region with:

myRegion.text()
command. Is there a way to grab the text of an image (not of a region) with 
Sikuli?

Thanks in advance.

-- 
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     : [email protected]
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to