跳至頁尾內容
與其他組件的比較

IronOCR与Asprise OCR的比较

當我們談論OCR時,它指的是光學字元識別。 該術語在商業世界中經常用來指透過電腦軟體將任何基於文字的文件(例如,掃描或傳真頁面)的圖像或圖形表示轉換為可編輯的文字格式或可搜尋的文件格式的過程。

OCR是一個縮寫,代表光學字元識別,是由專門設計為此目的的電腦軟體執行的任務。 此類軟體將掃描頁面並識別其中的任何文字資訊,將其轉換為數位形式,以便可以在沒有質量損失的情況下進行編輯和數字化再製。

OCR有許多應用,但最流行的用例是將掃描的文件轉換為可以在資料庫中格式化和索引且可以分析的數字檔案。

在本文中,我們將比較兩個最常見的OCR和PDF文件圖像的程式庫和應用程式。 這些是:

  • Asprise OCR
  • IronOCR

1.0 介紹

1.1 Asprise OCR 介紹和功能

Asprise C# .NET OCR(光學字元識別)和條碼識別 SDK 提供一個高效能的 API 程式庫,讓您能夠為您的 C# .NET 應用(Windows 應用、Silverlight、ASP.NET Web 服務應用、ActiveX 控制等)提供從掃描的文件中提取文字和條碼資訊的功能。

您可以將圖像(如 JPEG、PNG、TIFF、PDF等多種格式)轉換為可編輯的文件格式(如 Word、XML、可搜尋的 PDF等)。 除了其他產品如 Asprise 圖像掃描 SDK(從掃描器捕獲文件外),您可以輕鬆實現完整的文件管理解決方案。

Asprise OCR 的功能

準確的文字識別 借助增強的圖像處理和文字檢測算法,Asprise OCR 可以輕鬆識別圖像質量差的困難文件。 可以藉由參數稍微偏向精確性而非速度。

高速OCR引擎 Asprise OCR 使用優化的OCR引擎在短時間內執行出色的識別。 速度可以透過多執行緒和可選的GPU加速進一步提高。

支援20多種語言 Asprise OCR 識別20多種語言,如英語、西班牙文、法國、德國文、義大利文、匈牙利文、芬蘭文、瑞典文、羅馬尼亞文、波蘭文、馬來文、阿拉伯文、印尼文和俄文。

所有流行的條碼格式 支援所有流行的條碼格式:EAN-8、EAN-13、UPC-A、UPC-E、ISBN-10、ISBN-13、Interleaved 2 of 5、Code 39、Code 128、PDF417 和 QR Code。

圖像轉可搜尋的PDF 只需幾行程式碼,您就可以將 JPEG、PNG、TIFF 和 PDF 等多種格式的圖像轉換為可搜尋的 PDF 文件。

易於部署 不需要軟體保護加密狗,無需授權伺服器。 Asprise OCR SDK 的部署同開發一樣簡單。

經濟實惠,免版稅 免版稅意味著您在訂購開發授權時需要支付費用,但當您將軟體部署到數千台伺服器或數千名終端使用者時,則不必再次付費。

屢獲殊榮的支援 他們的團隊不僅友善,而且能夠為您提供一流的技術支援。

1.2 IronOCR — 簡介與功能

IronOCR 為使用 IronOCR for .NET 的工程師提供軟體,以便在 .NET 應用和網站中從照片和 PDFs 中讀取文字內容。 它掃描照片中的文字和條碼,且支援多國語言。 然後可以將輸出以純文字或結構化資料的形式提供。 Iron Software的OCR程式庫可以在MVC、Web、控制台和桌面.NET應用程式中使用。 在商業部署中,授權是直接由開發團隊提供的協助。

  • 使用最新的Tesseract 5引擎,IronOCR可以從任何圖片或PDF格式中讀取文字、條碼和QR碼。 此程式庫快速地將OCR功能新增到桌面、控制台和網路應用程式。
  • IronOCR支持125種國際語言。 它還支持自定義語言和詞匯表。
  • IronOCR能夠讀取超過20種條碼格式和QR碼。
  • IronOCR 支援多頁 GIF 和 TIFF 圖像格式。
  • IronOCR提供低質量掃描圖像的校正功能。
  • IronOCR支持多執行緒——它可以同時執行一個或多個進程。
  • IronOCR可以為頁面、段落、行、單詞、字元等提供結構化資料輸出。
  • IronOCR支持多種操作系統,如Windows、Linux、macOS等。

