In this tutorial, we will learn how to extract Text from Image in C++. You can extract text in languages like English, German, Chinese, Portuguese, Spanish and French etc. from PNG, JPG or BMP images in C++ with simple API calls that can be used in Windows or Linux environments.
Steps to Extract Text From Image in C++
- Install Aspose.OCR for C++ from NuGet package Manager Tool
- Add reference to Aspose::OCR namespace
- Set the RecognitionSettings for information about source image file content
- Use page_save method to extract the content based on RecognitionSettings
You can efficiently read Text from Image using C++ with simple API calls in few lines of code. You need to specify the settings in RecognitionSettings for export format, output file format and language etc. Then using single line of code extract the text information from image and save as either text or JSON in C++. The above example covers reading text from PNG in C++ but you can also use it for extracting characters from JPG or BMP using C++.
Code to Extract Text From Image in C++
In previous topic, we learned how to extract Text from Image in C#. Whereas, in this article we have learnt how to read characters from Image in C++.