I'm working on an university project, I have to find and existing Java code that allows doing number recognition on a picture of a soccer t-shirt. The title is more general because the problem can be seen as number recognition, text recognition or finding a picture in a picture. I need a program that given an input image squares number in a minimum inclusion square (like OpenCV allows doing with faces) and (if possible) tells user if the number was found or not.

I tried using tesseract, aspose and many codes posted in this site, sourceforge and similar but no one was usefull. I think the easiest way is using OpenCV, maybe using a classifier or a neural network but I'm really new in this. Can someone help me linking me an implementation of my problem or in some other way? Thank you and sorry for my terrible English :)


You can use the Leadtools Recognition SDK in your application.

You can leverage the OcrEngine class, which will allow you to recognize text, whether letters or numbers, from a loaded image.

DISCLOSURE: I am an employee of the company offering this toolkit.

Here is some sample code:

String tifFileName = "C:\\LEADTOOLS21\\Resources\\Images\\ocr1.tif"; 

RasterCodecs codecs = new RasterCodecs(); 
RasterImage image = codecs.load(tifFileName);

OcrEngine ocrEngine = OcrEngineManager.createEngine(OcrEngineType.LEAD); 
ocrEngine.startup(new RasterCodecs(), new DocumentWriter(), null, null); 
OcrDocument ocrDocument = ocrEngine.getDocumentManager().createDocument(); 
OcrPage ocrPage = ocrDocument.getPages().addPage(image, null);


// Show the results 
String text = ocrPage.getText(0); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.