Why Aspose.OMR for C++?

Create and recognize machine-readable forms of any layout and complexity in on-premise applications, web services, or in the cloud. Our solution is suitable for projects of any size - from simple surveys and quizzes to final exams and elections. Click the items below to learn more about our features and benefits.

Illustration ocr

No equipment needed

Use your existing office copier or even a smartphone camera instead of a specialized OMR reader.

Full personalization

Personalize OMR forms by adding automatically generated QR codes and barcodes, images, signature fields, and more.

Reliable results

Robust optical mark detection algorithms coupled with the capability to fine-tune recognition guarantee 100% accurate results.

Whole solution

Aspose.OMR for C++ supports the complete OMR workflow - from designing a form to recognizing its filled hardcopies.

Developer-friendly

Our API is extremely easy to use even for inexperienced developers. A simple OMR application can be written in 10 lines of code.

Live code sample

Experience simplicity: Convert an image to text in just three lines of C++ code!

Ready to recognize Ready to recognize Drop a file here or click to browse *

* By uploading your files or using the service you agree with our Terms of use and Privacy Policy.

Recognition result
 

Convert image to text

Discover More Examples >
  string file = "source.png";
  AsposeOCRInput source;
  source.url = file.c_str();
  vector<AsposeOCRInput> content = {source};
  
  RecognitionSettings settings;
  settings.language_alphabet = language::eng;
  
  size_t size = 0;
  wchar_t* buffer = asposeocr_serialize_result(result, size);
  wcout << wstring(buffer) << endl;

  asposeocr_free_result(result);

C++ Power Everywhere

Aspose.OCR for C++ seamlessly operates on any platform.

Microsoft Windows
Linux
MacOS
GitHub
Microsoft Azure
Amazon Web Services
Docker

Supported file formats

Aspose.OCR for C++ can work with virtually any file you can get from a scanner or camera. Recognition results are returned in the most popular file and data exchange formats that can be saved, imported to a database, or analyzed in real time.

Images

  • JPEG
  • PNG
  • TIFF
  • BMP

Batch OCR

  • Multi-page PDF
  • ZIP
  • Folder

Recognition results

  • Text
  • PDF
  • Microsoft Word
  • Microsoft Excel
  • RTF
  • JSON
  • XML

Installation

Aspose.OCR for C++ is distributed as a NuGet package or as a downloadable file with minimal dependencies. Easily install it into your project, and you’re ready to recognize texts in multiple supported languages and save recognition results in various formats.

Request a trial license to kickstart the development of a fully functional OCR application without limitations.

C++ Power Across the Board

Our library fully supports C++11 and later, enabling your applications to run seamlessly on any platform – desktop Windows, Windows Server, macOS, Linux, and the cloud.

28 Recognition Languages

Our C++ OCR API recognizes a plethora of languages and popular writing scripts, including mixed languages:

Leave language detection to the library or define the language yourself for enhanced recognition performance and reliability.

  • Extended Latin alphabet: Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Italian, Latvian, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Slovak, Slovenian, Spanish, Swedish;
  • Cyrillic alphabet: Belorussian, Bulgarian, Kazakh, Russian, Serbian, Ukrainian;
  • Chinese: Over 6,000 characters;
  • Hindi.

Features and Capabilities that Empower

Aspose.OCR for C++ Discover the advanced features and capabilities of Aspose.OCR for C++.

Feature icon

Photo OCR

Extract text from smartphone photos with scan-level accuracy.

Feature icon

Searchable PDF

Convert any scan into a fully searchable and indexable document.

Feature icon

URL recognition

Recognize an image from URL without downloading it locally.

Feature icon

Bulk recognition

Read all images from multi-page documents, folders and archives.

Feature icon

Any font and style

Identify and recognize text in all popular typefaces and styles.

Feature icon

Fine-tune recognition

Adjust every OCR parameter for best recognition results.

Feature icon

Spell checker

Improve results by automatically correcting misspelled words.

Feature icon

Find text in images

Search for text or regular expression within a set of images.

Feature icon

Compare image texts

Compare texts on two images, regardless of the case and layout.

Feature icon

Limit recognition scope

Limit the set of characters the OCR engine will look for.

Feature icon

Detect image defects

Automatically find potentially problematic areas of image.

Feature icon

Recognize areas

Find and read only specific areas of an image, not all text.

C++ Code Samples

Delve into code samples to seamlessly integrate Aspose.OCR for C++ into your applications.

C++ Installation Mastery

As a lightweight C++ Archive (LIB) file or a downloadable file with minimal dependencies, Aspose.OCR for C++ is easily distributed. Integration into your project, directly from your preferred C++ Integrated Development Environment (IDE), is a seamless process. Simply install it, and you’re prepared to leverage the complete range of OCR capabilities, saving recognition results in any of the supported formats.

Post-installation, you can promptly commence using Aspose.OCR for C++, albeit with certain limitations. A temporary license lifts all trial version restrictions for 30 days. Utilize this period to initiate the development of a fully functional OCR application, allowing you to make an informed decision on purchasing Aspose.OCR for C++ at a later stage.

OCR for C++ Photos

