跳過到頁腳內容
與其他組件的比較

IronOCR 和 Asprise OCR 之間的比較

When we talk about OCR, it refers to optical character recognition. The term is often used in the business world to refer to the process of converting an image or graphical representation of any text-based document (e.g. a scanned or faxed page) into an editable word format or text-searchable document format by means of computer software.

The acronym OCR stands for Optical Character Recognition, a task carried out by computer software that has been designed specifically for the purpose. This type of software will scan the page and recognize any textual information that is on there, converting it into a digital form so that it can be edited and reproduced digitally with no loss in quality.

There are many applications for OCR, but the most popular use case is converting scanned documents into digital files that can be formatted and indexed in databases and analyzed.

In this article, we are going to compare two of the most common libraries and applications for OCR and PDF document images. 它們是:

  • Asprise OCR
  • IronPDF

1.0 簡介

1.1 Asprise OCR Introduction and Features

The Asprise C# .NET OCR (optical character recognition) and barcode recognition SDK offers a high-performance API library for you to equip your C# .NET applications (Windows applications, Silverlight, ASP.NET web service applications, ActiveX controls, etc.) with the functionality of extracting text and barcode information from scanned documents.

You can convert images (in various formats like JPEG, PNG, TIFF, PDF, etc.) into editable document formats (Word, XML, searchable PDF, etc.). Alongside other offerings such as the Asprise Image Scanning SDK (which captures documents from scanners), you can easily implement full document management solutions.

The Features of Asprise OCR

Accurate Text Recognition
With enhanced image processing and text detection algorithms, Asprise OCR can easily recognize difficult documents with poor image quality. Parameters can be used to slightly favor accuracy over speed.

High-Speed OCR Engine
Asprise OCR uses an optimized OCR engine to perform excellent recognition within a short time frame. Speed can be further improved through multithreading and optional GPU acceleration.

20+ Languages Supported
Asprise OCR recognizes 20+ languages such as English, Spanish, French, German, Italian, Hungarian, Finnish, Swedish, Romanian, Polish, Malay, Arabic, Indonesian, and Russian.

All Popular Barcode Formats
All popular barcode formats are supported: EAN-8, EAN-13, UPC-A, UPC-E, ISBN-10, ISBN-13, Interleaved 2 of 5, Code 39, Code 128, PDF417, and QR Code.

Images to Searchable PDF
With a few lines of code, you can convert various formats of images such as JPEG, PNG, TIFF, and PDF into searchable PDF files.

Easy Deployment
No software protection dongle, no licensing server is required. Deployment of Asprise OCR SDK is as easy as you develop with it.

Budget-Friendly, Royalty-Free
Royalty-free means you pay when you order a development license, but you don't have to pay again when you deploy your software to thousands of servers or to thousands of end-users.

Award-Winning Support
Their team is not only friendly but also capable of providing you with first-class technical support.

1.2 IronOCR — 介紹和特性

IronOCR provides software for engineers who use IronOCR for .NET to read text content from photos and PDFs in .NET apps and websites. It scans photos for text and barcodes and supports numerous worldwide languages; 然後它可以以純文本或結構化數據的形式提供輸出。 Iron Software 的 OCR 庫可用於 MVC、Web、控制台和桌面 .NET 應用程序。 對於商業部署,提供許可證並可從開發團隊獲得直接支持。

  • 使用最新的 Tesseract 5 引擎,IronOCR 從任何圖片或 PDF 格式中讀取文本、條形碼和 QR 碼。 該庫能夠快速將 OCR 添加到桌面、控制台和 Web 應用程序。
  • IronOCR 支持 125 種國際語言。 它還支持自定義語言和字詞列表。
  • IronOCR 可以讀取超過 20 種條形碼格式和 QR 碼。
  • IronOCR supports multi-page GIFs and TIFF image formats.
  • IronOCR 提供低質量掃描圖像的校正。
  • IronOCR 支持多執行緒——它一次執行一個或多個進程。
  • IronOCR 可以提供頁面、段落、行、詞、字元等的結構化數據輸出。
  • IronOCR 支持多種操作系統,如 Windows、Linux、macOS 等。

2.0 Creating a New Project in Visual Studio

打開 Visual Studio 軟件,然後進入“文件選單”。 選擇“新建項目”,然後選擇“控制台應用程序”。

class="content-img-align-center">
class="center-image-wrapper"> Abbyy Finereader Ocr Alternatives 1 related to 2.0 Creating a New Project in Visual Studio

在相應的文本框中輸入項目名稱並選擇文件路徑。 然後,點擊創建按鈕並選擇所需的 .NET Framework,如下圖所示。

