Generate template from existing image to recognize answer options - Aspose.OMR for .NET

@bvaidya

We have logged an issue as OMR-420 in our issue tracking system to further investigate the reasons behind. We will definitely look into details of the issue and keep you posted with the status of its correction. Please be patient and spare us little time.

We are sorry for the inconvenience.

Please note that we appreciate providing support via our forum. You can post your inquiries in case you have more. If you want to inquire something from sale department, please visit contact page over our website.

1 Like

@bvaidya

We have investigated the earlier logged ticket and as per our findings:

Currently Aspose.OMR for .NET uses reference points in order to properly work. Although black rectangles were added to the image, it is also required to add ReferencePoint elements to the template file (.omr). We have edited the provided template and attached it so it should work now. In the attached archive there are 3 files:

  • edited .omr file with added reference points
  • template image
  • image for the recognition. Our console demo should properly work with these files.

Currently adding reference points can be done manually, but in the new release next week we will introduce Aspose.OMR Client improvement that will automatically add reference points to your image and template file. OMR Client will be free and available on GitHub, and you can only use it once to prepare the template file (.omr). Adding reference points will be done in one click.

However, Aspose.OMR for .NET focuses more on standard A4 format papers, so for attached example, which is not standard size, it may still require manual edit of the .omr file.

DemoData.zip (158.4 KB)

1 Like

@asad.ali
Thank you for your reply, I have tested with the files you provided to us.

I have verified the result, it only processing only first five questions, not all 12 questions processed by the code. can you please help to solve this?
kindly find the images for your reference.
Not-recognized, all questions omr.JPG (155.6 KB)
Not-recognized, all questions omr.JPG (155.6 KB)
Not-recognized, all questions.JPG (129.8 KB)
only 5 questions processed from the image…JPG (154.1 KB)

Also, when I am running aspose.omr.client.exe, and validating template that you have provided, the application is going to closed and below error coming in event viewer.

