Create OMR Sheet with Barcode in C# | Read OMR Barcode C#

Optical mark recognition (OMR) is a technology that can be used to read and extract data from images of marked forms. OMR is commonly used in standardized tests, surveys, and ballots, but it can also be used in a variety of other applications, such as grading student work and tracking inventory. In this blog post, we will show you how to create and read an OMR sheet with a barcode in C#.

This article covers the following topics:

  1. Create and Read OMR with Barcode - C# API
  2. Create OMR Sheet with Barcode
  3. Read OMR Sheet with Barcode
  4. Free Learning Resources

Create and Read OMR with Barcode - C# API

We will use the Aspose.OMR for .NET API to create and read OMR sheet with barcode in C#. It allows developers to quickly and easily design, render, and recognize hand-filled answer sheets, surveys, applications, and similar forms in .NET applications.

Please download the DLL of the API or install it using NuGet.

PM> Install-Package Aspose.OMR

Create OMR Sheet with Barcode in C#

We can easily create OMR template (.omr) file and sheet image using simple text markup by following the steps below:

  1. Create an instance of the OmrEngine class.
  2. After that, get the GenerationResult object by calling the GenerateTemplate() method with the text file path as an argument.
  3. Finally, call the Save() method to save the generated image and .omr template file on the local disk.

The following code sample shows how to create an OMR sheet with barcode using C#.

Create OMR Sheet with Barcode in C#

Create OMR Sheet with Barcode in C#.

You can further check the following simple text markup which is used to create OMR template:

Please download the generated OMR template here.

Read OMR Sheet with Barcode in C#

We can perform OMR operations on a filled scanned image of an OMR sheet with barcode and extract data in a CSV file. For this purpose, we need the prepared OMR template (.omr) and the image (user-filled forms/sheets). Please follow the steps below to read OMR sheet with barcode and extract data in CSV.

  1. Create an instance of the OmrEngine class.
  2. Call the GetTemplateProcessor() method and initialize TemplateProcessor class object. It takes the OMR template file path as an argument.
  3. Get the RecognitionResult object by calling the Recognize() method with the image path as an argument.
  4. After that, get recognition results as CSV strings using the GetCsv() method.
  5. Finally, save the CSV result as a CSV file on the local disk.

The following code sample shows how to read and extract data from an OMR sheet with barcode in C#.

Read OMR Sheet with Barcode in C#

Read OMR Sheet with Barcode in C#.

Get a Free License

You can get a free temporary license to try the library without evaluation limitations.

Aspose.OMR for .NET – Learning Resources

Besides extracting OMR data from images, you can learn more about Aspose.OMR and explore other features of the library using the resources below:

Conclusion

In this article, we have learned how to create and read OMR sheet with a barcode in C#. We have also seen how to extract and save the OMR data in a CSV format. By following the steps outlined in this article, you can leverage Aspose.OMR and develop your own OMR applications. In case of any ambiguity, please feel free to contact us on our free support forum.

See Also