class="content-img-align-center">
class="center-image-wrapper"> Abbyy Finereader Ocr Alternatives 2 related to 2.0 Creating a New Project in Visual Studio

The Visual Studio project will now generate the structure for the selected application, and if you have selected the console, Windows, and web application, it will now open the Program.cs file where you can enter the code and build/run the application.

class="content-img-align-center">
class="center-image-wrapper"> Abbyy Finereader Ocr Alternatives 3 related to 2.0 Creating a New Project in Visual Studio

接下來,我們可以添加庫以測試代碼。

3.0 安裝

3.1 Install Asprise OCR

We can download the Asprise OCR here.

There are two options: install using NuGet or manually download the SDK from asprise.com.

Option 1: NuGet PM> Install-Package asprise-ocr-api

First, create a new Visual C#/Visual Basic Windows Form Application project or use an existing project. With this solution opened, open the NuGet Package Manager Console and type the following command:

Install-Package asprise-ocr-api

Once it is done, you can invoke the OCR demo Form by copying the following code to Program.cs (for C#):

using System;
using System.Windows.Forms;
using asprise_ocr_api;

static class Program
{
    // Main application entry point
    [STAThread]
    static void Main()
    {
        // Enable visual styles and set text rendering mode
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);

        // Launch the OCR sample form
        Application.Run(new asprise_ocr_api.OcrSampleForm());
    }
}
using System;
using System.Windows.Forms;
using asprise_ocr_api;

static class Program
{
    // Main application entry point
    [STAThread]
    static void Main()
    {
        // Enable visual styles and set text rendering mode
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);

        // Launch the OCR sample form
        Application.Run(new asprise_ocr_api.OcrSampleForm());
    }
}
Imports System
Imports System.Windows.Forms
Imports asprise_ocr_api

Friend Module Program
	' Main application entry point
	<STAThread>
	Sub Main()
		' Enable visual styles and set text rendering mode
		Application.EnableVisualStyles()
		Application.SetCompatibleTextRenderingDefault(False)

		' Launch the OCR sample form
		Application.Run(New asprise_ocr_api.OcrSampleForm())
	End Sub
End Module
$vbLabelText   $csharpLabel

Option 2: Download the OCR SDK from Asprise.com

Download a copy of the Asprise OCR SDK from www.asprise.com/product/ocr. Simply unzip it to an empty folder.

The file organization of Asprise OCR SDK distribution is as follows:

OCR SDK
|--- aocr.dll, aocr_x64.dll [required DLL]
|--- sample-projects        [.NET API and sample project]
+--- images                 [Sample images]

Navigate to the sample-projects folder and open the solution: ocr-samples-vs.sln. There are two projects:

  • asprise-ocr-api: the .NET OCR API
  • asprise-ocr-api-sample: demo program

Right-click on the asprise-ocr-api-sample project and “Set as StartUp Project”, then hit the ‘Start’ button or press F5 and you’ll see the same UI as shown.

3.2 安裝 IronOCR

IronOCR 庫可以通過四種方式下載和安裝。

它們是:

  • 使用 Visual Studio
  • 使用 Visual Studio 命令行
  • 從 NuGet 網站直接下載
  • 從 IronPDF 網站直接下載

3.2.1 使用 Visual Studio

Visual Studio 软件提供 NuGet 包管理器选项以将包直接安装到解决方案中。 以下截圖顯示如何打開 NuGet 包管理器。

class="content-img-align-center">
class="center-image-wrapper"> Abbyy Finereader Ocr Alternatives 6 related to 3.2.1 使用 Visual Studio

它提供了一個搜索框,可以顯示來自 NuGet 網站的軟件包列表。在程序包管理器中,我們需要搜索關鍵字 IronOCR,如下圖所示:

class="content-img-align-center">
class="center-image-wrapper"> Abbyy Finereader Ocr Alternatives 7 related to 3.2.1 使用 Visual Studio

從上圖中,我們可以得到相關搜索項的列表。 我們需要選擇所需的選項以將包安裝到解決方案。

3.2.2 使用 Visual Studio 命令行

在 Visual Studio 中,转到工具 -> NuGet 包管理器 -> 包管理器控制台

在程序包管理器控制台選項卡中輸入以下行:

Install-Package IronOcr

Next, the package will download/install in the current project and be ready to use.

3.2.3 從 NuGet 網站直接下載

第三種方法是直接從網站下載 NuGet 包。

  • Navigate to the Link.
  • 從右側菜單中選擇下載包選項。
  • 雙擊下載的包。 它將自動安裝。
  • 接下來,重新加載解決方案並開始在項目中使用它。

3.2.4 從 IronOCR 網站直接下載

