📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

Aspose.OMR

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Aspose.OMR

Aspose.OMR for .NET adds optical mark recognition (OMR) functionality to your C#, VB.NET, and ASP.NET applications. With it, you can design, render and recognize all types of hand-filled forms: answer sheets, examination papers, surveys, questionnaires, ballots, applications, and many more. No specialized equipment, consumables and third-party software required. Use your office copier or even a smartphone camera instead of an expensive OMR scanner. Respondents can fill out your forms with a pen, pencil or marker and use any type of marks - artificial intelligence and advanced accuracy calibration ensure reliable results. You can even recognize rotated and skewed images. Aspose.OMR for .NET can recognize any file you get from a scanner or camera: PDF, JPEG, PNG, TIFF, GIF, and BMP. Recognition results are returned in the most popular data storage formats (JSON, XML and CSV) that can be imported into any popular database, CRM or analysis system. Aspose.OMR for .NET supports QR codes and barcodes recognition. Aspose.OMR for .NET offers a flexible markup language for designing OMR forms of any layout and complexity; you can even add QR codes, barcodes and images without using third-party libraries. All popular paper sizes as well as a number of non-standard ones are supported. Forms are saved in multiple file formats, intelligently selected based on the provided extension: PDF, JPEG, PNG, TIFF, GIF, and BMP. Aspose.OMR for .NET is written in C#, has managed code, and supports both x86 and x64 systems. Changelog: - Improved the recognition accuracy of OMR forms images that have been resized or affected by perspective distortions. - Resolved "Failed to find matching between the template and the image!" exception. Check for details at https://releases.aspose.com/omr/net/release-notes/2024/aspose-omr-for-net-24-12-0-release-notes/ Resources: Online documentation: https://docs.aspose.com/omr/net/ Free support forum: https://forum.aspose.com/c/omr/

25.4.0
NuGet
Version published
Maintainers
2
Created
Source

Optical mark recognition (OMR) API for .NET

Version 25.4 Downloads

Overview | Documentation | API Reference | Online apps | Showcases | Blog | Free support | Temporary license

This package can be used to develop applications for on-premise operating systems and cloud platforms. You can build both 32-bit and 64-bit software, including ASP.NET, WCF, and WinForms.

Please note: our library implies the use of .NET programming languages, compatible with CLI infrastructure. If you require a corresponding native library for C++, you can download it from here.

API overview

Aspose.OMR for .NET can generate and recognize hand-filled answer sheets, surveys, applications, and similar machine-readable forms. With it, you can quickly develop on-premise and web-based .NET applications for optical mark recognition (OMR) that work without specialized hardware. Respondents can fill out your forms with a pen or pencil and use any type of marks - we guarantee reliable results.

  • Complete OMR workflow - from designing a form to recognizing filled hardcopies.
  • Use your existing office copier or a smartphone camera instead of an expensive OMR scanner.
  • Add and recognize QR codes and barcodes.
  • Recognition of multi-page forms.
  • Supports right-to-left (RTL) languages and Eastern Arabic numerals.
  • No external editors and design tools are required.
  • Supports all popular paper sizes as well as a number of non-standard ones.
  • Full compatibility with other Aspose products - build solutions of any complexity using familiar concepts with minimal code.

Markup languages

Aspose.OMR for .NET offers several ways to design OMR forms of any layout and complexity. They all work equally well and produce the same results - just choose the approach that you are most comfortable with.

Supported file formats

Aspose.OMR for .NET can generate machine-readable forms in all popular formats. The format is intellectually selected based on the provided extension:

  • PDF
  • JPEG
  • PNG
  • TIFF
  • GIF
  • BMP

Aspose.OMR for .NET can read just about any image that you get from a scanner or camera:

  • PDF
  • JPEG
  • PNG
  • TIFF
  • GIF
  • BMP

Recognition results are returned in the most popular document and data exchange formats:

  • JSON
  • XML
  • Comma-separated values (CSV)

