Aspose.OCR for Java is a stand-alone OCR API for Java applications while allowing the developers to perform optical character recognition on commonly used image types. It provides a simple set of classes to control character recognition for various languages including English, French, Spanish and Portuguese. Developers can easily read characters in multiple fonts, rotated images, whole images or parts of images with the ability to apply different noise removal filters before text recognition.
An overview of the capabilities of API.
Aspose.OCR for Java supports the JDK 1.6 and above.
API supports most popular raster image file formats.
Read characters or text from images
Support for common image formats
Support of different languages
Read the text in multiple fonts
Support for common font styles
Scan any part of an image or as a whole
Scan rotated images
Add noise removal filters
Define various white lists
Using the library, developers can extract text, text location from image specific parts, fonts, and styles as well as perform the character recognition operation on document scans having a similar structure. Recognizing text from images is simple, with just a few lines of code.
// create an instance OcrEngine engine = new OcrEngine(); // set image file engine.setImage(ImageStream.fromFile(dir + "template.jpg")); // process the image engine.process(); // Image to Text results System.out.println(engine.getText());
Aspose.OCR for Java API supports Times New Roman, Arial, Verdana, Courier New, Tahoma and Calibri fonts in regular, italic and bold text styles as well as different languages like English, Spanish, French, and Portuguese
Noise reduction is a typical pre-processing step to improve the results. Using the OCR library, you can apply Blur, Gaussian Blur & Median correction filters on the document image in order to improve the recognition accuracy.
// initialize OcrEngine engine = new OcrEngine(); // set image engine.setImage(ImageStream.fromFile(dir + "template.jpg")); // create filters collection CorrectionFilters filters = new CorrectionFilters(); // create and add different filters to the collection filters.add(new MedianFilter(6)); filters.add(new GaussBlurFilter()); // assign collection engine.getConfig().setCorrectionFilters(filters); // do processing