Click the link here to download the latest package direct from the website. Once downloaded, follow the steps below to add the package to the project.

  • 右鍵單擊解決方案窗口中的項目。
  • 然後,選擇選項引用並瀏覽下載的引用位置。
  • 接下來單擊確定以添加引用。

4.0 OCR 圖像

Both IronOCR and Asprise OCR have an OCR technology that will convert images into text searching.

4.1 Using Asprise

The following code demonstrates the basic usage of Asprise OCR.

using System;
using asprise_ocr_api;

class Example
{
    static void Main()
    {
        // Set up OCR engine
        AspriseOCR.SetUp();
        AspriseOCR ocr = new AspriseOCR();
        ocr.StartEngine("eng", AspriseOCR.SPEED_FASTEST);

        // Recognize text from the given image
        string s = ocr.Recognize("C:\\path\\img.jpg", -1, -1, -1, -1, -1, 
            AspriseOCR.RECOGNIZE_TYPE_ALL, AspriseOCR.OUTPUT_FORMAT_PLAINTEXT);

        // Output the recognized text to the console
        Console.WriteLine("OCR Result: " + s);

        // Stop the OCR engine
        ocr.StopEngine();
    }
}
using System;
using asprise_ocr_api;

class Example
{
    static void Main()
    {
        // Set up OCR engine
        AspriseOCR.SetUp();
        AspriseOCR ocr = new AspriseOCR();
        ocr.StartEngine("eng", AspriseOCR.SPEED_FASTEST);

        // Recognize text from the given image
        string s = ocr.Recognize("C:\\path\\img.jpg", -1, -1, -1, -1, -1, 
            AspriseOCR.RECOGNIZE_TYPE_ALL, AspriseOCR.OUTPUT_FORMAT_PLAINTEXT);

        // Output the recognized text to the console
        Console.WriteLine("OCR Result: " + s);

        // Stop the OCR engine
        ocr.StopEngine();
    }
}
Imports System
Imports asprise_ocr_api

Friend Class Example
	Shared Sub Main()
		' Set up OCR engine
		AspriseOCR.SetUp()
		Dim ocr As New AspriseOCR()
		ocr.StartEngine("eng", AspriseOCR.SPEED_FASTEST)

		' Recognize text from the given image
		Dim s As String = ocr.Recognize("C:\path\img.jpg", -1, -1, -1, -1, -1, AspriseOCR.RECOGNIZE_TYPE_ALL, AspriseOCR.OUTPUT_FORMAT_PLAINTEXT)

		' Output the recognized text to the console
		Console.WriteLine("OCR Result: " & s)

		' Stop the OCR engine
		ocr.StopEngine()
	End Sub
End Class
$vbLabelText   $csharpLabel

Asprise OCR supports the following image formats: GIF, PNG, JPEG, TIFF, and PDF. For the sample OCR code in the above section, the input looks like the below:

Asprise Ocr Alternatives 6 related to 4.1 Using Asprise

The OCR output will be in Plain-Text Format:

Asprise OCR and Barcode Recognition

High performance, royalty-free OCR and barcode recognition on Windows,
...
ISBN-13, Interleaved 2 of 5, Code 39, Code 128, PDF417, and QR Code.

[[QR-Code: www.asprise.com]]
[[CODE-128: Asprise]].

The last two lines represent barcode information extract. Note: both the format and content of the barcode are enclosed in ‘[[ ]]’ pairs.

4.2 使用 IronOCR

using System;
using IronOcr;

class Example
{
    static void Main()
    {
        // Create an instance of IronTesseract
        var Ocr = new IronTesseract();
        Ocr.Language = OcrLanguage.EnglishBest;

        // Specify to use Tesseract 5 engine
        Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5;

        // Create OcrInput to hold the images
        using (var Input = new OcrInput())
        {
            // Add an image to the OcrInput
            Input.AddImage(@"3.png");

            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

            // Output the recognized text to the console
            Console.WriteLine(Result.Text);
            Console.ReadKey();
        }
    }
}
using System;
using IronOcr;

class Example
{
    static void Main()
    {
        // Create an instance of IronTesseract
        var Ocr = new IronTesseract();
        Ocr.Language = OcrLanguage.EnglishBest;

        // Specify to use Tesseract 5 engine
        Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5;

        // Create OcrInput to hold the images
        using (var Input = new OcrInput())
        {
            // Add an image to the OcrInput
            Input.AddImage(@"3.png");

            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

            // Output the recognized text to the console
            Console.WriteLine(Result.Text);
            Console.ReadKey();
        }
    }
}
Imports System
Imports IronOcr

