Using Java to capture a screen area and determine the text found there

This question may go beyond the simple answer here on the overflow stack , but I hope that this will lead me to be able to formulate a few more specific questions to get where I need to be.

I want to write a program that looks for a buffered image for text and returns it as a string. I do not want to write the entire OCR program, but would prefer to use an API that is freely available, such as tesseract. Unfortunately, I could not find the Java API for tesseract.

I know the font is arial, and I know its size. I am wondering if this will help.

I have already managed to capture the screen, but I'm not sure how to perform the next step to identify the text found in the image.

question

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

+3
source share
2 answers

Implementing OCR is complex, but using an SDK like http://asprise.com/product/ocr/index.php?lang=java is simple.

+2
source

You can use the tesjeract or tess4j shell of the Tesseract API. Remember to rescale images to 300 DPI, as the screen resolution (72 or 96 DPI) is generally not suitable for OCR purposes.

+3
source

Source: https://habr.com/ru/post/1781743/


All Articles