Simple Test OMR app not returning any results

Hello,

I am working with the trial version of the Aspose.OMR utilities in Java, in order to determine if they will suit my needs to develop a simple application to identify filled in bubbles. I created a template (OMRTest1.zip below, which contains the .amr file) using the .NET Template Editor for the document I have (DD7 Draft 4.jpg), and then created a filled in version of the document (called testfile.jpg) to test with. My template only contains a couple of elements so far just for testing purposes. However no matter what I do, my simple application does not return any results for the elements.

Here is the Java code I am using to test with:

 public static void main(String[] args) throws IOException {
    OmrTemplate template = OmrTemplate.load("templates\\OMRTest1.amr");
    OmrEngine engine = new OmrEngine(template);
    OmrConfig config = engine.getConfiguration();
    // Set fill threshold
    config.setFillThreshold(0.25);
    OmrImage image = OmrImage.load("testfiles\\testfile.jpg");
    OmrProcessingResult result = engine.extractData(new OmrImage[]{image});
    Dictionary dict = result.getPageData()[0];
    Enumeration e = dict.keys();
    while (e.hasMoreElements()) {
        Object key = e.nextElement().toString();
        Object value = dict.get(key).toString();
        System.out.println("Key = " + key + "   Value = " + value);
    }     
}

I’ve tried a number of different values for the fill threshold, including not setting it at all. No matter what, the result is always the following:

Key = start_ampm_1   Value = 
Key = serviceID_1   Value = 
Key = start_hours10_1   Value = 

I never seem to get anything for the values, even though it appears clear to me that the bubbles are filled in. I’m sure I’m doing something simple wrong, but I don’t see anything missing based on the documentation provided.

Also, my original tests were with a .tif file rather than .jpg, however the Java libraries return an error when I attempt to use this file type. Do the Java libraries not currently support .tif files?

Attached files:

OMRTest1.zip (1.4 MB) (This contains the amr file, which was not allowed to be uploaded directly)
DD7 Draft 4.jpg (803.0 KB)
testfile.jpg (779.4 KB)

Thank you!
Jeff

@jeffsatterley,

We have evaluated the sample OMR template, draft OMR sheet and sample fill OMR sheet. It was found that there is some issue with the draft OMR sheet. The sample OMR template is created on the basics of this error prone OMR sheet.

We have created a new OMR template and filled some more bubbles in the result OMR sheet (testfile.jpg) to further investigate the issue. We are able to perform the OMR operation successfully with the help of code snippet shared by you. Sample OMR template and modified result sheet is attached for your reference.

Please try again with the updated samples and update us with your feedback.

Java_test_OMR.zip (2.2 MB)

@ikram.haq

Thanks for the response. When I try to download the Java_test_OMR.zip file from the link above I am getting an HTTP 500 error. Is there somewhere else I should get this file, or is there an issue with the link?

@jeffsatterley,

We have tried to download the zip file shared in the previous post. We are able to successfully download and unzip it. However, extracted files are now attached with this post for your convenience. Please download the Java_test_OMR.amr.zip file and just remove the last extension i.e. .zip from the file name. In this way you will get the OMR template.

testfile.jpg (774.6 KB)
Java_test_OMR.amr.zip (2.1 MB)

Hi again @ikram.haq

Sorry, but I am still getting a 500 error when I try to download any of the files you sent. I can download mine 3 without issue.

I tried in IE instead of Chrome, and I am getting a different message: Sorry, this file is private. Only visible to post creator and staff members. So it seems like I don’t have the proper permissions to access the file? I made sure I was logged in in the IE browser I was using, so I’m not sure if there is anything else I need to do to get access.

@jeffsatterley,

Please try to access the ZIP file from the dropbox link.

Thanks @ikram.haq, the dropbox link worked. And yes, using your files my code is working fine, and I have been able to add other items to the template to do more OMR and OCR.

How did you modify the image so that it would work? I ask because we will probably have to create templates for multiple forms and if the issue occurs again I would like to be able to fix the formatting going forward.

Also, I am still seeing that while the .NET libraries can perform the OMR on a .tiff image, whereas the equivalent Java library throws an error. Is that correct? If so, do you know if there any future plan to include .tiff files in the Java library?

Finally, on a similar subject, I took a cursory look at the documentation on the Cloud based OCR/OMR libraries, and it appears that these only support the OCR piece of the module, not the OMR functionality. Is that also correct? The cloud based solution may be a perfect fit for what I’m looking for, but I would need the OMR functionality.

Thanks so much for your help on everything so far!

@jeffsatterley,

We have used the filled answer sheet image provided by you to construct the OMR template. This was the only difference.

For Java exception, we have evaluated and found the exception. The issue has been logged into our system with ID OCRJAVA-772 for further investigation by our Product team. We’ll update you here once there is some information or a fix version available in this regard.

Yes, it is correct that Aspose.OCR for Cloud currently supports OCR functionality only.