Friend Class Example
	Shared Sub Main()
		' Create an instance of IronTesseract
		Dim Ocr = New IronTesseract()
		Ocr.Language = OcrLanguage.EnglishBest

		' Specify to use Tesseract 5 engine
		Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5

		' Create OcrInput to hold the images
		Using Input = New OcrInput()
			' Add an image to the OcrInput
			Input.AddImage("3.png")

			' Perform OCR on the input image
			Dim Result = Ocr.Read(Input)

			' Output the recognized text to the console
			Console.WriteLine(Result.Text)
			Console.ReadKey()
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

上面展示了 Tesseract 5 API,它允許我們將圖像文件轉換為文本。 We're making an object for Iron Tesseract in the above line of code. 我們還創建了一個OcrInput對象,這將允許我們添加一個或多個圖片文件。 當使用OcrInput對象方法添加時,我們可能需要在代碼中提供可用的圖片路徑。 可以添加任意多的圖像。 The function Read in the Object IronTesseract that we constructed before may be utilized to get the images by parsing the image file and extracting the result into the OCR result. 它能夠從照片中提取文本並將其轉換為字符串。

我們還可以使用 Tesseract 添加多幀圖像。 "AddMultiFrameTiff" is a different method for this operation. Tesseract 庫會讀取圖像中的每一幀,每幀被視為一個獨立的頁面。 該過程將閱讀圖片的第一幀,然後繼續下一幀,依此類推,直至所有的圖像幀都被掃描完畢。 此方法僅支持 TIFF 圖像格式。

Asprise Ocr Alternatives 7 related to 4.2 使用 IronOCR

The above image is the output of the IronOCR result, which has accurately converted the data into editable text.

5.0 OCR PDF 文件

IronOCR and Asprise OCR convert PDF files into editable text. Asprise OCR provides a list of options to the user such as save the page, edit the image, recognizing the page, etc. It also provides save options such as text, document, HTML format, etc. IronOCR also allows us to save the converted OCR file into HTML, text, PDF, etc.

5.1 Using Asprise OCR

If you set the output format as OUTPUT_FORMAT_PDF, you need to specify the target PDF output file as:

ocr.Recognize("C:\\test-image.png", -1, -1, -1, -1, -1,
  Ocr.RECOGNIZE_TYPE_ALL, Ocr.OUTPUT_FORMAT_PDF,
  "PROP_PDF_OUTPUT_FILE=ocr-result.pdf|PROP_PDF_OUTPUT_TEXT_VISIBLE=true");
ocr.Recognize("C:\\test-image.png", -1, -1, -1, -1, -1,
  Ocr.RECOGNIZE_TYPE_ALL, Ocr.OUTPUT_FORMAT_PDF,
  "PROP_PDF_OUTPUT_FILE=ocr-result.pdf|PROP_PDF_OUTPUT_TEXT_VISIBLE=true");
ocr.Recognize("C:\test-image.png", -1, -1, -1, -1, -1, Ocr.RECOGNIZE_TYPE_ALL, Ocr.OUTPUT_FORMAT_PDF, "PROP_PDF_OUTPUT_FILE=ocr-result.pdf|PROP_PDF_OUTPUT_TEXT_VISIBLE=true")
$vbLabelText   $csharpLabel

In the above code, properties are specified in a single string separated by | (with key and value separated by =). Alternatively, you may specify properties separately in pairs:

ocr.Recognize("C:\\test-image.png", -1, -1, -1, -1, -1,
  Ocr.RECOGNIZE_TYPE_ALL, Ocr.OUTPUT_FORMAT_PDF,
  AspriseOCR.PROP_PDF_OUTPUT_FILE, "ocr-result.pdf",
  AspriseOCR.PROP_PDF_OUTPUT_TEXT_VISIBLE, true);
ocr.Recognize("C:\\test-image.png", -1, -1, -1, -1, -1,
  Ocr.RECOGNIZE_TYPE_ALL, Ocr.OUTPUT_FORMAT_PDF,
  AspriseOCR.PROP_PDF_OUTPUT_FILE, "ocr-result.pdf",
  AspriseOCR.PROP_PDF_OUTPUT_TEXT_VISIBLE, true);
ocr.Recognize("C:\test-image.png", -1, -1, -1, -1, -1, Ocr.RECOGNIZE_TYPE_ALL, Ocr.OUTPUT_FORMAT_PDF, AspriseOCR.PROP_PDF_OUTPUT_FILE, "ocr-result.pdf", AspriseOCR.PROP_PDF_OUTPUT_TEXT_VISIBLE, True)
$vbLabelText   $csharpLabel

To make the text invisible or transparent, you simply set PROP_PDF_OUTPUT_TEXT_VISIBLE to "false". Both normal PDF and PDF/A are supported. Please refer to Asprise OCR Property Summary. Set the output format as OUTPUT_FORMAT_RTF. You can then output .rtf files that can be edited in most word processors (Microsoft Word, Libre Office, TextEdit, etc.).

