Hi,
I created online template file (.omr) using existing OMR image from the portal using OMR sheet designer. .png and .omr files were generated successfully. However when I am trying to use this .omr file in the demo code but it throwing an exception.
However when i create the .omr file using the .txt file through code, it is working fine. But my requirement is to evaluate the existing OMR sheets.
Can you please help me out?
@hitech9147
It seems that you are encountering an issue when trying to use an OMR file created from an existing image with the demo code. Here are some steps you can take to troubleshoot and potentially resolve the issue:
-
Ensure Correct File Paths: Make sure that the file paths for both the .omr file and any associated images are correctly specified in your code. If the paths are incorrect, it may lead to exceptions during execution.
-
Check for Reference Point Markers: When using OMR sheets, it’s essential that all required reference point markers are present on the image. These markers help the recognition engine to correctly identify the form structure. If any markers are missing, it could cause recognition failures.
-
Initialization of the Recognition Engine: Verify that you are initializing the recognition engine correctly. You should load the recognition pattern using the GetTemplateProcessor
method. For example:
Aspose.OMR.Api.OmrEngine omrEngine = new Aspose.OMR.Api.OmrEngine();
Aspose.OMR.Api.TemplateProcessor templateProcessor = omrEngine.GetTemplateProcessor("your-pattern.omr");
-
Using MemoryStream: If you are working in a web application or API context, consider loading the recognition pattern as a MemoryStream
. This can help avoid issues with file paths:
byte[] pattern = Encoding.UTF8.GetBytes(yourPatternData);
using (MemoryStream ms = new MemoryStream(pattern))
{
var templateProcessor = omrEngine.GetTemplateProcessor(ms, Encoding.UTF8);
}
-
Error Handling: Implement proper error handling to catch any exceptions that may arise during the recognition process. This can provide more insight into what might be going wrong.
-
Documentation Reference: For detailed guidance, you can refer to the official documentation on recognizing OMR forms and handling errors, which provides comprehensive instructions and examples.
If these suggestions do not resolve your issue, consider providing more details about the specific exception you are encountering, as that may help in diagnosing the problem further.
Sources:
[1]: Adding images - Aspose Documentation
[2]: Optical mark recognition (OMR) - Aspose Documentation
Hi, Thanks for your quick reply. Paths are correct. Exception is being thrown at following code.
Aspose.OMR.Api.TemplateProcessor templateProcessor = omrEngine.GetTemplateProcessor(“your-pattern.omr”);
Exception is “System.Runtime.Serialization.SerializationException: ‘Unable to read the template file. Errors occurred during deserialization.’”
.omr and .png file generated online from ASPOSE portal is attached.
A4.7z (436.2 KB)
A4.jpg (120.4 KB)
Hi,
I was able to resolve above issue, Template generated from ASPOSE portal had element type as “ReferencePoint” but the application was expecting type as “ReferencePointElement”.
However, now the problem is as i mentioned in my first post, i already have a scanned OMR (not generated from ASPOSE) that I want to evaluate. It has different reference points (OMR sheet is attached). ASPOSE app is expecting big rectangles as the reference point. Due to this mismatch, OMR is not getting recognized.
So my question is, how can i generate a template matching the reference points as in my scanned OMR sheet so that I can process the bubbles?
OMR4.jpg (335.5 KB)
I would really appreciate if someone please guide me on this? We need to make the decision on buying the full time license.
Dear ASPOSE team, please help. Waiting for your response…
@hitech9147
We are checking it and will get back to you soon. Please spare us little time.
Hello, @hitech9147
I am sorry for the delay.
Am I correct in assuming that the described product is Aspose OMR for Java (four rectangles in the corners)?
Unfortunately, OMR Sheet Designer web app at the current moment supports only Aspose OMR for .NET (five rectangles in the corners).
I have prepared .omr file for OMR Java based on the provided template and example of recognition (see attachment below).
OMRJAVA-111.zip (4.6 MB)
Thank you for your patience!
Hi, I am using dot net version to evaluate the OMR sheet and not the JAVA one. I understood that online portal generates the five rectangle templates.
Also, u have modified the OMR by placing four rectangles in the corner which might not be possible for me as I am hundreds of scanned OMRs. Is there a way I can evaluate the OMR without placing the rectangles in corners? Can I not use the black markings already present in the scanned OMR? Or is there a tool which can place four rectangles in all the OMRs in a single click?
Also, the OMR evaluator creates a one csv for each OMR? Is there a way we can process all the OMRs in a single CSV?
@hitech9147
My example above will work only in Aspose OMR for Java and will throw exception in Aspose OMR for .NET. Sorry for misunderstanding.
.NET version is fully capable of recognizing templates from OMR Sheet Designer.
At the current moment, Aspose OMR can only recognize templates generated with reference points. Stages of the OMR process|Documentation
They have to be present on paper before it was filled and scanned, otherwise they are useless.
If tests already marked without Aspose OMR reference points - they can not be recognized by Aspose OMR.
In case you decided to re-fill tests - we do have an API to process multiple template\images as single .csv file. Batch processing API:
Batch API
Batch Docs