Porównanie pomiędzy IronOCR a AWS Textract OCR
What is OCR?
The procedure used to transform an image of text into a machine-readable text format is known as Optical Character Recognition (OCR). For example, if you scan a form, invoices or a receipt, your computer saves the scan as an image file. The data in the image file cannot be edited, searched for, or counted using a text editor. However, you can use OCR solutions to convert the image file into a text document with its contents stored as text data.
In this modern era, most business workflows involve receiving information from print media. Different documents like paper forms, invoices, scanned legal documents, table extraction, and printed text or contracts are all part of business processes. Moreover, digitizing such documentation content creates images with the text hidden within it. Text in images cannot be processed by word processing tools in the same way as text documents. OCR technology solves the problem by converting text images into text data that can be analyzed by other business software.
How OCR Works?
The OCR engine works by using the following steps:
Image Acquisition
In this process, a scanner reads documents and converts them to binary data. The OCR software identifies the scanned image and classifies the light areas as background and the dark areas as text.
Preprocessing
The OCR software first cleans the image and removes errors to prepare its data for reading.
Text Recognition
The two main types of OCR algorithms for text recognition are pattern matching and feature extraction.
Pattern Matching
A character picture, or glyph, is isolated throughout the pattern matching process and compared to a previously recorded glyph.
Feature Extraction
Through the process of feature extraction, the glyphs are divided into features like lines, closed loops, line direction, and line junctions.
Postprocessing
The technology transforms the retrieved text data into a digital file after analysis. Some OCR systems can create annotated PDF documents that include both the before and after versions of the scanned document.
This article will discuss the comparison between two of the most prevalent applications and document libraries for OCR:
- IronOCR
- AWS OCR Textract
IronOCR Library
IronOCR is a C# .NET library that offers services to scan, search, read images and PDFs. It comes with 125+ global language packs. The output is achieved as text, structured data, or searchable PDFs. Supports .NET versions like 6, 5, Core, Standard, and Framework.
IronOCR is unique in its ability to automatically detect and extract data from imperfectly scanned images and documents. The 'IronTesseract' Class has the most straightforward API. It provides the most advanced build of Tesseract known anywhere, on any platform with increased speed, accuracy and a native DLL and API.
IronOCR can also scan barcodes and QR codes from all image formats, and it reads text and performs PDF scanning using the latest Tesseract 5 engine.
Features
- It is made purely for .NET applications.
- It can support 125 different languages. Arabic, Chinese, English, Finnish, French, German, Japanese, and many other languages are supported by IronOCR.
- It can correct a tilted image's position and remove noise from an image for precise output.
- It performs exceptionally well in low-resolution images with low DPI.
- It can read multiple types of QR codes and barcodes.
- It also supports the Gif and Tiff formats.
- It allows many threads at once. It is an outstanding feature that is not present in other OCR libraries. It makes the processes smoother.
- It can easily perform OCR on PDF files and export searchable PDF documents using OCR.
Now, let's have a look at AWS OCR.
AWS OCR Textract
Amazon's AWS Textract is a machine learning (ML) service that automatically extracts text, and data from scanned documents. It goes beyond simple optical character recognition (OCR) to identify, understand, and extract data from forms and tables using deep learning technology.
AWS OCR Textract uses machine learning to read and process any type of document, accurately extracting text, tabular data, and other data with no manual effort. Instead of taking hours or days to extract the data, Textract can do so quickly. Additionally, you can add human reviews with Amazon Augmented Artificial Intelligence (AI) to provide oversight of your models and check sensitive data.
Features
- Detect text in a variety of documents, including financial reports, medical records, tables, and tax forms.
- Extract text, forms, and table data from documents with structured data, using the Document Analysis API.
- Specify and extract information from documents using the Queries feature within the Analyze Document API.
- Process invoices and receipts with the Analyze Expense API.
- Process ID documents such as driver's licenses and passports issued by U.S. government, using the Analyze ID API.
- Scałable document analysis which can accelerate decision making.
The rest of the article goes as follows:
- Creating Visual Studio Project
- Installing IronOCR
- Installing AWS OCR Textract
- PDF to Text
- Image to Text
- Barcode and QR to Text
- Licensing
- Conclusion
1. Creating Visual Studio Project
This tutorial will use the Visual Studio 2022 version so I assume you must have installed it.
- Open Visual Studio 2022.
- Generate a new .NET Core project and then select Console App.
Aplikacja konsolowa
- Give a name to the project. E.g TextReader.
-
The latest and most stable version of the .NET framework is 6.0. We are going to use this.