ocr.Recognize("C:\\test-image.png", -1, -1, -1, -1, -1,
  Ocr.RECOGNIZE_TYPE_ALL, Ocr.OUTPUT_FORMAT_RTF,
  "PROP_RTF_OUTPUT_FILE=ocr-result.rtf");
ocr.Recognize("C:\\test-image.png", -1, -1, -1, -1, -1,
  Ocr.RECOGNIZE_TYPE_ALL, Ocr.OUTPUT_FORMAT_RTF,
  "PROP_RTF_OUTPUT_FILE=ocr-result.rtf");
ocr.Recognize("C:\test-image.png", -1, -1, -1, -1, -1, Ocr.RECOGNIZE_TYPE_ALL, Ocr.OUTPUT_FORMAT_RTF, "PROP_RTF_OUTPUT_FILE=ocr-result.rtf")
$vbLabelText   $csharpLabel

Once the OCR is done, you can view or edit the RTF file with a word processor:

Asprise Ocr Alternatives 8 related to 5.1 Using Asprise OCR

You use the following method to perform OCR on a PDF input file:

Asprise Ocr Alternatives 9 related to 5.1 Using Asprise OCR

5.2 使用 IronOCR

我們也可以使用 OCRInput 來管理 PDF 文件。 Every page of documents will be read by the Iron Tesseract class. 然後會從頁面提取文本。 We may also open protected documents using a second function called AddPdf, which allows us to add PDFs to our list of documents (password if it is protected). 以下代碼展示了如何打開密碼保護的 PDF 文檔:

using IronOcr;

var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
    // Add a password protected PDF
    Input.AddPdf("example.pdf", "password");

    // Read the PDF document
    var Result = Ocr.Read(Input);

    // Output the recognized text to the console
    Console.WriteLine(Result.Text);
}
using IronOcr;

var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
    // Add a password protected PDF
    Input.AddPdf("example.pdf", "password");

    // Read the PDF document
    var Result = Ocr.Read(Input);

    // Output the recognized text to the console
    Console.WriteLine(Result.Text);
}
Imports IronOcr

Private Ocr = New IronTesseract()
Using Input = New OcrInput()
	' Add a password protected PDF
	Input.AddPdf("example.pdf", "password")

	' Read the PDF document
	Dim Result = Ocr.Read(Input)

	' Output the recognized text to the console
	Console.WriteLine(Result.Text)
End Using
$vbLabelText   $csharpLabel

We can read and extract content from a single page in a PDF document using AddpdfPage. Only the page number from which we want to extract the text needs to be specified. AddPdfPage允許我們從我們指定的多個頁面中提取文本。 在IEnumerable<int>中,我們可以輕鬆指定多個頁面。 我們還必須包括文件位置以及文件的擴展名。這在以下代碼示例中演示:

using IronOcr;
using System.Collections.Generic;

IEnumerable<int> numbers = new List<int> {2, 8, 10};
var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
    // Extract single page
    Input.AddPdfPage("example.pdf", 10);

    // Extract multiple pages
    Input.AddPdfPages("example.pdf", numbers);

    // Read the pages and extract content
    var Result = Ocr.Read(Input);

    // Output the recognized text and save to a text file
    Console.WriteLine(Result.Text);
    Result.SaveAsTextFile("ocrtext.txt");
}
using IronOcr;
using System.Collections.Generic;

IEnumerable<int> numbers = new List<int> {2, 8, 10};
var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
    // Extract single page
    Input.AddPdfPage("example.pdf", 10);

    // Extract multiple pages
    Input.AddPdfPages("example.pdf", numbers);

    // Read the pages and extract content
    var Result = Ocr.Read(Input);

    // Output the recognized text and save to a text file
    Console.WriteLine(Result.Text);
    Result.SaveAsTextFile("ocrtext.txt");
}
Imports IronOcr
Imports System.Collections.Generic

Private numbers As IEnumerable(Of Integer) = New List(Of Integer) From {2, 8, 10}
Private Ocr = New IronTesseract()
Using Input = New OcrInput()
	' Extract single page
	Input.AddPdfPage("example.pdf", 10)

	' Extract multiple pages
	Input.AddPdfPages("example.pdf", numbers)

	' Read the pages and extract content
	Dim Result = Ocr.Read(Input)

	' Output the recognized text and save to a text file
	Console.WriteLine(Result.Text)
	Result.SaveAsTextFile("ocrtext.txt")
End Using
$vbLabelText   $csharpLabel

使用SaveAsTextFile功能,我們可以將結果存儲為文本文件,這允許我們將文件下載到輸出目錄路徑。 此外,我們還可以使用SaveAsHocrFile將文件保存為 HTML 文件。

