Aspose.OCR for Java logo

We’re pleased to announce July’s release of Aspose.OCR for Java. Please review the release notes of Aspose.OCR for Java 2.6.0 for a complete list of enhancements. If you are planning to upgrade the API from any previous revision, we strongly recommend you to check the Public API Changes section to know what has been changed since your current version of the API.

Set the Resolution of OMR Image in Java

Aspose.OCR for Java requires OMR sheets to be scanned using an image scanner at a resolution that is acceptable to capture the OMR data accurately. Once fed to the Aspose.OCR for Java API, the API recognizes the filled-in elements by comparing the number of black pixels against the number of white pixels in each element. It is important for the API to first determine the resolution of the image before initiating the recognition process.

The resolution of the image is set by the scanner and the Aspose.OCR APIs read this information from the image’s metadata. It is also possible that images are preprocessed before feeding them to the Aspose.OCR APIs for data extraction and such manipulation may corrupt or remove the metadata that identifies the image’s resolution. In order to handle situation as discussed above, the Aspose.OCR for Java has exposed the OmrImage.Resolution property, allowing the developers to set the resolution information of the image before performing the marker recognition operation.

The following code snippet demonstrates the usage of OmrImage.Resolution property to manipulate the image’s resolution.

//Load the image to be analyzed
OmrImage image = OmrImage.load("D:/sample.png");

//Define new value of image resolution in double format
image.setResolution(300.0); //overwrites the old DPI value

//Do processing

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.