Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Java to capture an area of the screen and identify text found there

Tags:

java

ocr

This question may be beyond the scope of a simple answer here at stack overflow, but my hope is that it will lead me to be able to formulate several more specific questions to get where I need to be.

I want to write a program that searches a buffered image for text and returns it as a string. I don't want to write an entire OCR program, but would rather use an API that is freely available such as tesseract. Unfortunately I've been unable to find a Java API for tesseract.

I know that the font is arial and I know it's size. I am wondering if that will help.

I've already managed to capture the screen, but I'm not sure how to accomplish the next step of identifying the text found in the image.

the question

How can I implement a simple OCR function into my java program?

like image 472
Dream Lane Avatar asked Dec 22 '10 21:12

Dream Lane


1 Answers

You can use tesjeract or tess4j wrapper of Tesseract API. Be sure to rescale you images to 300 DPI since screenshots' resolution (72 or 96 DPI) is in general not adequate for OCR purpose.

like image 72
nguyenq Avatar answered Nov 15 '22 13:11

nguyenq