1. Products
  2.   OMR
  3.   C++
  4.   Aspose.OMR for C++

Aspose.OMR for C++

 
 

C++ Library to Create OMR Forms & Recognize Data

A Cutting-edge Optical Mark Recognition (OMR) Solution for C++ Developers that Allows to Create OMR Templates/Forms and Recognize Scanned Images & Photos inside C++ Applications.

What is Aspose.OMR for C++?

Developing reliable optical mark recognition (OMR) solutions is crucial in the constantly changing field of software development. The industry leader in document manipulation APIs, Aspose, presents Aspose.OMR for C++ a state-of-the-art tool for C++ developers. The API changes the game by providing a stable API that makes it easier to include OMR functionality into C++ programs. Aspose offers thorough documentation for the API to help ensure a seamless integration process. To ensure a hassle-free development experience, software developers have access to comprehensive guidelines, code examples, and API reference documentation.

Because Aspose.OMR for C++ has sophisticated OMR features, software developers may easily create and handle complicated forms. The API is adaptable for a range of applications because it offers multiple choice, grid, and text-based questions, among other question formats. It provides sophisticated capabilities like the ability to export the results in CSV format, recognize data from tests, examinations, questionnaires, and surveys, and recognize scanned images and photos with a high accuracy rate. Cross-platform interoperability is a priority in its design. Developers don't have to worry about compatibility problems while deploying their apps across several platforms.

OMR processing is what Aspose.OMR for C++ is designed to provide. Numerous OMR features, including as checkboxes, grids, and text fields, are supported by the API. Aspose.OMR for C++ easily interfaces with other Aspose products, and Aspose provides a suite of robust APIs. This collaboration enables developers to add new features to their apps, resulting in a complete solution that meets certain needs. For developers looking for a powerful OMR solution, it stands out as a solid and feature-rich option. This API enables developers to easily handle complex OMR activities with its smooth integration, high processing accuracy, flexible templates, and broad support.

Previous Next

Getting Started with Aspose.OMR for C++

The recommend way to install Aspose.OMR for C++ is via NuGet. Please use the following command for a smooth installation.

Install Aspose.OMR for C++ via NuGet

 
Install-Package Aspose.OMR.Cpp

You can download the library directly from Aspose.OMR product page

Generate OMR Template/Form via C++ API

Aspose.OMR for C++ API facilitates template creation, a crucial aspect of OMR systems. With C++ OMR API, software developers can design templates for different types of forms, ensuring accurate data extraction during the scanning process. The API can be used to customize the paper size, orientation, font, colors and other layout settings that apply to all template pages and more. This feature streamlines the integration of OMR capabilities into various domains, such as surveys, exams, and assessments. The following example shows how to generate a form image that can be printed out and handled to respondents inside C++ applications.

How to Generate a Form Image inside C++ Applications?

//Generate the form for ANSI Letter paper size

System::SharedPtr engine = System::MakeObject();
// Generate the form for ANSI Letter paper size (8.5 by 11 inches)
System::SharedPtr settings = System::MakeObject();
settings->setPaperSize(Api::PaperSize::Letter);
System::SharedPtr result = engine->GenerateTemplate(markupPath, nullptr, settings);

Recognize OMR Forms via C++ API

Aspose.OMR for C++ is equipped with advanced OMR functionality, allowing software developers to design and process complex forms with ease. Recognizing Optical Mark Recognition (OMR) forms using the API is a straightforward process that involves several key steps. After the installation users’ needs to load the OMR template that corresponds to the form you want to recognize. After that load the scanned image of the OMR form and process it using the loaded template, retrieve the recognized data and save it if needed. The following example shows how to recognize and extract data from OMR form inside C++ applications.

How to Recognize and Extract Data from OMR Form using C++ API?

#include 

omr::AsposeOmrApi api;
api.LoadTemplate("path/to/your/template.omr");

// Load and Process the Image

api.LoadImage("path/to/your/scanned/image.jpg");
api.Process();

// Access Recognized Data

omr::OmrPageReader reader = api.GetOmrPageReader();
std::vector pages = reader.ExtractPages();
omr::OmrPage page = pages[0]; // Assuming there's only one page in the form

// Access and handle recognized data

// Example: Extracting data from the grid
omr::Grid grid = page.GetGrids()[0]; // Assuming there's only one grid on the page
std::vector> data = grid.ExtractData();

// Finalize and Cleanup

api.Finalize();

High-Speed & Efficient OMR Scanning

Efficiency is key, especially when dealing with large volumes of scanned documents. Aspose.OMR for C++ excels in high-speed scanning, enabling swift and accurate data extraction from OMR sheets. This feature is particularly valuable for applications where time is of the essence, such as time-bound exams or surveys. The API supports a wide array of OMR elements, including checkboxes, grids, and text areas. This comprehensive support enables developers to handle a variety of document types, making it a versatile choice for applications requiring OMR functionality.

Multi-Page Document Processing

Aspose.OMR for C++ excels in multi-page document processing, allowing developers to handle extensive datasets seamlessly. This capability is particularly valuable for applications involving surveys or exams with numerous participants. Processing multi-page documents using OMR C++ API involves a series of steps to load, process, and extract data from each page. Such as loading the OMR template, process each page of the multi-page document and save data.

How to Load and Process Each Page of Multi-page Document via C++ API?

#include 
// Load the OMR template
omr::AsposeOmrApi api;
api.LoadTemplate("path/to/your/template.omr");
//process each page of the multi-page document.
const int pageCount = 5; // Change this to the total number of pages in your document
for (int currentPage = 1; currentPage <= pageCount; ++currentPage) {
    std::string imagePath = "path/to/your/scanned/image" + std::to_string(currentPage) + ".jpg";
    api.LoadImage(imagePath);
    api.Process();
    // Access and handle recognized data for each page
    omr::OmrPageReader reader = api.GetOmrPageReader();
    std::vector pages = reader.ExtractPages();
    omr::OmrPage page = pages[0]; // Assuming there's only one page in each image
    // Access and handle recognized data
    // Example: Extracting data from the grid
    omr::Grid grid = page.GetGrids()[0]; // Assuming there's only one grid on the page
    std::vector> data = grid.ExtractData();
    // Further processing or storage of the data can be done here
    // Cleanup for the next iteration
    api.Finalize();
}
// release resources.
api.Finalize();