2.0 在 Visual Studio 中建立新專案

打開Visual Studio軟體,進入"文件選單"。 選擇"新建專案",然後選擇"控制台應用程式"。

Abbyy Finereader Ocr Alternatives 1 related to 2.0 在 Visual Studio 中建立新專案

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

Abbyy Finereader Ocr Alternatives 2 related to 2.0 在 Visual Studio 中建立新專案

Visual Studio 專案將為所選應用程式生成結構,如果您選擇了主控台、Windows 和 Web 應用,現在將打開 Program.cs 檔案,在此您可以輸入程式碼並構建/運行應用程式。

Abbyy Finereader Ocr Alternatives 3 related to 2.0 在 Visual Studio 中建立新專案

接下來,我們可以新增程式庫以測試程式碼。

3.0 安裝

3.1 安裝 Asprise OCR

我們可以從 這裡下載 Asprise OCR。

有兩種選擇:使用 NuGet 安裝或從 asprise.com 手動下載 SDK。

選項1:NuGet PM> Install-Package asprise-ocr-api

首先,建立一個新的 Visual C#/Visual Basic Windows Form Application 專案,或者使用現有專案。 在打開此解決方案後,打開NuGet Package Manager Console,並輸入以下命令:

Install-Package asprise-ocr-api

完成後,您可以通過將以下程式碼複製到 Program.cs(對於 C#)來調用 OCR 範例表單。

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

選項2:從 Asprise.com 下載 OCR SDK

www.asprise.com/product/ocr 下載一份 Asprise OCR SDK。 直接將其解壓縮到一個空文件夾中。

Asprise OCR SDK 分發的文件組織如下:

OCR SDK
|--- aocr.dll, aocr_x64.dll [所需的 DLL]
|--- sample-projects [。.NET API 和示例專案]
+--- images [示例圖片]

導航到 sample-projects 文件夾並打開解決方案:ocr-samples-vs.sln。 有兩個專案:

  • asprise-ocr-api: the .NET OCR API
  • asprise-ocr-api-sample: 範例程式

右鍵點擊 asprise-ocr-api-sample 專案並"設為啟動專案",然後點擊"開始"按鈕或按 F5,您將看到相同的 UI 如所示。

3.2 安裝IronOCR

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

這些是:

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

3.2.1 使用Visual Studio

Visual Studio軟體提供NuGet Package Manager選項,允許將套件直接安裝到解決方案中。 下圖顯示如何打開NuGet Package Manager。

Abbyy Finereader Ocr Alternatives 6 related to 3.2.1 使用Visual Studio

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

Abbyy Finereader Ocr Alternatives 7 related to 3.2.1 使用Visual Studio

在上圖中,我們將獲得相關搜索項目的列表。 我們需要選擇所需的選項以將套件安裝到解決方案中。

3.2.2 使用Visual Studio命令行

在Visual Studio中,前往工具 -> NuGet Package Manager -> Package Manager Console

在Package Manager Console選項卡中輸入以下行:

Install-Package IronOcr

接下來,包將在當前專案中下載/安裝,並且可以使用。

3.2.3 從NuGet網站直接下載

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

  • 導航到 連結
  • 從右側選單中選擇下載套件選項。
  • 雙擊下載的套件。 它將自動安裝。
  • 然後重新載入解決方案並在專案中開始使用它。

3.2.4 從IronOCR網站直接下載

點擊此處下載最新套件,直接從網站下載。下載完成後,按照以下步驟將套件新增到專案中。

  • 右鍵單擊解決方案窗口中的專案。
  • 然後,選擇參考選項並瀏覽下載參考的位置。
  • 接下來,點擊確定以新增引用。

4.0 OCR影像

IronOCR和Asprise OCR都擁有將圖像轉換為文字搜尋的OCR技術。

4.1 使用 Asprise

以下程式碼展示了 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 支援以下圖像格式:GIF, PNG, JPEG, TIFF 和 PDF。 在上述部分的範例 OCR 程式碼中,輸入如下面所示:

Asprise Ocr Alternatives 6 related to 4.1 使用 Asprise

OCR 輸出將為純文字格式:

Asprise OCR 和條碼識別

高效能,免版稅的 OCR 和條碼識別在 Windows 上,
...
ISBN-13,Interleaved 2 of 5,Code 39,Code 128,PDF417 和 QR Code。

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

最後兩行表示提取的條碼資訊。 注意:條碼的格式和內容都包裹在'[[ ]]'對中。

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允許我們將圖像文件轉換為文字,如上所示。 我們在上述程式碼行中為 Iron Tesseract 建立了一個物件。 我們還建立了一個 OcrInput 物件,允許我們新增一個或多個圖像文件。 當使用 OcrInput 物件方法新增時,我們可能需要在程式碼中提供可用的圖像路徑。 可以新增任意數量的圖像。 在我們先前構建的物件 IronTesseract 中的 Read 函式可用於通過解析圖像文件獲取圖像並將結果提取到 OCR 結果中。 它可以從照片中提取文字並將其轉換為字串。

我們還可以使用Tesseract新增多幀圖像。 "AddMultiFrameTiff"是一種不同的操作方法。 Tesseract程式庫讀取圖像中的每幀,並將每幀視作為獨立的頁面。 該過程將讀取影像的第一個幀,然後進入下一個幀,如此直到所有影像的幀都已被掃描。 此方法僅支援TIFF影像格式。

Asprise Ocr Alternatives 7 related to 4.2 使用IronOCR

上圖是 IronOCR 結果的輸出,其正確地將資料轉換為可編輯的文字。

5.0 OCR PDF檔案

IronOCR 和 Asprise OCR 將 PDF 文件轉換為可編輯的文字。 Asprise OCR 為使用者提供了多種選擇,例如保存頁面、編輯圖像、識別頁面等。此外,它還提供保存選項,如文字、文件、HTML 格式等。IronOCR 也允許我們將轉換的 OCR 檔儲存為 HTML、文字、PDF 等多種格式。

5.1 使用 Asprise OCR

如果您將輸出格式設置為 OUTPUT_FORMAT_PDF,您需要指定目標 PDF輸出文件為:

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

在上述程式碼中,屬性是在單一字串中指定的,並由 |(用鍵和值的形式由 = 分隔)。 或者,您可以將屬性分別指定為成對出現:

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

若要隱藏或透明顯示文字,只需設置 PROP_PDF_OUTPUT_TEXT_VISIBLE 為 "false"。 支援普通 PDF 和 PDF/A。 請參閱 Asprise OCR 屬性摘要。 將輸出格式設置為 OUTPUT_FORMAT_RTF。 然後您可以輸出 .rtf 文件,這些文件可以在大多數文字處理器上編輯(Microsoft Word、Libre Office、TextEdit等)。

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

一旦 OCR 完成,您可以使用文字處理器查看或編輯 RTF 文件:

Asprise Ocr Alternatives 8 related to 5.1 使用 Asprise OCR

您可以使用以下方法來對 PDF 輸入文件進行光學字元識別:

Asprise Ocr Alternatives 9 related to 5.1 使用 Asprise OCR

5.2 使用IronOCR

我們還可以使用OCRInput來管理PDF文件。 每頁文件都將由 Iron Tesseract 類讀取。 然後從頁面中提取文字。 我們也可以使用稱為 AddPdf 的第二個功能來打開受保護的文件,這允許我們將 PDF 新增到我們的文件列表中(如果受保護,則輸入密碼)。 以下程式碼演示如何打開受密碼保護的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

我們可以使用 AddpdfPage 從 PDF 文件中的單個頁面中讀取和提取內容。 我們只需要指定我們想要提取文字的頁碼。 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

using SaveAsTextFile 函式,我們可以將結果保存為文字文件,這樣我們就可以將文件下載到輸出目錄路徑。 此外,我們還可以使用 SaveAsHocrFile將此文件保存為HTML文件。

6.0 其他功能

6.1 使用 Asprise OCR

Asprise OCR有一些附加選項,如繪製文字區域、繪製圖像區域、繪製表格區域、繪製識別區域等。這些都有助於使用者提高OCR的性能。 該應用程式不僅執行OCR操作,我們還可以進行合併PDF、拆分PDF、編輯PDF等操作。

6.2 使用IronOCR

IronOCR具有獨特的功能,允許我們從掃描的文件中讀取條碼和QR碼。 以下程式碼顯示了如何從給定的圖像或文件中讀取條碼。

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文件中讀取條碼的程式碼。 它可以從一頁/一個圖像中讀取多個條碼。 為了讀取條碼,IronOCR有一個獨特的設定,Ocr.Configuration.ReadBarCodes,用於幫助讀取條碼。 預設值設置為false。

讀取輸入後,資料將保存到稱為 OCRResult 的物件中。 這有一個被成為條碼的屬性,並將所有可用的條碼資料以列表形式包含。通過使用 for-each 環,來一個一個獲得所有條碼詳細資訊。 此外,它將掃描條碼並讀取條碼的值——一個過程中完成兩個操作。

它還支援執行緒選項。 我們可以一次執行多個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的範例程式碼。 我們只需在圖像或 PDF 中指定矩形區域。 IronOCR中的Tesseract引擎幫助我們識別文字。

7.0 IronOCR 和 Asprise OCR 的授權模式和定價

IronOCR 授權模式和價格

30天退款保證: 當您購買授權後,如果授權無效,您將獲得30天的退款。

便於整合: IronOCR 與專案及環境的整合非常簡單,我們只需寫一行程式碼並從 NuGet Package 加入即可完成。 或者,我們可以從網上下載並通過這種方式整合到我們的環境中。

永久授權: 每個授權購買一次,無需續約。

免費支援及產品更新:每個授權都附帶一年免费的產品更新和來自產品團隊的支援。 可以隨時購買擴展。 可以查看擴展。

即時授權: 一接收付款就發送註冊的授權金鑰。

所有授權都是永久性的,並適用於開發、測試和生產。

Lite 授權:

  • 1 名開發者
  • 1 個地點
  • 1 個專案
  • 永久授權

此軟體包允許組織中的單一軟體開發者在單一地方使用 Iron Software。 Iron Software 可以用於單一 Web 應用程式、內部網應用程式或桌面軟體程式。 授權是不可轉讓的,並且不能在組織之外或代理/客戶關係之外共享。此授權型別,像所有其他授權型別一樣,明確排除在協議下未明示授予的所有權利,不包括 OEM 重新分發,且在未購買額外保護下,不得利用 Iron Software 作為 SaaS。

價格: 從 $999 每年開始。

Professional 授權:

  • 10 名開發者
  • 10 個地點
  • 10 個專案
  • 永久授權

此軟體包允許組織中的預定數量的軟體開發者在單個位置使用 Iron Software,最多十個。 Iron Software 可以用於任多個網站、內部網應用程式或桌面軟體應用程為數多次使用。授權是不可轉讓的,且不能在組織或代理/客戶關係外共享。此授權型別,與所有其他授權型別一樣,明確排除協議下的所有未經明示授予的權利,包括 OEM 重新分發,和在未購買額外保護下使用 Iron Software 作為 SaaS。 此授權可整合至最多十個專案中。

價格: 每年從 $999 起。

Unlimited 授權:

  • 不限開發者
  • 不限地點
  • 不限專案
  • 永久授權

這種方式允許組織中的無數開發者在無數地點使用 Iron Software。 Iron Software 可以用於任多個網站、內部網應用程式或桌面軟體應用程為數多次使用。授權是不可轉讓的,且不能在組織或代理/客戶關係外共享。此授權型別,與所有其他授權型別一樣,明確排除協議下的所有未經明示授予的權利,包括 OEM 重新分發,和在未購買額外保護下使用 Iron Software 作為 SaaS。

價格: 每年從 $2,999 起。

免版稅再分發: 這允許您將 Iron Software作為一系列不同包裝的商業產品的一部分分發(無需支付版稅),並且基於基礎授權涵蓋的專案數量。 這允許 Iron Software在 SaaS 軟體服務中進行部署,並且基於基礎授權涵蓋的專案數量。

價格: 每年從 $1,599 起。

Asprise Ocr Alternatives 10 related to IronOCR 授權模式和價格

Asprise OCR 授權模式和價格

Lite 授權:

  • 不限終端使用者
  • 識別文字
  • 讀取 1D 條碼:UPC、EAN、Code39、Code128
  • 文字、XML 和 PDF 輸出
  • 易於部署
  • 支援2個操作系統
  • 席位1
  • 支援:否

價格: 每年從 $9998 起。

Standard 授權:

  • 不限終端使用者
  • BMP、GIF、PNG、JPEG、TIFF 和PDF輸入。
  • 識別文字
  • 讀取 1D 條碼:UPC、EAN、Code39、Code128
  • 讀取某些 2D 條碼:僅限 QR 和 Data Matrix
  • 文字、XML 和 PDF 輸出
  • 易於部署
  • 支援:否

價格: 每年從 $7,998 起。

Enterprise 授權:

  • 不限終端使用者
  • BMP、GIF、PNG、JPEG、TIFF 和PDF輸入。
  • 識別文字
  • 讀取 1D 條碼:UPC、EAN、Code39、Code128
  • 2D:QR、PDF 417、Data Matrix 及 Aztec
  • 文字、XML 和 PDF 輸出
  • 易於部署
  • 多執行緒,多處理

價格: 從 $12,998 起。

Asprise Ocr Alternatives 11 related to Asprise OCR 授權模式和價格

IronOCR Lite 授權包含一位開發者方案,且一年支援費用約 $999,而 Asprise Lite 包含一位開發者方案的成本 $9998 不含技術支援,含支付技術支援的費用是 $6,296。 IronOCR Professional 授權 包含一個十位開發者方案,且一年技術支援費用 $999,而相應的 Asprise 授權包含一個十位開發者方案的成本每年 $37,998,不含技術個支援,但付費技術版本和更新及支援一年,費用 $46,999.00。

IronOCR Lite專業套餐具有SaaS服務或OEM和5年支援選項。 Lite 版本,包括一位開發者方案,具有五年支援和 SaaS 及 OEM 服務,費用 $2897USD,而 Asprise 擁有 SaaS 或 OEM 服務及自訂支援選項。 IronOCR Professional 版本包括一個十位開發者方案,費用 $3397,含一年技術支援且涵蓋 SaaS 和 OEM 服務,而帶有十位開發者方案且不含一年支援的 Asprise 版本費用 $59,996。

8.0 結論

.NET Framework 內容下的 IronOCR 提供了 Tesseract,容易理解和使用。 它以各種方式支持照片和PDF文件。 它還提供多種設置以提高Tesseract OCR程式庫的性能。 除了支持多種語言外,它還支持在單個操作中處理多種語言。 要了解更多關於Tesseract OCR的資訊,請存取他們的網站。

Asprise 是一款利用人工智能引擎識別圖片和PDF文件的軟體應用。 它還提供多種設置以提高OCR過程的性能。 此外,它還提供了選擇多種語言的選項。 在頁面轉換的使用上,Asprise 確實有一些限制。 針對不同的作業系統,還有不同的價格。

IronOCR 包包提供比 Asprise 更好的 授權支援。Asprise OCR 有定製和固定方案,且價格昂貴。IronOCR 從 $999 開始,而 Asprise OCR 每年從 $9994 開始,因此我們的產品具有較高的性價比,並提供比 Aspire 更多的功能。它還支援多個平台的單一價格。

那麼,你還在等什麼呢? 免費試用對所有人開放。 您可以在 這裡獲得授權並開始使用。

請注意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 套件管理員在您的 C# 專案中安裝 IronOCR。或者,您可以使用命令行通過 Install-Package IronOCR 安裝,或直接從 IronOCR 網站下載。

using IronOCR 優於其他 OCR 程式庫的好處是什麼?

IronOCR 提供廣泛的語言支援,對低質量影像有卓越的效能,並具備條碼和 QR Code 辨識等功能。它提供具有成本效益的授權並在單一價格下支援多個平台,是開發者的多功能選擇。

IronOCR 能否處理多頁文件?

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

IronOCR 提供哪些授權選項?

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

IronOCR 如何處理低質量影像文字提取?

IronOCR 在從低質量影像中提取文字方面表現出色,通過使用先進的預處理技術來提高影像質量,從而顯著提高文字辨識的準確性。

Kannaopat Udonpant
軟體工程師
在成為軟體工程師之前,Kannapat在日本北海道大學完成了環境資源博士學位。在攻讀學位期間,Kannapat還成為車輛機器人實驗室的一員,該實驗室隸屬於生產工程系。在2022年,他憑藉C#技能加入了Iron Software的工程團隊,專注於IronPDF。Kannapat珍視他的工作,因為他能直接向撰寫大部分IronPDF程式碼的開發者學習。除了同儕學習,Kannapat還喜歡在Iron Software工作的社交方面。不寫程式碼或文件時,Kannapat通常在他的PS5上玩遊戲或重看The Last of Us。

Iron 支援團隊

我們線上24小時,每週5天。
聊天
電子郵件
給我打電話