6.0 其他功能

6.1 Using Asprise OCR

Asprise OCR has some additional options such as Draw Text Area, Draw Picture Area, Draw Table Area, Draw Recognize Area, etc. These all help the user to improve the performance of the OCR. Not only does the application perform OCR, but we are also able to do operations such as combine PDFs, split PDFs, edit PDFs, etc.

6.2 使用 IronOCR

IronOCR 具有獨特的功能,使我們能夠從掃描文檔中讀取條形碼和 QR 碼。 The below codes show how we can read a barcode from a given image or document.

using IronOcr;

var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.EnglishBest;
Ocr.Configuration.ReadBarCodes = true;
Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5;
using (var Input = new OcrInput())
{
    // Add an image containing a barcode
    Input.AddImage("barcode.gif");

    // Read the image to recognize text and barcodes
    var Result = Ocr.Read(Input);

    // Loop through barcodes and output the value
    foreach (var Barcode in Result.Barcodes)
    {
        Console.WriteLine(Barcode.Value);
    }
}
using IronOcr;

var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.EnglishBest;
Ocr.Configuration.ReadBarCodes = true;
Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5;
using (var Input = new OcrInput())
{
    // Add an image containing a barcode
    Input.AddImage("barcode.gif");

    // Read the image to recognize text and barcodes
    var Result = Ocr.Read(Input);

    // Loop through barcodes and output the value
    foreach (var Barcode in Result.Barcodes)
    {
        Console.WriteLine(Barcode.Value);
    }
}
Imports IronOcr

Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.EnglishBest
Ocr.Configuration.ReadBarCodes = True
Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5
Using Input = New OcrInput()
	' Add an image containing a barcode
	Input.AddImage("barcode.gif")

	' Read the image to recognize text and barcodes
	Dim Result = Ocr.Read(Input)

	' Loop through barcodes and output the value
	For Each Barcode In Result.Barcodes
		Console.WriteLine(Barcode.Value)
	Next Barcode
End Using
$vbLabelText   $csharpLabel

上面是有助於從給定圖像或 PDF 文件中讀取條形碼的代碼。 It can read more than one barcode from a page/image. To read a barcode, IronOCR has a unique setting, Ocr.Configuration.ReadBarCodes, which helps to read a barcode. 默認值設置為 false。

讀取輸入後,數據將被保存到名為OCRResult的對象中。 This has a property called Barcodes, and it will have all the available barcode data in a list. By using the for-each loop, we can get all the barcode details one by one. 此外,還將掃描條形碼並讀取條形碼的值 - 在一個過程中完成兩個操作。

It will also support threading options. 我們可以同時執行多個 OCR 過程。IronOCR 還能夠識別指定區域中的特定區域。

using IronOcr;
using System.Drawing;

var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
    // Define the area to recognize text
    var ContentArea = new Rectangle() { X = 215, Y = 1250, Height = 280, Width = 1335 };

    // Add the document with the specified content area
    Input.Add("document.png", ContentArea);

    // Perform OCR on the specified region
    var Result = Ocr.Read(Input);

    // Output the recognized text to the console
    Console.WriteLine(Result.Text);
} 
using IronOcr;
using System.Drawing;

var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
    // Define the area to recognize text
    var ContentArea = new Rectangle() { X = 215, Y = 1250, Height = 280, Width = 1335 };

    // Add the document with the specified content area
    Input.Add("document.png", ContentArea);

    // Perform OCR on the specified region
    var Result = Ocr.Read(Input);

    // Output the recognized text to the console
    Console.WriteLine(Result.Text);
} 
Imports IronOcr
Imports System.Drawing

Private Ocr = New IronTesseract()
Using Input = New OcrInput()
	' Define the area to recognize text
	Dim ContentArea = New Rectangle() With {
		.X = 215,
		.Y = 1250,
		.Height = 280,
		.Width = 1335
	}

	' Add the document with the specified content area
	Input.Add("document.png", ContentArea)

	' Perform OCR on the specified region
	Dim Result = Ocr.Read(Input)

	' Output the recognized text to the console
	Console.WriteLine(Result.Text)
End Using
$vbLabelText   $csharpLabel

上面是針對特定區域執行 OCR 的範例代碼。 We only need to specify the rectangle region in the image or PDF. IronOCR 中的 Tesseract 引擎幫助我們識別文本。

7.0 IronOCR and Asprise OCR License Models and Pricing

IronOCR License Models and Prices

A 30-day money-back guarantee: when the license is purchased you will get 30 days of money back if the license does not work.

Easy integration: the integration of IronOCR with a project and environment is so easy that we can do it by just writing a single line of code and adding it from NuGet Package. 或者,我們可以從網上下載並以這種方式與我們的環境集成。

Perpetual Licensing: each license is purchased once and does not require renewal.

Free Support and Product Updates: every license comes with a year of free product updates and support from the team behind the product. 可以随时购买扩展。 可以查看扩展。

Immediate Licenses: registered license keys are sent out as soon as payment is received.

所有许可证为永久许可证,并适用于开发、测试和生产环境。

The Lite License:

  • 1 個地點
  • 1 個項目
  • 永久許可 此包允許單個軟件開發人員在單個地點中使用 Iron Software。

This package allows a single software developer in an organization to utilize Iron Software in a single place. Iron Software 可用于一个网络应用程序、内部网应用程序或桌面软件。 Licenses are non-transferable, and they cannot be shared outside of an organization or an agency/client relationship. This license type, like all other license types, expressly excludes all rights not expressly granted under the Agreement, without OEM redistribution and utilizing the Iron Software as a SaaS without purchasing additional coverage.

Pricing: Starts from $799 per year.

The Professional License:

  • 10 個地點
  • 10 個項目 這個包允許最多十個軟件開發人員在單個地點中使用 Iron Software,最多十個地點。 此包允許單個軟件開發人員在單個地點中使用 Iron Software。

This package allows a predetermined number of software developers in an organization to utilize Iron Software in single locations, up to a maximum of ten. Iron Software 可以用于任意数量的网站、内部网应用程序或桌面软件应用程序。许可证不可转让,不能在组织外或代理/客户关系中共享。此许可证类型(如所有其他许可类型)明确排除协议中未明确授予的所有权利,包括 OEM 再分发,以及在未购买额外保障的情况下利用 Iron Software 作为 SaaS。 该许可证可与一个项目集成 ,最多可达 10 个。

Pricing: Starts from $999 per year.

The Unlimited License:

  • 無限地點
  • 無限項目 這允許組織中的無限軟件開發人員在無限地點中使用 Iron Software。 此包允許單個軟件開發人員在單個地點中使用 Iron Software。

这允许一个组织中的无限数量的软件开发人员可以在无限量的位置使用 Iron Software。 Iron Software 可以用于任意数量的网站、内部网应用程序或桌面软件应用程序。许可证不可转让,不能在组织外或代理/客户关系中共享。此许可证类型(如所有其他许可类型)明确排除协议中未明确授予的所有权利,包括 OEM 再分发,以及在未购买额外保障的情况下利用 Iron Software 作为 SaaS。

Pricing: Starts from $2,999 per year.

免版税再分发:这允许您为多个不同的软件产品包分发 Iron Software (不需支付版税),此需根据基础许可证所涵盖的项目数量。 它允许在 SaaS 软件服务中部署 Iron Software,根据基础许可证所涵盖的项目数量。

Pricing: Starts from $1,599 per year.

Asprise Ocr Alternatives 10 related to IronOCR License Models and Prices

Asprise OCR License Models and Pricing

The Lite License:

  • Unlimited end-users
  • Recognize text
  • Read 1D barcodes: UPC, EAN, Code39, Code128
  • Text, XML, and PDF output
  • Easy deployment
  • Support 2 OS only
  • Seats 1
  • Support: No

Pricing: Starts from $7998 per year.

The Standard License:

  • Unlimited end-users
  • BMP, GIF, PNG, JPEG, TIFF, and PDF input.
  • Recognize text
  • Read 1D barcodes: UPC, EAN, Code39, Code128
  • Read some 2D: QR and Data Matrix only
  • Text, XML, and PDF output
  • Easy deployment
  • Support: No

Pricing: Starts from $7,998 per year.

The Enterprise License:

  • Unlimited end-users
  • BMP, GIF, PNG, JPEG, TIFF, and PDF input.
  • Recognize text
  • Read 1D barcodes: UPC, EAN, Code39, Code128
  • 2D: QR, PDF 417, Data Matrix & Aztec
  • Text, XML, and PDF output
  • Easy deployment
  • Multi-threading, multi-processing

Pricing: Starts from $12,998.

Asprise Ocr Alternatives 11 related to Asprise OCR License Models and Pricing

The IronOCR Lite including a one-developer package with one year of support costs around $799, while Asprise Lite including a one-developer package costs $7998 without technical support, and $6,296 with paid technical support. The IronOCR Professional license including a 10-developer package with one year of technical support costs $999, while the equivalent Asprise license including a 10-developer package costs $37,998 per year without technical support, but with paid technical releases and updates, plus support for one year, costs $46,999.00.

