You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

Aspose.Ocr.Cpp

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Aspose.Ocr.Cpp

Easily convert images to text and create searchable PDFs with our powerful and developer-friendly OCR API. Integrate OCR functionality into your Windows applications with minimal code. Extract editable text from scanned documents, photos, screenshots, and more, handling various fonts, layouts, and styles. Bulk-recognize entire folders and archives of images, and process multi-page PDFs and TIFFs. Aspose.OCR for C++ is well-fit for global scale content digitization. It supports a vast range of languages across Europe, Middle East, Asia, Africa, and the Americas, including the ability to recognize mixed languages within a document. This versatile library empowers businesses of all sizes, from startups to global corporations. Changelog: - Minor improvements and fixes.

25.2.0
nugetNuGet
Version published
Maintainers
2
Created
Source

Optical character recognition (OCR) API for C++

Version 25.2.0 ![Downloads]Windows-CPU / Windows-GPU / Linux-CPU / Linux-GPU

Product Page | Docs | Demos | API Reference | Examples | Blog | Search | Free Support | Temporary License

This package can be used to develop applications for different operating systems and platforms. You can build both 32-bit and 64-bit software.

Please note: Aspose.OCR for C++ requires ONNX Runtime 1.11.0 or later (CPU / GPU).

API overview

Aspose.OCR for C++ can extract text from photos, scans, PDF documents and other graphical files. It allows you to add OCR functionality to a desktop or web application in less than 10 lines of code, without having to delve into complex mathematical operations, neural networks, and other technical details.

  • Ready-to-use OCR engine with superior recognition speed and accuracy.
  • Supports 27 languages based on Latin, Cyrillic and Asian scrips.
  • Can work with rotated, distorted and noisy images.
  • Supports most file formats you can get from a scanner or camera, as well as web links.
  • Batch recognition of all images in a folder or archive.
  • Recognizes the whole image or selected areas only; identifies words, lines or paragraphs.
  • Recognition results are returned in the most popular document and data exchange formats.
  • Spell checking of recognition results.
  • Full compatibility with other Aspose products - build solutions of any complexity using familiar concepts with minimal code.

Recognition languages

Aspose.OCR can recognize a large number of languages and all popular writing scripts, including texts with mixed languages.

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

Asian languages

  • Chinese
  • Hindi

Supported file formats

Aspose.OCR for C++ can recognize just about any file that you get from a scanner or camera, or download from the Internet:

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

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

  • Plain text
  • RTF
  • Microsoft Word document
  • Microsoft Excel spreadsheet
  • Searchable PDF
  • JSON
  • XML

Get started

You can get familiar with Aspose.OCR for C++ by creating a minimal console application for extracting text from an image.

  • Create a basic C++ project in Visual Studio.
  • Install this NuGet package to the project.
  • Locate an image containing a line of text and save it to the project output directory under the name source.png.
  • Add an image to AsposeOCRInput structure:
    string file = current_dir + "/source.png";
    AsposeOCRInput source;
    source.url = file.c_str();
    std::vector<AsposeOCRInput> content{ source };
    
  • Set recognition language:
    RecognitionSettings settings;
    settings.language_alphabet = language::eng;
    
  • Extract text from the image:
    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::cout << std::wstring(buffer) << std::endl;
    
  • Release the resources (recommended):
    asposeocr_free_result(result);
    

Full code:

// Provide the image
string file = current_dir + "/source.png";
AsposeOCRInput source;
source.url = file.c_str();
std::vector<AsposeOCRInput> content{ source };
// Set recognition language
RecognitionSettings settings;
settings.language_alphabet = language::eng;
// Extract text from the image
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::cout << std::wstring(buffer) << std::endl;
// Release the resources
asposeocr_free_result(result);

Run the program. You will see the extracted text in the console output. If the text is too large, the result may be cut off due to trial restrictions. You can get a temporary license to remove all limitations of the trial version for 30 days.

Learn more

Keywords

OCR

FAQs

Package last updated on 04 Feb 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