Application: Aspose.OMR.Client.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Runtime.Serialization.SerializationException
at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(System.Runtime.Serialization.XmlReaderDelegator, System.String, System.String, System.Type, System.Runtime.Serialization.DataContract ByRef)
at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(System.Runtime.Serialization.XmlReaderDelegator, Int32, System.RuntimeTypeHandle, System.String, System.String)
at DynamicClass.ReadArrayOfOmrElementFromJson(System.Runtime.Serialization.XmlReaderDelegator, System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson, System.Xml.XmlDictionaryString, System.Xml.XmlDictionaryString, System.Runtime.Serialization.CollectionDataContract)
at System.Runtime.Serialization.Json.JsonCollectionDataContract.ReadJsonValueCore(System.Runtime.Serialization.XmlReaderDelegator, System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson)
at System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(System.Runtime.Serialization.XmlReaderDelegator, System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson)
at System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.ReadDataContractValue(System.Runtime.Serialization.DataContract, System.Runtime.Serialization.XmlReaderDelegator)
at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(System.Runtime.Serialization.XmlReaderDelegator, System.String, System.String, System.Type, System.Runtime.Serialization.DataContract ByRef)
at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(System.Runtime.Serialization.XmlReaderDelegator, Int32, System.RuntimeTypeHandle, System.String, System.String)
at DynamicClass.ReadOmrPageFromJson(System.Runtime.Serialization.XmlReaderDelegator, System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson, System.Xml.XmlDictionaryString, System.Xml.XmlDictionaryString[])
at System.Runtime.Serialization.Json.JsonClassDataContract.ReadJsonValueCore(System.Runtime.Serialization.XmlReaderDelegator, System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson)
at System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(System.Runtime.Serialization.XmlReaderDelegator, System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson)
at System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.ReadDataContractValue(System.Runtime.Serialization.DataContract, System.Runtime.Serialization.XmlReaderDelegator)
at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(System.Runtime.Serialization.XmlReaderDelegator, System.String, System.String, System.Type, System.Runtime.Serialization.DataContract ByRef)
at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(System.Runtime.Serialization.XmlReaderDelegator, Int32, System.RuntimeTypeHandle, System.String, System.String)
at DynamicClass.ReadArrayOfOmrPageFromJson(System.Runtime.Serialization.XmlReaderDelegator, System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson, System.Xml.XmlDictionaryString, System.Xml.XmlDictionaryString, System.Runtime.Serialization.CollectionDataContract)
at System.Runtime.Serialization.Json.JsonCollectionDataContract.ReadJsonValueCore(System.Runtime.Serialization.XmlReaderDelegator, System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson)
at System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(System.Runtime.Serialization.XmlReaderDelegator, System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson)
at System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.ReadDataContractValue(System.Runtime.Serialization.DataContract, System.Runtime.Serialization.XmlReaderDelegator)
at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(System.Runtime.Serialization.XmlReaderDelegator, System.String, System.String, System.Type, System.Runtime.Serialization.DataContract ByRef)
at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(System.Runtime.Serialization.XmlReaderDelegator, Int32, System.RuntimeTypeHandle, System.String, System.String)
at DynamicClass.ReadOmrTemplateFromJson(System.Runtime.Serialization.XmlReaderDelegator, System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson, System.Xml.XmlDictionaryString, System.Xml.XmlDictionaryString[])
at System.Runtime.Serialization.Json.JsonClassDataContract.ReadJsonValueCore(System.Runtime.Serialization.XmlReaderDelegator, System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson)
at System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(System.Runtime.Serialization.XmlReaderDelegator, System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson)
at System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.ReadDataContractValue(System.Runtime.Serialization.DataContract, System.Runtime.Serialization.XmlReaderDelegator)
at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(System.Runtime.Serialization.XmlReaderDelegator, System.String, System.String, System.Type, System.Runtime.Serialization.DataContract ByRef)
at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(System.Runtime.Serialization.XmlReaderDelegator, System.Type, System.Runtime.Serialization.DataContract, System.String, System.String)
at System.Runtime.Serialization.Json.DataContractJsonSerializer.InternalReadObject(System.Runtime.Serialization.XmlReaderDelegator, Boolean)
at System.Runtime.Serialization.XmlObjectSerializer.InternalReadObject(System.Runtime.Serialization.XmlReaderDelegator, Boolean, System.Runtime.Serialization.DataContractResolver)
at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(System.Runtime.Serialization.XmlReaderDelegator, Boolean, System.Runtime.Serialization.DataContractResolver)
at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject(System.Xml.XmlDictionaryReader)
at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject(System.IO.Stream)
at Aspose.OMR.Client.TemplateSerializer.JsonToTemplate(System.String)
at Aspose.OMR.Client.ViewModels.MainViewModel.LoadTemplateFromFile(System.String)
at Aspose.OMR.Client.ViewModels.MainViewModel.OnLoadTemplate()
at Aspose.OMR.Client.ViewModels.MainViewModel.b__150_1(System.Object)
at Aspose.OMR.Client.Utility.RelayCommand.Execute(System.Object)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(System.Windows.Input.ICommandSource, Boolean)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
at System.Windows.UIElement.ReRaiseEventAs(System.Windows.DependencyObject, System.Windows.RoutedEventArgs, System.Windows.RoutedEvent)
at System.Windows.UIElement.OnMouseUpThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
at System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs, Boolean)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
at System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr, System.Windows.Input.InputMode, Int32, System.Windows.Input.RawMouseActions, Int32, Int32, Int32)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr, MS.Internal.Interop.WindowMessage, IntPtr, IntPtr, Boolean ByRef)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at System.Windows.Application.Run(System.Windows.Window)
at Aspose.OMR.Client.App.Main()

@bvaidya

This limitation is due to trial version limitation. In order to test the API without any limitation, please use a valid license. You can apply for a 30-days free temporary license from our website and use it to evaluate the API.

Would you please share the link from where you found the .exe. We will further investigate it and share our feedback accordingly.

1 Like

@asad.ali thank you for your reply, but we want to use downloadable dll files to process OMR sheet, and we do not want to user API.
I requested license and they provided me temp license, but when I am trying to configured it with “Aspose.omr.demos” console application, it is not working. Please find attached image.trial license not applied to aspose.omr.demos console application…JPG (154.9 KB)

please help me to resolve this.

I also try to contact sales team via, chat and skype, but no response from them.
Can you please provide my contact number to them +91-8511859845 ( Brijesh Vaidya) to contact me for buying your product.

Thanks,
Brijesh Vaidya

@bvaidya

Could you please provide us your license file in a private message so that we can test it in our environment. You can send a private message by clicking over username and pressing blue Message button.

Furthermore, you may please post your sale related inquiries or question in Aspose.Purchase category where you will be assisted accordingly.

@bvaidya

Thanks for sharing requested files in private message.

We noticed that the license you are trying with is for Aspose.OCR for .NET. Which is why you are unable to set it and obtain desired results. We have again tested the scenario with valid license using TestTemplate3.omr Template and results were fine. Please check attached screenshot.

Recognizd.png (67.1 KB)

Could you please apply for correct temporary license i.e. Aspose.OMR for .NET and try again in your environment. In case you still face any issue, please feel free to let us know.

@asad.ali

Thank you for the update, we have capture images from the phone and then try to scan, but it is not recognized images and the answers are not getting from the solution.
Please help us to process mobile phone scan images to process omr and get the result.

I have attached images for your reference.

