3
votes

I want to the detect the text region inside the image so that I can send that region to Tesseract for OCR. Currently I'm sending the whole image to Tesseract but I'm not getting accurate result. But if I send only that region which contains text then it gives me a good result. I'm doing Tesseract in Android

Can Anyone tell me how can I do it ?

Thanks in Advance !!!

1
Well..it is not easy..You might have to use some image processing libraries like opencv to achieve it. How about giving an option to user where in which user can crop the text area in the image himself? - Abhishek V
I've actually had some good luck detecting text in images using contrast differences, dilating the image, counting disconnected blobs in an area, and then segmenting. I made a blog about it here. - Thomas M. DuBuisson
Thanks @AbhishekV for your answer, But i want to crop it through program so that user's task get reduced. And the problem with opencv is that your device needs opencv manager already installed or you may have to install it before using opencv app as it provides libraries to the app. Can it be possible to integrate the opencv manager in our app so that the user don't require to install opencv manager externally ? - Ajinkya S
@AjinkyaS I haven't worked with the openCV for android yet. It's better if you ask a new question regarding opencv manager so that you may get solution from the experts in that field. - Abhishek V

1 Answers

0
votes

If the Android version mirrors the original, then you can use Tesseract API methods SetRectangle or TesseractRect to define or recognize a rectangle from an image.

http://code.google.com/p/tesseract-ocr/wiki/APIExample