Skip to footer content
OCR TOOLS

How to Use OCR text Recognition (Beginner Tutorial)

This article is a guide to OCR (optical character recognition) text recognition and its practical applications, including reading text out of a scanned document or PDF file. It covers selecting a suitable OCR tool, improving its performance, and handling harder cases such as multiple languages or poor-quality scans. It also covers responsible OCR usage and the ethical questions involved. IronOCR is the library used for the examples here.

Understanding OCR (Optical Character Recognition)

Imagine being able to scan a printed document and instantly convert it into editable digital text. That's the magic of OCR at work. OCR is a technology that uses pattern recognition and machine learning algorithms to recognize and extract text from images or scanned documents. This enables the transformation of printed materials into searchable, editable, and shareable digital formats.

OCR.space

OCR.space is an online OCR platform. It converts images and scanned documents into text through a straightforward web interface, which makes it useful to students, professionals, and researchers working with printed content.

Using OCR.space

Performing OCR (Optical Character Recognition) using the OCR.space website is a straightforward process that allows you to convert any scanned image or any scanned paper document into editable text. Follow these steps to perform OCR using the OCR.space website:

  1. Access the OCR.space Website: Open your preferred web browser and navigate to the OCR.space website at https://ocr.space/.

    How to Use OCR Text Recognition (Beginner Tutorial): Figure 1

  2. Upload Your Image: Click on the "Choose File" button or drag and drop your image directly onto the designated area on the website. The image can be in various formats, such as JPG, PNG, GIF, or PDF.

    How to Use OCR Text Recognition (Beginner Tutorial): Figure 2

  3. Start OCR Process: After uploading your image and configuring optional settings, click the "Start OCR!" button. The OCR.space website will process your image and extract the recognized text.
  4. Review and Download Results: Once the OCR process is complete, you'll be presented with the extracted text on the website. Review the text to ensure accuracy and make any necessary adjustments by manual data entry.

    How to Use OCR Text Recognition (Beginner Tutorial): Figure 3

  5. Download Text: If you're satisfied with the results, click the "Download" button to save the extracted text to your computer. Depending on your selected output format, you'll receive a plain text file or a searchable PDF.

    How to Use OCR Text Recognition (Beginner Tutorial): Figure 4

  6. Save or Share Results: You can now save the extracted text to your preferred location on your computer or share it with others as needed.

This is how you use OCR.space and an OCR engine to extract text from an image file.

Introducing IronOCR

IronOCR converts images and scanned documents into machine-readable text. It handles invoices, printed documents, archival material, and data entry tasks, and its API is approachable whether or not you have worked with OCR before.

Installing IronOCR

You can easily install IronOCR using the NuGet Package Manager console by running the following command. Alternatively, you can download it directly from the NuGet Website.

Install-Package IronOcr

Extracting Text Using IronOCR

In this section, we will see how you can easily extract text from images using IronOCR. The source code below shows how to extract text from an image.

using IronOcr;
using System;

public class OcrExample
{
    public static void Main()
    {
        // Initialize the OCR engine
        var ocr = new IronTesseract();

        // Use a disposable input object
        using (var input = new OcrInput())
        {
            // Specify the image to be processed
            input.AddImage("r3.png");

            // Perform OCR on the input
            OcrResult result = ocr.Read(input);

            // Output the recognized text
            string text = result.Text;
            Console.WriteLine(text);
        }
    }
}
using IronOcr;
using System;

public class OcrExample
{
    public static void Main()
    {
        // Initialize the OCR engine
        var ocr = new IronTesseract();

        // Use a disposable input object
        using (var input = new OcrInput())
        {
            // Specify the image to be processed
            input.AddImage("r3.png");

            // Perform OCR on the input
            OcrResult result = ocr.Read(input);

            // Output the recognized text
            string text = result.Text;
            Console.WriteLine(text);
        }
    }
}
Imports IronOcr
Imports System

Public Class OcrExample
	Public Shared Sub Main()
		' Initialize the OCR engine
		Dim ocr = New IronTesseract()

		' Use a disposable input object
		Using input = New OcrInput()
			' Specify the image to be processed
			input.AddImage("r3.png")

			' Perform OCR on the input
			Dim result As OcrResult = ocr.Read(input)

			' Output the recognized text
			Dim text As String = result.Text
			Console.WriteLine(text)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

Output

Here is the output screenshot of automatic text recognition or recognized text.

How to Use OCR Text Recognition (Beginner Tutorial): Figure 5

Conclusion

This guide covered how OCR works, how to pick a tool, how to improve its performance, and the ethical questions worth considering — applied to OCR.space and IronOCR. Between the step-by-step OCR.space walkthrough and the IronOCR introduction, you should have enough to fit either into your own workflow for extracting text from scanned documents.

As we highlighted, IronOCR is a market-leading OCR software that seamlessly integrates visual content and digital text, revolutionizing the way information is accessed, manipulated, and utilized across various sectors. A more detailed tutorial on IronOCR can be found on IronOCR's website.

Kannaopat Udonpant
Software Engineer
Before becoming a Software Engineer, Kannapat completed a Environmental Resources PhD from Hokkaido University in Japan. While pursuing his degree, Kannapat also became a member of the Vehicle Robotics Laboratory, which is part of the Department of Bioproduction Engineering. In 2022, he leveraged his C# skills to join Iron Software's engineering ...
Read More

Iron Support Team

We're online 24 hours, 5 days a week.
Chat
Email
Call Me