5b8fe9ff-8a99-4561-a7d1-d1cdf7c6e9c0.jpg (180.2 KB)
87117a7f-d0fa-425c-98bf-9362524eca1e.jpg (303.9 KB)

Is it possible to add four square reference point under the border ? can you please create template like that and send us, so we can try with that template and mobile scanned images to check, how it is recognized the answers ?

I have attached images for your reference.

And if the reference points could be changed to Black Circles instead of Black Squares?

TestTemplate2 - empty - with square under border.PNG (30.9 KB)

@bvaidya

We have logged your concerns under the ticket and will consider them during further investigation against it. We will let you know as soon as some updates are available. Please spare us little time.

@bvaidya

Thanks for your patience.

Your images were not recognized properly as they were missing the reference points. The images and scans should be the same as the template image, with black squares, in order to recognize them properly. The suggested workflow is following:

  • Create template (.omr) and template image with reference points
  • print them
  • fill them
  • then take a photo or a scan
  • recognize.

Sure, it is possible. See the files in the attachment. The archive contains template image, .omr file and filled photo example for you to test. Please note that template image and photo has the same layout.
TestTemplate.zip (2.0 MB)

Unfortunately, in the current version of Aspose.OMR for .NET only squares are supported. However, we plan to add more types of reference points and even remove them completely in future versions.

@asad.ali

We have finalize the template, but when I tried to create .omr template we got the following error, please see the attached image. error while creating template using omr client.JPG (77.7 KB)

Can you please create omr template and send us so that we can test the omr scanning using aspose omr dll(downloadable dll). I have attached the pdf to generate omr template.bubble design- Edit (003).pdf (93.2 KB)
finaltemplate.JPG (54.4 KB)

After scanning from our mobile APP we got following image, can you please generate template that matching the same image as attached below:
6e678c90-b5ab-445f-a904-454de3a46ee9.jpg (171.3 KB)templateFinal.png (80.6 KB)

@bvaidya

An investigation ticket as OMR-450 has been logged in our issue tracking system for your requirements. We will further look into details of the ticket and keep you posted with its resolution status. Please spare us little time.

We are sorry for the inconvenience.

@asad.ali

we need to process omr sheet with new template, it is very urgent, can you please create omr template, so that we can verify it and buy license. we have this last week to process omr sheet. I have attached final template to create. please find attached image and create .omr template asap.templateFinal.png (80.6 KB)

@bvaidya

We have already logged a ticket in our issue tracking system for your requirements and it is currently under investigation. We will surely let you know as soon as it is resolved. Please be patient and spare us little time.

We are sorry for the inconvenience.

@asad.ali
Thank you for your reply.

We required new template file(.omr) using this image templateFinal.png (80.6 KB)
that can process the image 6e678c90-b5ab-445f-a904-454de3a46ee9.jpg (171.3 KB)
Can you please create template file(.omr) and send us, so that we can test with new image and process the answers?

@bvaidya

As shared earlier, we are looking into your requirements and processing the ticket to create respective OMR template so that you can process your images with it. Due to other tasks and implementations, the ticket will take some time to get resolved. We highly appreciate your patience and comprehension in this matter. Please spare us little time.

@asad.ali
Any updates on .omr template generations, as per our new design? please share with us if you have created .omr template.

@asad.ali
Any updates on new .omr template, that we need to process ? can you please create and send us ?

As per our requirement, we have changed the template design, so can you please share your code / software that you created and send to us, and also please provide the steps to generate .omr template file, so that we will not dependent on you.

@bvaidya

Templates.zip (3.4 MB)

Please check the attached template. It contains 3 folders.

  1. FinalTemplate folder. Inside you will find requested template for provided image. However, unfortunately it is not possible to recognize your photo with this template with Aspose.OMR for .NET, because the reference points (black squares) are too small. The general rule is that they should be almost two times larger than bubbles. But it is possible to recognize your photo using Aspose.OMR for Cloud, since cloud version does not require reference points. We are working on removing this points from Aspose.OMR for .NET too, and this is one of ours most important tasks.

For your images, we’ve prepared alternative templates that can be found in next folders.

  1. FinalTemplateBig folder. Here you will find same image, but with bigger reference points. Also, we have prepared the template as well and sample photo that is recognizable with Aspose.OMR for .NET. It is possible to use this form and template to print out images and successfully recognize them. However, we reccommend using image in the next folder.

  2. BestTemplate folder. This folder contains the slightly modified image that you previously shared with us as bubble design- Edit (003).pdf. We added reference points to the corners and removed them from the center. We also prepared the template and demo photo for your tests. This is much better image to work with, since it is larger and has overall better quality.

@asad.ali

Thank you for your prompt response, we will test with template and provide you our feedbacks.