C++ OCR Library

Extract text from BMP, JPEG and other images having different fonts and styles within any C++ application.

  Download Free Trial
Aspose.OCR for C++

Aspose.OCR for C++


Aspose.OCR for C++ is a robust and reliable professional optical character recognition API. Developers can easily add OCR operations in their software applications. OCR library can work offline for business applications as well. Furthermore, this premise OCR API can perform OCR using the GPU instead of the core processor. Major API feature is the text fragment detection that enables to recognize header and paragraphs for pages having pictures or tables. It supports commonly used formats for reading characters and fonts having different styles, noise removal filters, recognizing the whole page, or just single line form it.


Advanced C++ OCR API Features



Recognize characters from images


Support multiple image file formats


Support multiple characters 


Recognize characters or text in popular fonts


Multi styles support


Scan the whole image or any part of it


Recognize text in paragraphs


Recognize text in headers


Calculate the skew angle of images

Perform OCR of an Image

Aspose.OCR for C++ allows the developers to recognize each text segment like text and related information such as different characters, font and style of an image of a page. Just few lines of code that allows performing the OCR operation.

Perform OCR of an image of a Page - C++

std::string img_path = "../srcSample.png";
// Prepare buffer for result (in symbols, len_byte = len * sizeof(wchar_t))
const size_t len = 4096;
wchar_t bfr[len] = { 0 };
size_t result = aspose::ocr::page(image_path.c_str(), bfr, len);
//Print result
std::wcout << bfr << L"\n";

Muti-Fonts & Styles Support

C++ OCR API supports to recognize Text in popular fonts & styles like Arial, Times New Roman, Courier New, Verdana, Tahoma and Calibri fonts in regular, bold and italic text styles.

Calculate Skew Angle of the Image

The library calculates the skew angle of the image. It takes the image path as input and returns the skew angle.

Calculate Skew Angle - C++

std::string image_path = "../srcSkew.png";
std::double_t result = aspose::ocr::get_skew(image_path.c_str());
std::wcout << result << L'\n';

Support and Learning Resources


Aspose.OCR offers individual OCR APIs for other popular development environments as listed below: