← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #271593]: [1.1.0] How to get better results when working with OCR

 

Question #271593 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/271593

    Status: Answered => Open

carl is still having a problem:
OCR recognition is an important junction for my applications

----- version 1.1.0+ basic Image processing to get better OCR results
--you can do the following, to bring your captured image to a condition best for Tesseract OCR:
--img = capture(someRegion) # get the image from the screen (in memory)
--img1 = Image.create(img) # create an with the new Image class (still in memory)
--imgGrey = img1.convertImageToGrayscale(img1.get()) # does what it says (still in memory)
--imgGreyResized = imgGrey.resize(factor) # resize the image to about 300dpi (usually 3 as factor is sufficient) (still in memory)

I work in java.. I wrote this for now:  
(I need to understand how to finish)

Screen screen = new Screen();
Region region = screen.selectRegion();
BufferedImage img;
img=screen.capture(region).getImage();	
Image img2=new Image(img);	
BufferedImage imgBN= Image.convertImageToGrayscale(img);

System.out.println(imgBN.text()); // not work, how get text() from
BufferedImage?

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.