Enable Automatic Image Skew Correction with Aspose.OCR for Java 3.3.0

Aspose.OCR for Java logo We are pleased to announce that Aspose.OCR for Java 3.3.0 is now available for public use. This release includes image skew correction using algorithm.

Image Skew Correction Using Algorithm

Aspose.OCR for Java provides facility to perform image skew correction using algorithm. Following is the code demonstration of how an OMR scanned sheet image can be deskew/straighten using SkewCorrectionAlgorithm class.

// Load image
        com.aspose.omr.OmrImage image = com.aspose.omr.OmrImage.load("sample.jpg");

        // Area of the image to be processed
        java.awt.Rectangle area = new java.awt.Rectangle(0, 0, image.getWidth(), image.getHeight());

        // Grayscale conversion
        com.aspose.omr.imageprocessing.GrayscaleAlgorithm gs = new com.aspose.omr.imageprocessing.GrayscaleAlgorithm();
        gs.process(image, area);

        // Binarization
        com.aspose.omr.imageprocessing.AverageThresholdAlgorithm threshold = new com.aspose.omr.imageprocessing.AverageThresholdAlgorithm();
        threshold.process(image, area);

        // Skew correction
        com.aspose.omr.imageprocessing.SkewCorrectionAlgorithm skewCorrection = new com.aspose.omr.imageprocessing.SkewCorrectionAlgorithm();
        skewCorrection.process(image, area);

        // save image
        java.io.File fileObj = new java.io.File("result.jpg");
        ImageIO.write(image. asBitmap(), "jpg", fileObj);

Please review the release notes of Aspose.OCR for Java 3.3.0 for a complete view of new features.

Aspose.OCR for Java Resources

The resources, you may need to accomplish your tasks:

As always, we appreciate your feedback so if you ever have anything to tell us about this release or anything else, please head to the Aspose.OCR forum for a chat.