Extracting text from an image
Contents
[
Hide
]
To extract text from JPEG, PNG and BMP images, use one of the following methods:
Method | Description |
---|---|
page() |
Read the image with automatic text areas detection and skew angle correction. |
page_settings() |
Fine-tune recognition settings and read the image. |
page_all() |
Read the entire image without text areas detection. |
page_abc() |
Read only the predefined list of characters from the images. |
page_abc_all() |
Read only the predefined list of characters from the image without text areas detection. |
std::string image_path = "source.png";
const size_t len = 4096;
wchar_t buffer[len] = { 0 };
RecognitionSettings settings;
settings.language_alphabet = language::ukr;
settings.auto_contrast = true;
settings.upscale_small_font = true;
size_t res_len = aspose::ocr::page_settings(image_path.c_str(), buffer, len, settings);
std::wcout << buffer;