Get started

You can get familiar with Aspose.OMR for .NET by creating 2 minimal console applications for creating and recognizing machine-readable forms.

Generating OMR form

  • Create a new C# project in Visual Studio. You can use a very basic project template, such as Console App.

  • Install this NuGet package to the project.

  • Create a simple questionnaire in a plain-text file that uses a special notation. Save the file to bin\Debug directory of the project under the name template.txt.

    ?text=Hello, World!
    	font_style=bold
    	font_size=24
    	align=center
    
    #How are you doing today?
    	() Pretty good, thanks! () I won't respond until I see my lawyer.
    
  • Create an instance of Aspose.OMR.Api.OmrEngine class:

    Aspose.OMR.Api.OmrEngine omrEngine = new Aspose.OMR.Api.OmrEngine();
    
  • Generate a form from the template source file:

    Aspose.OMR.Generation.GenerationResult generationResult = omrEngine.GenerateTemplate("template.txt");
    
  • Save the result:

    generationResult.Save("", "Hello.OMR");
    

Full code:

namespace HelloOMR
{
	internal class Program
	{
		static void Main(string[] args)
		{
			Aspose.OMR.Api.OmrEngine omrEngine = new Aspose.OMR.Api.OmrEngine();
			Aspose.OMR.Generation.GenerationResult generationResult = omrEngine.GenerateTemplate("template.txt");
			generationResult.Save("", "Hello.OMR");
		}
	}
}

Now run the program. You should get 2 files in bin\Debug directory of the project:

  • Hello.OMR.png
    A printable form in PNG format. Since we have not provided a license, there will be a watermark on the page.
  • Hello.OMR.omr
    A recognition pattern used by Aspose.OMR recognition engine. This file is required for recognizing filled forms, make sure you do not accidentally delete it!

Reading filled form

  • Create a new C# project in Visual Studio. You can use a very basic project template, such as Console App.
  • Install this NuGet package to the project.
  • Print the generated form (Hello.OMR.png).
  • Mark an answer bubble.
  • Take a photo of the filled form (the entire sheet with all crop marks) with your smartphone and upload the photo to bin\Debug directory of the project.
  • Copy the previously generated recognition pattern (Hello.OMR.omr) into bin\Debug directory of the project.
  • Create an instance of Aspose.OMR.Api.OmrEngine class:
    Aspose.OMR.Api.OmrEngine omrEngine = new Aspose.OMR.Api.OmrEngine();
    
  • Load the recognition pattern from Hello.OMR.omr file:
    Aspose.OMR.Api.TemplateProcessor templateProcessor = omrEngine.GetTemplateProcessor("Hello.OMR.omr");
    
  • Recognize the photo of the filled form:
    Aspose.OMR.Model.RecognitionResult recognitionResult = templateProcessor.RecognizeImage("IMG_20220401.jpg");
    
  • Convert the recognition result to comma-separated values (CSV) format and output it to the console:
    string result = recognitionResult.GetCsv();
    Console.WriteLine(result);
    

Full code:

using System;

namespace HelloOMR
{
	internal class Program
	{
		static void Main(string[] args)
		{
			Aspose.OMR.Api.OmrEngine omrEngine = new Aspose.OMR.Api.OmrEngine();
			Aspose.OMR.Api.TemplateProcessor templateProcessor = omrEngine.GetTemplateProcessor("Hello.OMR.omr");
			Aspose.OMR.Model.RecognitionResult recognitionResult = templateProcessor.RecognizeImage("IMG_20220401.jpg");
			string result = recognitionResult.GetCsv();
			Console.WriteLine(result);
			Console.ReadLine();
		}
	}
}

Now run the program. You should see results of the recognition in the console output:

Element Name,Value,
Question1,"{Answer bubble letter}"

Learn more

Keywords

OMR

FAQs

Package last updated on 30 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts