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++?
Aspose.OMR for C++ is a powerful and flexible C++ OMR API designed to streamline Optical Mark Recognition tasks within C++ applications. Ideal for developers building survey systems, examination processing tools, or custom OMR apps, this SDK offers seamless integration, complete with in-depth documentation, sample code, and cross-platform support. With capabilities to process multiple-choice, grid, and text-based question types, it excels in accurately reading scanned images and photos. Developers can export recognition results in CSV format, making it easy to analyze data from tests, forms, or questionnaires across various platforms without worrying about compatibility issues.
Whether you're developing custom C++ OMR software or looking for a reliable OMR SDK for C++, Aspose.OMR stands out as a comprehensive solution. It supports advanced features like checkbox detection, grid fields, and flexible OMR templates. The library also integrates smoothly with other Aspose APIs, allowing developers to enhance their applications with additional file format or document automation features. From high-accuracy OMR image analysis with C++ to building scalable form processing systems, Aspose.OMR for C++ empowers developers to create efficient and feature-rich OMR solutions quickly and reliably.
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();