- Click Create button and the project will be created.
Next, we will install the libraries for our use one by one.
2. Installing IronOCR
Bibliotekę IronOCR można pobrać i zainstalować na cztery sposoby. Są to:
- Using the Visual Studio Menedżer pakietów NuGet.
- Direct download via the NuGet website.
- Direct download via the IronOCR webpage.
- Using the Command Line in Visual Studio.
2.1. Using the Visual Studio NuGet Manager
The Visual Studio Menedżer pakietów NuGet can be used to incorporate IronOCR into a C# project.
- Expand Tools or by right-clicking solution explorer.
- Extend the Menedżer pakietów NuGet.
- Click on Manage NuGet Packages for Solutions or click Manage NuGet Packages in solution explorer.
Manage NuGet Packages
After this, a new window will appear in the search bar: type IronOCR. Check the project box on the right side and click Install.
Browse IronOCR
By using this method, developers can install the IronOCR library and any language pack of the developer's choice.
2.2. Direct download via the NuGet website
IronOCR can be directly downloaded from the NuGet website by following these instructions:
- Navigate to the link "https://www.nuget.org/packages/IronOcr/".
- Select the download package option from the menu on the right-hand side.
- Double-click the download package. Zostanie zainstalowany automatycznie.
- Next, reload the solution and start using it on the project.
2.3. Direct download via the IronOCR webpage
Developers can download the IronOCR library directly from the website by using this Link.
- Right-click the project from the solution window.
- Then, select option Reference and browse the location of the downloaded reference.
- Next, click OK to add the reference.
2.4. Using the Command Line in Visual Studio
- In Visual Studio, go to Tools-> NuGet Package manager -> Package manager console.
- Enter the following line in the package manager console tab:
Install-Package IronOcr
The package will now download/install in the current project and is ready to use.
Aplikacja konsolowa
Aplikacja konsolowa
After typing the command, press enter, and it will be installed.
2.5. Adding IronOCR Namespace
Include this line of code in the program to use IronOCR:
using IronOcr;
using IronOcr;
Imports IronOcr
Now let's install AWS Textract.
3. Installing AWS Textract OCR
Before you use Amazon Textract for the first time, complete the following tasks:
- Sign Up for AWS services.
- Create an IAM User.
Once you have successfully signed up for the account and created IAM user, you can now set the access keys in the AWS console to access the API programmatically using C#. You will need:
- AccessKeyId
- SecretAccessKey
- RegionEndPoint (Your access area)- In this example case: AFSouth1
3.1. Using Menedżer pakietów NuGet
- You can download and install AWS Textract SDK from Menedżer pakietów NuGet.
Menedżer pakietów NuGet
- Click on Browse and search for AWS Textract:
AWS Textract
3.2. Adding AWS OCR Namespaces
Include the following namespaces to use AWS Textract:
using Amazon.Textract;
using Amazon.Textract.Model;
using Amazon.Textract;
using Amazon.Textract.Model;
Imports Amazon.Textract
Imports Amazon.Textract.Model
4. PDF file to Text
Both libraries can extract text from PDF files. Let's have a look at the code one by one.
4.1. Using IronOCR
IronOCR allows recognizing and reading text from PDF document formats using the advanced Tesseract. The following simple code is used for extracting information:
var Ocr = new IronTesseract();
using (var input = new OcrInput())
{
input.AddPdf("example.pdf", "password");
// We can also select specific PDF page numbers to OCR
var Result = Ocr.Read(input);
Console.WriteLine(Result.Text);
Console.WriteLine($"{Result.Pages.Count()} Pages");
// Read every page of the PDF
}
var Ocr = new IronTesseract();
using (var input = new OcrInput())
{
input.AddPdf("example.pdf", "password");
// We can also select specific PDF page numbers to OCR
var Result = Ocr.Read(input);
Console.WriteLine(Result.Text);
Console.WriteLine($"{Result.Pages.Count()} Pages");
// Read every page of the PDF
}
Dim Ocr = New IronTesseract()
Using input = New OcrInput()
input.AddPdf("example.pdf", "password")
' We can also select specific PDF page numbers to OCR
Dim Result = Ocr.Read(input)
Console.WriteLine(Result.Text)
Console.WriteLine($"{Result.Pages.Count()} Pages")
' Read every page of the PDF
End Using
The code is simple, clean, and very easy to understand and use.
Input PDF File
Example PDF
Wynik
IronOCR Output
4.2. AWS Textract
Amazon Textract makes it easy to add document text detection and analysis to your applications. The following code is used to read PDF and same PDF is passed:
public static async void ReturnResult()
{
AmazonTextractClient client = new AmazonTextractClient("your_access_key_id", "your_secret_access_key", Amazon.RegionEndpoint.AFSouth1);
var request = new StartDocumentTextDetectionRequest();
request.DocumentLocation = new DocumentLocation
{
S3Object = new S3Object
{
Bucket = "your_bucket_name",
Name = "your_bucket_key"
}
};
var id = await client.StartDocumentTextDetectionAsync(request);
var jobId = id.JobId;
var response = client.GetDocumentTextDetectionAsync(new GetDocumentTextDetectionRequest{
JobId = jobId
});
response.Wait();
if (response.Result.JobStatus.Equals("SUCCEEDED"))
{
foreach (var block in response.Result.Blocks)
{
if (block.BlockType == "WORD" || block.BlockType == "PAGE" || block.BlockType == "LINE")
{
Console.WriteLine(block.Text);
}
}
}
}
static void Main(String[] args)
{
ReturnResult();
}
public static async void ReturnResult()
{
AmazonTextractClient client = new AmazonTextractClient("your_access_key_id", "your_secret_access_key", Amazon.RegionEndpoint.AFSouth1);
var request = new StartDocumentTextDetectionRequest();
request.DocumentLocation = new DocumentLocation
{
S3Object = new S3Object
{
Bucket = "your_bucket_name",
Name = "your_bucket_key"
}
};
var id = await client.StartDocumentTextDetectionAsync(request);
var jobId = id.JobId;
var response = client.GetDocumentTextDetectionAsync(new GetDocumentTextDetectionRequest{
JobId = jobId
});
response.Wait();
if (response.Result.JobStatus.Equals("SUCCEEDED"))
{
foreach (var block in response.Result.Blocks)
{
if (block.BlockType == "WORD" || block.BlockType == "PAGE" || block.BlockType == "LINE")
{
Console.WriteLine(block.Text);
}
}
}
}
static void Main(String[] args)
{
ReturnResult();
}
Public Shared Async Sub ReturnResult()
Dim client As New AmazonTextractClient("your_access_key_id", "your_secret_access_key", Amazon.RegionEndpoint.AFSouth1)
Dim request = New StartDocumentTextDetectionRequest()
request.DocumentLocation = New DocumentLocation With {
.S3Object = New S3Object With {
.Bucket = "your_bucket_name",
.Name = "your_bucket_key"
}
}
Dim id = Await client.StartDocumentTextDetectionAsync(request)
Dim jobId = id.JobId
Dim response = client.GetDocumentTextDetectionAsync(New GetDocumentTextDetectionRequest With {.JobId = jobId})
response.Wait()
If response.Result.JobStatus.Equals("SUCCEEDED") Then
For Each block In response.Result.Blocks
If block.BlockType = "WORD" OrElse block.BlockType = "PAGE" OrElse block.BlockType = "LINE" Then
Console.WriteLine(block.Text)
End If
Next block
End If
End Sub
Shared Sub Main(ByVal args() As String)
ReturnResult()
End Sub
The code is a bit tricky, lengthy and needs attention while passing and retrieving objects. First, we have to create an AmazonTextractClient object with 3 parameters: AccessKeyId, SecretAccessKey, and Region. Then we have to initiate a request using StartDocumentTextDetectionRequest() method. The request object then sets the DocumentLocation using the bucket name and key. This request is then passed to StartDocumentTextDetectionAsync() method. As it is an async method, we have to use the await keyword and make the ReturnResult function async. Upon success, the result is returned and jobId is saved. The jobId is passed to GetDocumentTextDetectionAsync() method and wait for SUCCEEDED response. foreach loop is used to loop through each block and check if it is "WORD", "PAGE" or "LINE", then print out the text recognition. Lastly, call this method in the Main method for document processing.
Wynik
The output is pretty similar to IronOCR.
AWS Textract Output
5. Images to Text
Reading data from images is tricky as the quality of image plays a vital role while extracting information. Both the libraries provide the facility to extract text. Here we will use png files.
5.1. Using IronOCR
The code is almost similar to the previous one. Here, AddPDF method is replaced with AddImage method.
var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
Input.AddImage("test-files/redacted-employmentapp.png");
//... you can add any number of images
var Result = Ocr.Read(Input);
Console.WriteLine(Result.Text);
}
var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
Input.AddImage("test-files/redacted-employmentapp.png");
//... you can add any number of images
var Result = Ocr.Read(Input);
Console.WriteLine(Result.Text);
}
Dim Ocr = New IronTesseract()
Using Input = New OcrInput()
Input.AddImage("test-files/redacted-employmentapp.png")
'... you can add any number of images
Dim Result = Ocr.Read(Input)
Console.WriteLine(Result.Text)
End Using
Obraz wejściowy
Redacted Employee Data
Wynik
The output is clean and matches the original image with just a few lines of code without any technicality and perfect output.
Image Output
5.2. Using AWS Textract
The following code helps to detect text from images:
public static async void ReturnResult()
{
AmazonTextractClient client = new AmazonTextractClient("your_access_key_id", "your_secret_access_key", Amazon.RegionEndpoint.AFSouth1);
var request = new DetectDocumentTextRequest();
request.Document = new Document
{
Bytes = new MemoryStream(File.ReadAllBytes(@"test-files/redacted-employmentapp.png"))
};
var result = await client.DetectDocumentTextAsync(request);
foreach (var block in result.Blocks)
{
if (block.BlockType == "WORD")
{
Console.WriteLine(block.Text);
}
}
}
static void Main(String[] args)
{
ReturnResult();
}
public static async void ReturnResult()
{
AmazonTextractClient client = new AmazonTextractClient("your_access_key_id", "your_secret_access_key", Amazon.RegionEndpoint.AFSouth1);
var request = new DetectDocumentTextRequest();
request.Document = new Document
{
Bytes = new MemoryStream(File.ReadAllBytes(@"test-files/redacted-employmentapp.png"))
};
var result = await client.DetectDocumentTextAsync(request);
foreach (var block in result.Blocks)
{
if (block.BlockType == "WORD")
{
Console.WriteLine(block.Text);
}
}
}
static void Main(String[] args)
{
ReturnResult();
}
Public Shared Async Sub ReturnResult()
Dim client As New AmazonTextractClient("your_access_key_id", "your_secret_access_key", Amazon.RegionEndpoint.AFSouth1)
Dim request = New DetectDocumentTextRequest()
request.Document = New Document With {.Bytes = New MemoryStream(File.ReadAllBytes("test-files/redacted-employmentapp.png"))}
Dim result = Await client.DetectDocumentTextAsync(request)
For Each block In result.Blocks
If block.BlockType = "WORD" Then
Console.WriteLine(block.Text)
End If
Next block
End Sub
Shared Sub Main(ByVal args() As String)
ReturnResult()
End Sub
Again, the code is almost similar to the previous one. Here, we have to initiate a request using DetectDocumentTextRequest() method. The request object then sets the document by reading all the bytes. This request is then passed to DetectDocumentTextAsync() method. As it is an async method, we have to use the await keyword and make the ReturnResult function async. Upon success, the result is returned in blocks. foreach loop is used to loop through each block and check if it is "WORD", then print out the text recognition. Lastly, call this method in the Main method for document processing.
The output is similar to IronOCR but this needs the file to be uploaded to AWS bucket in the first place.
6. Barcode and QR code to Text
A unique feature of IronOCR is it can read barcodes and QR codes from documents while it is scanning for text. Instances of the OcrResult.OcrBarcode class give the developer detailed information about each scanned barcode. AWS Textract does not provide this functionality.
The code for IronOCR is given below:
var Ocr = new IronTesseract();
Ocr.Configuration.ReadBarCodes = true;
using (var input = new OcrInput())
{
input.AddImage("test-files/Barcode.png");
var Result = Ocr.Read(input);
foreach (var Barcode in Result.Barcodes)
{
Console.WriteLine(Barcode.Value);
// type and location properties also exposed
}
}
var Ocr = new IronTesseract();
Ocr.Configuration.ReadBarCodes = true;
using (var input = new OcrInput())
{
input.AddImage("test-files/Barcode.png");
var Result = Ocr.Read(input);
foreach (var Barcode in Result.Barcodes)
{
Console.WriteLine(Barcode.Value);
// type and location properties also exposed
}
}
Dim Ocr = New IronTesseract()
Ocr.Configuration.ReadBarCodes = True
Using input = New OcrInput()
input.AddImage("test-files/Barcode.png")
Dim Result = Ocr.Read(input)
For Each Barcode In Result.Barcodes
Console.WriteLine(Barcode.Value)
' type and location properties also exposed
Next Barcode
End Using
The code is self-explanatory and easy to understand.
7. Licensing
IronOCR is a library that provides a developer's license for free. It also has a distinct pricing structure; the Lite bundle starts at $799 with no hidden fees. The redistribution of SaaS and OEM products is also possible. All licenses come with a 30-day money-back guarantee, a year of software support and upgrades, dev/staging/production validity, and a perpetual license (one-time purchase). To see IronOCR's entire price structure and licensing details, go here.
IronOCR Pricing Plan
You can get the redistribution of SaaS and OEM products royalty-free service for just a $1,599 single-time purchase.
SAAS Service
AWS Textract API provides developers with AWS Free Tier service. You can get started with Amazon Textract for free. The Free Tier lasts for three months and the pricing is shown below.