Overcome the challenge of OCR applications lacking widespread scanners. Our API boasts powerful built-in image pre-processing filters that adeptly handle rotated, skewed, and noisy images. Combined with support for all image formats, it ensures reliable recognition even from smartphone photos. Most pre-processing and image correction are automated, requiring your intervention only in challenging cases. Also you can predefine image regions to work with.

Set custom angle for skew correction and defune recognition regions - C++

string file = "photo.png";
AsposeOCRInput source;
source.url = file.c_str();
std::vector<AsposeOCRInput> content = { source };

// Fine-tune recognition
RecognitionSettings settings;
settings.detect_areas_mode = detect_areas_mode_enum::PHOTO;

// Extract text from the photo
auto result = asposeocr_recognize(content.data(), content.size(), settings);

// Output the recognized text
wchar_t* buffer = asposeocr_serialize_result(result, buffer_size, export_format::text);
std::wcout << std::wstring(buffer) << std::endl;

// Release the resources
asposeocr_free_result(result);

Recognize text in specific areas of image

Define specific regions for text recognition, enhancing accuracy. Tailor recognition to focus on critical areas, optimizing results in your image processing workflow.

Define recognition regions for OCR - C++

// Original image
std::string image_path = "../Data/Source/sample.png";
rect rectangles[2] = { {90, 186, 775, 95} , { 928, 606, 790, 160 } };

// Prepare buffer for result
const size_t len = 4096;
wchar_t buffer[len] = { 0 };

// Adjust skew angle
RecognitionSettings settings;
settings.format = export_format::text;
settings.rectangles = rectangles;
settings.rectangles_size = 2;
settings.skew = 5;

// Recognize image
size_t res_len = aspose::ocr::page_settings(image_path.c_str(), buffer, len, settings);

Converting a scan to editable document

While many businesses, organizations and individuals have been actively working on reducing their reliance on paper documents, this is still the most widespread format for storage and sharing. Scanned documents backed by physical archives are sufficient for regulatory compliance, legal purposes, long-term backup and redundancy. However, business cases frequently arise for creating new documents based on existing scanned content or portions of existing documents.

Aspose.OCR for С++ makes it easy to convert a scanned image or an image-based PDF into an editable DOCX or RTF document or Microsoft Excel spreadsheet (XLSX). Content is recognized with high accuracy and speed, saving you the time and effort of manual typing and ensuring there are no human errors, especially when working with large volumes of text.

Turn scanned image to etitable text document - C++

// Provide the folder with scanned pages
directory dir("./scans/");
const string current_dir = dir.full_name();
const string image = current_dir + "p.png";
const size_t len = 6000;
wchar_t buffer[len] = { 0 };

// Recognize and save results to Microsoft Word document
RecognitionSettings settings;
settings.save_format = file_format::docx;
asposeocr_page_save(image.c_str(), "result.docx", settings);

Detecting image defects

Image defects can significantly impact the accuracy of OCR. They can be caused by the quality of the image acquisition process, environmental conditions, and the hardware used to capture the image. To improve recognition accuracy, it is essential to preprocess and enhance images to mitigate these defects whenever possible.

Aspose.OCR for C++ can automatically find potentially problematic areas of image during recognition. You can highlight problem areas when previewing an image and even OCR them using alternative recognition settings to get a better result.

Recognize text on blurry, distorted and low constrast images - C++

// Provide the image
string file = "source.png";
AsposeOCRInput source;
source.url = file.c_str();
vector<AsposeOCRInput> content = {source};

// Activate detection of low-contrast areas
RecognitionSettings settings;
settings.defect_type = defect_type::ASPOSE_OCR_DETECT_DARK_IMAGES;

// Find and show low-contrast areas
AsposeOCRRecognitionResult result = asposeocr_recognize(content.data(), content.size(), settings);
for (size_t p_number = 0; p_number < result.pages_amount; ++p_number)
{
  cout << "Page " << p_number << ";\n";
  const auto& page = result.recognized_pages[p_number];
  for (size_t defect_number = 0; defect_number < page.defects_count; ++defect_number)
  {
    const auto& defect_area = page.defect_areas[defect_number];
    cout << "Low-contrast area " << defect_number << ":" << defect_area.area << std::endl;
  }
}

// Release the resources
asposeocr_free_result(result);

Batch Processing

OCR API frees you from recognizing every image one-by-one by offering various batch-processing methods that allow you to recognize multiple images in one call:

  • Recognition of multi-page PDF and TIFF files.
  • Recognition of all files in a folder.
  • Recognition of all files in an archive.

Recognize ZIP archive - C++

// Provide a ZIP archive
string file = "pages.zip";
AsposeOCRInput source;
source.url = file.c_str();
std::vector<AsposeOCRInput> content = { source };

// Fine-tune recognition
RecognitionSettings settings;
settings.detect_areas_mode = detect_areas_mode_enum::COMBINE;

// Extract texts
auto result = asposeocr_recognize(content.data(), content.size(), settings);

Text detection aption

You can split recognition results into lines and detect text areas in a page.

Detect text on image - C++

size_t res_len = asposeocr_get_rectangles_number(image_path.c_str(), areas_type::lines, false);
rect* rectangles = new rect[res_len];
res_len = asposeocr_get_rectangles(image_path.c_str(), areas_type::lines, false, rectangles, res_len);