IronOCR 精簡版專業版本有SaaS服務或OEM及5年支持選項。 The Lite version, including one developer package with 5-year support and SaaS and OEM service, costs $2897USD, while Asprise has a SaaS or OEM service and a customized support option. The IronOCR Professional version includes a 10-developer package with one year of paid support and SaaS and OEM service costs $3397, while the Asprise version with a 10-developer package without 1-year support and with SaaS and OEM service costs $59,996.

8.0 Conclusion

IronOCR in the .NET Framework context provides Tesseract that is straightforward and easy to use. 它能以多種方式支持照片和 PDF 文檔。 它還提供多種設置來提高 Tesseract OCR 庫的性能。 支持多種語言,並且在一次操作中支持多種語言。 訪問他們的網站以了解有關 Tesseract OCR 的更多信息。

Asprise is a software application that uses an artificial intelligence engine to recognize images and PDF documents. 它還提供各種設置來提高 OCR 過程的性能。 此外,它提供選擇多種語言的選項。 Asprise does have some limitations on the usage of page conversions. 它還有不同的價格,適用於不同的操作系統。

IronOCR packages provide better licensing and support compared to Asprise. Asprise OCR has customized and fixed packages that are more expensive. IronOCR starts from $799, while Asprise OCR starts from $7994 per year, so our product is more cost-effective while also providing more features than Aspire. It also supports multiple platforms at a single price.

你还在等什么? 免费试用对所有人开放。 You can obtain the License here and begin straightaway.

請注意Aspose 是其註冊擁有者的註冊商標。本網站與 Aspose 沒有任何聯繫、認可或贊助。所有產品名稱、徽標和品牌均為其各自擁有者的財產。比較僅供資訊參考,並反映寫作時公眾可獲取的信息。
此網站與 Aspose 無關,未被批准或贊助。 所有產品名稱、徽標和品牌均為其各自所有者的財產。 比較僅供參考,反映撰寫時公開可用的信息。

常見問題解答

什麼是光學字符識別?

光學字符識別 (OCR) 是一種技術,用於將不同類型的文件,如掃描的紙質文件、PDF 或數位相機拍攝的圖像,轉換為可編輯和可搜索的數據。像 IronOCR 這樣的工具用來通過將文本的圖像轉換為實際的文本數據來執行 OCR。

如何使用 C# 將圖像轉換為文本?

IronOCR 提供了一個強大的解決方案,能夠在 C# 中將圖像轉換為文本。您可以使用其強大的 OCR 功能來處理圖像文件並提取文本,即使是從低質量的圖像中,使用 Tesseract 5 引擎。

IronOCR 支援哪些格式進行 OCR 操作?

IronOCR 支援多種格式進行 OCR 操作,包括 JPEG、PNG、GIF、BMP、TIFF 和 PDF。它還可以處理多頁文件和受密碼保護的 PDF。

如何在我的 C# 專案中安裝 IronOCR?

您可以使用 Visual Studio 中的 NuGet 套件管理器安裝 IronOCR 到您的 C# 專案中。或者,您可以使用命令行 Install-Package IronOCR 來安裝,或者直接從 IronOCR 官網下載。

使用 IronOCR 優於其他 OCR 庫的好處是什麼?

IronOCR 提供廣泛的語言支持,對低品質圖像具有優異的性能,以及條碼和 QR 碼識別等功能。它提供具有成本效益的授權,並在單一價格下支持多個平台,使其成為開發人員的多功能選擇。

IronOCR 能夠處理多頁文件嗎?

是的,IronOCR 能夠處理多頁文件,包括 TIFF 和 PDF,並有效地從每頁提取文本。這對於處理大型文件或批量處理特別有用。

IronOCR 提供哪些授權選項?

IronOCR 提供靈活的永久授權選項,包括 Lite、Professional 和 Unlimited 授權。這些授權是免版稅的,並支持 SaaS 和 OEM 服務,使其適用於多種部署場景。

IronOCR 如何處理低品質圖像的文本提取?

IronOCR 通過使用先進的預處理技術在進行 OCR 之前增強圖像質量來擅長從低質量的圖像中提取文本。這顯著提高了文本識別的準確性。

Kannaopat Udonpant
軟體工程師
在成為软件工程師之前,Kannapat 從日本北海道大學完成了環境資源博士學位。在追逐學位期间,Kannapat 還成為了生產工程系一部份——汽車机器人实验室的成員。2022 年,他利用他的 C# 技能加入 Iron Software 的工程團隊, 專注於 IronPDF。Kannapat 珍惜他的工作,因为他直接向编写大部分 IronPDF 使用的代码的开发者学习。除了同行学习,Kannapat 还喜欢在 Iron Software 工作的社交十环。当他不编写代码或文档时,Kannapat 通常在他的 PS5 上打游戏或重看《The Last of Us》。