Pricing List
You can have a look at the pricing details from this link. Further, you can also adjust the prices as per your needs using the pricing calculator.
8. Conclusion
IronOCR provides C# developers the most advanced Tesseract API we know of, on any platform. IronOCR can be deployed on Windows, Linux, Mac, Azure, AWS, Lambda and supports .NET Framework projects as well as .NET Standard and .NET Core. We can also read barcodes in OCR scans, and even export our OCR as HTML and searchable PDFs.
Amazon Textract makes it easy to add document text detection and analysis to your applications. Amazon Textract is based on the proven, highly scałable, deep-learning technology that was developed by Amazon's computer vision scientists to analyze billions of images and videos daily. You don't need any machine learning expertise to use it. Amazon Textract includes simple, easy-to-use APIs that can analyze image files and PDF files. Amazon Textract is always learning from new data, and Amazon is continually adding new features to the service.
IronOCR licenses are developer-based, which means you should always purchase a license based on the number of developers who will use the product. AWS Textract licenses are based on the number of pages of the document to extract information and analyze the data. The licenses are on a monthly basis and the prices become very high for a large number of pages compared to the IronOCR license. Moreover, IronOCR license is a one-time purchase and it can be used for a lifetime and it supports OME and SaaS distribution.
In overall comparison, IronOCR and AWS OCR both have machine learning capabilities to detect text from a document or image. IronOCR has a slight advantage over AWS OCR as it's fast and time-saving. The code is simple and it's straightforward when detecting text from documents. The task is accomplished in a few methods. On the other hand, AWS Textract uses many methods to achieve the same task. This increases the server response and sometimes it's time-consuming. We can see that if we input even an imperfect document to IronOCR, it can accurately read its content to a statistical accuracy of about 99%, even though the document was badly formatted, skewed, and had digital noise. IronOCR works out of the box with no need to performance tune or heavily modify input images. Speed is blazing: IronOCR.2020+ is up to 10 times faster and makes over 250% fewer errors than previous builds.
Further, Iron Software is currently offering a five-tool package for the price of just two. The tools included in the Iron Suite are:
- IronBarcode
- IronXL
- IronOCR
- IronPDF
- IronWebScraper
Please visit this link to explore the IRONSUITE.
Często Zadawane Pytania
Czym jest optyczne rozpoznawanie znaków (OCR)?
Optyczne rozpoznawanie znaków (OCR) to technologia, która przekształca różne rodzaje dokumentów, takie jak zeskanowane dokumenty papierowe, pliki PDF lub zdjęcia zrobione aparatem cyfrowym, w dane, które można edytować i przeszukiwać. IronOCR to potężna biblioteka C# .NET, która usprawnia ten proces dzięki zaawansowanym algorytmom.
Jak mogę przekonwertować obrazy tekstu na tekst czytelny dla komputera przy użyciu języka C#?
Możesz użyć biblioteki IronOCR, biblioteki C# .NET, do konwersji obrazów tekstu na tekst czytelny dla komputera. Przetwarza ona obrazy za pomocą zaawansowanych algorytmów OCR i generuje rozpoznany tekst w formatach, które można łatwo przetwarzać programowo.
Jak IronOCR radzi sobie z niedoskonale zeskanowanymi obrazami?
IronOCR został zaprojektowany do efektywnego zarządzania i przetwarzania niedoskonale zeskanowanych obrazów. Zawiera funkcje przetwarzania wstępnego, które korygują przekrzywienie, poprawiają kontrast tekstu i udoskonalają jakość obrazu w celu zwiększenia dokładności OCR.
Czy mogę używać IronOCR do przetwarzania wielowątkowego?
Tak, IronOCR obsługuje wielowątkowość, co pozwala na jednoczesne przetwarzanie wielu dokumentów, znacznie zwiększając wydajność i przepustowość w aplikacjach obsługujących duże ilości dokumentów.
Jakie języki obsługuje IronOCR w zadaniach OCR?
IronOCR obsługuje ponad 125 języków, co czyni go wszechstronnym narzędziem do globalnych zastosowań, w których dokumenty w wielu językach muszą być przetwarzane i konwertowane na tekst.
Jak zainstalować IronOCR w projekcie Visual Studio?
IronOCR można zainstalować w projekcie Visual Studio za pomocą menedżera pakietów NuGet. Wystarczy wyszukać „IronOCR” w konsoli NuGet i zainstalować go, co pozwoli na zintegrowanie funkcji OCR z aplikacjami .NET.
Jaki jest model cenowy IronOCR?
IronOCR oferuje model licencji jednorazowej. Obejmuje to Licencje wieczyste z 30-dniową gwarancją zwrotu pieniędzy, co zapewnia programistom elastyczność i spokój ducha.
Czym AWS Textract różni się od IronOCR pod względem technologii?
AWS Textract wykorzystuje technologie uczenia maszynowego i głębokiego uczenia się do wyodrębniania tekstu i danych, zapewniając szczegółową analizę treści dokumentów. Natomiast IronOCR koncentruje się na łatwości użytkowania i integracji z projektami .NET, oferując solidne rozwiązanie OCR z obszerną obsługą języków.
Czy IronOCR potrafi odczytywać i przetwarzać kody kreskowe oraz kody QR?
Tak, IronOCR potrafi odczytywać i przetwarzać zarówno kody kreskowe, jak i kody QR. Wyodrębnia szczegółowe informacje o każdym kodzie, jednocześnie skanując tekst, co czyni go wszechstronnym narzędziem do przetwarzania dokumentów.
Jakie platformy i środowiska obsługują IronOCR?
IronOCR jest kompatybilny z szeroką gamą środowisk, w tym Windows, Linux, Mac, Azure, AWS i Lambda. Obsługuje projekty .NET Framework, .NET Standard i .NET Core, zapewniając elastyczność w różnych ekosystemach programistycznych.



