Browse our Products

Aspose.OCR for Java 3.6.0 Release Notes

KeySummaryCategory
OCRNET-1152The angle of rotation is calculated inproperlyEnhancement
OCRNET-1250Improve neighbor-based skew corrector quality on small images and small anglesEnhancement
OCRNET-1277Support faster image rotation algorithmEnhancement
OCRNET-1108Incorrect textblock calculation for deskewed imageEnhancement

Usage examples:

*Method com.aspose.omr.OmrEngine.rotateImage(com.aspose.omr.OmrImage, double) added instead of method com.aspose.omr.OmrEngine.rotateImage(com.aspose.omr.OmrImage,int)

 OmrImage image = OmrImage.load("sample.jpg");

OmrEngine engine = new OmrEngine(new OmrTemplate());

double degree = engine.getSkewDegree(image);

image = engine.rotateImage(image, degree);

BufferedImage actualImage = image.asBitmap();

OCRNET-1108 Incorrect textblock calculation for deskewed image

 String pictureFileName = "VodafoneBillImage1.jpg";

OcrEngine ocrEngine = new OcrEngine();

ocrEngine.getConfig().clearRecognitionBlocks();

ocrEngine.setImage(ImageStream.fromFile(pictureFileName));

ocrEngine.getConfig().setDetectTextRegions(false);

ocrEngine.getConfig().addRecognitionBlock(RecognitionBlock.createTextBlock(122, 570, 373, 36));

ocrEngine.getConfig().setSavePreprocessedImages(true);

if (ocrEngine.process())

{

    PreprocessedImages preprocessedImages = ocrEngine.getPreprocessedImages();

    BufferedImage bufferedImage = preprocessedImages.getTextBlocksImage();

    try

    {

        ImageIO.write(bufferedImage, "png", new File("block.png"));

    }

    catch (IOException e)

    {

        e.printStackTrace();

    }

}