How to Extract Text From Image in C#

Performing Optical Character Recognition (OCR) on an image is a complex task. This topic explains step by step that how to extract text from image in C# quickly and easily. By using Aspose.OCR for .NET you can simply read characters from image in C# in a few steps.

Steps to Extract Text From Image in C#

  1. Use Aspose.OCR for .NET NuGet package
  2. Include Aspose.OCR namespace reference first
  3. Use SetLicense method to apply Aspose license
  4. Create an object of AsposeOcr Class instance
  5. Use RecognizeImage method to extract text from the image by applying OCR
  6. Save the extracted text to text file using FileStream and StreamWriter classes

The steps above shows you that reading characters from image in C# is very easy. The code for the above steps is given below.

Code to Extract Text From Image in C#

The approach is same for any type of .NET application if you’re using C# language. Whether you want to extract all the text from the image, or read text line by line from an image, Aspose.OCR for .NET can help you do that.

 English