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