Recognition

Contents
[ ]

Reading text from any content in Aspose.OCR for .NET is as easy as calling a universal Aspose.OCR.AsposeOcr.Recognize method.

This method takes OcrInput object and optional recognition settings.

Recognition results are returned as a list of Aspose.OCR.RecognitionResult objects, that allow you to perform advanced manipulations with recognition results: automatically correct spelling, get image regions and save results in various formats.

Example

The following code example shows how to extract text from multiple images:

Aspose.OCR.AsposeOcr recognitionEngine = new Aspose.OCR.AsposeOcr();
// Add images to OcrInput object
Aspose.OCR.OcrInput input = new Aspose.OCR.OcrInput(Aspose.OCR.InputType.SingleImage);
input.Add("source1.png");
input.Add("source2.jpg");
// Set recognition language
Aspose.OCR.RecognitionSettings recognitionSettings = new Aspose.OCR.RecognitionSettings();
recognitionSettings.Language = Aspose.OCR.Language.Ukr;
// Recognize image
List<Aspose.OCR.RecognitionResult> results = recognitionEngine.Recognize(input, recognitionSettings);
foreach(Aspose.OCR.RecognitionResult result in results)
{
	Console.WriteLine(result.RecognitionText);
}