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

IronOCR 和 Syncfusion OCR 之間的比較

本文將比較兩個使用光學字元辨識 (OCR) 來自動偵測和擷取影像和掃描文件中印刷文字的軟體庫。 首先,我們將討論這兩個函式庫的特點。 接下來,我們將使用這兩個庫產生的範例原始程式碼來檢驗和比較它們的文字識別和提取能力。 最後,我們將比較各圖書館的許可和定價。

本文將比較的函式庫有:

  • IronOCR
  • Syncfusion Essential PDF

1. Syncfusion OCR

Syncfusion 的 Essential PDF 庫整合了 OCR 功能,可對 PDF 文件中的掃描影像進行影像文字處理。

Syncfusion 的 OCR 處理器可與 Tesseract 版本 3(3.02 和 3.05)和 4 搭配使用。該程式庫可以包含在 .NET Core 和 ASP.NET 應用程式中。

SyncFusion Essential PDF 的 OCR 功能包括以下特點:

-對 PDF 文件執行 OCR 任務。可以使用庫的OCRProcessor類別對 PDF 檔案執行 OCR 操作。 它基於 Tesseract 數據處理器,Tesseract 數據處理器被公認為世界上最好的 OCR 處理器之一。 -對PDF文件的特定部分執行OCR識別任務。使用者可以對PDF文件中的特定頁面或區域進行OCR識別。 -對影像執行OCR辨識任務。用戶可以從圖像中提取文字數據,並導入到其他應用程式中。 -多語言支援。 Google Tesseract 引擎(透過 Syncfusion 擴充)目前支援 60 多種語言,並且正在試驗支援更多語言。 -準確率高。 Syncfusion Essential PDF 利用Google的 Tesseract 開源引擎,實現了非常高的文字準確率,並且在合理的時間內完成了 OCR 識別。

2. IronOCR

IronOCR 是一個 C# 軟體庫,它允許 .NET 平台開發人員識別和讀取圖片和 PDF 文件中的文字。 這是一個僅支援 .NET 的 OCR 函式庫,它使用功能強大的 Tesseract 引擎。 Tesseract 3 到 5 版本可在 Windows、macOS、Linux、Azure、AWS、Lambda、Mono 和 Xamarin Mac 上即插即用。

IronOCR 支援比其他 OCR 引擎更多的語言,支援 125 種語言(預設只安裝英文)。

.NET 開發人員對其文件擁有完全控制權,可以根據需要進行修改。

2.1. IronOCR 功能

IronOCR 提供獨特的功能組合,可用於整合、簽名、匯出、讀取影像以及從照片中提取細節,而無需考慮使用者的技術背景或硬體的複雜程度。

2.1.1. 準確性

IronOCR SDK 的準確率高達 99.8%,優於其他 OCR 庫。

2.1.2. 修復低品質掃描件和影像

IronOCR 類別為 C# 開發人員提供了廣泛的控制功能。 它為開發者提供 OCR(圖像和 PDF 轉文字)功能,並針對每個特定實例進行精細化的效能調整。

IronOCR 包含配置選項,使庫能夠處理品質不理想的影像。 這些配置包括:清除背景雜訊、增強對比度、增強解析度、語言、策略、旋轉和矯正、色彩空間、偵測深色背景上的白色文字以及輸入影像類型。

2.1.3. 語言

IronOCR 支援 125 多種國際語言。

2.1.4. OCR文本提取

Iron Tesseract 可以讀取多種影像格式以及 PDF 檔案。 此功能在標準的免費 Tesseract 引擎中不可用。 如果您的掃描件品質較差,OCR 輸入功能可讓您自動修復所需的屬性。

2.1.5. 影像優化濾波器

OCRInput 類別為 C# 程式設計師提供了對輸入的精細控制。 開發人員隨後對輸入的圖片進行預處理,以提高速度和準確性。 這樣就無需使用 Photoshop 批次腳本或 ImageMagick 在進行 OCR 處理之前準備照片。

2.1.6. 影像的OCR區域

IronOCR 允許其最終使用者對影像的特定區域執行 OCR 操作。

2.1.7. OCRResult 類

IronOCR 使用 Tesseract 3、4 或 5 掃描每一頁後,都會傳回一個進階結果物件。此物件包含位置資料、圖像、文字、統計置信度、替代符號選擇、字體名稱、字體大小、裝飾、字體粗細以及以下各項的位置資訊:

  • 頁 段落
  • 文字行
  • 個別角色 條碼

2.1.8. 一份文件包含多種語言

IronOCR 允許開發人員在單一文件中使用多種語言。 這項功能對 .NET 服務提供者極為有利。

3. 在 Visual Studio 中建立新項目

在本文中,我們將使用一個新的 Visual Studio 控制台應用程式來示範 IronOCR 和 Syncfusion Essential PDF 的 OCR 處理功能。

開啟 Visual Studio 軟體,前往檔案選單,然後選擇"新專案" 。 然後,選擇控制台應用程式

在適當的文字方塊中輸入專案名稱並選擇路徑。 接下來,按一下"建立"按鈕,然後選擇所需的 .NET 框架,如下圖所示:

A Comparison Between IronOCR and SyncFusion Essential PDF OCR, Figure 1

Visual Studio 專案現在將產生新控制台應用程式的結構。 程式運行完成後,將開啟program.cs檔。

A Comparison Between IronOCR and SyncFusion Essential PDF OCR, Figure 2

現在我們將把這兩個庫加入到專案中。

4. 安裝 IronOCR 庫

IronOCR庫可以透過四種方式下載和安裝。 這些工具包括

  1. 使用 Visual Studio NuGet 套件管理器
  2. 直接從 NuGet 網頁下載。
  3. 直接從 IronOCR 網頁下載。
  4. 使用 Visual Studio 命令列。

4.1. 使用 Visual Studio NuGet 管理器

您可以使用 Visual Studio NuGet 套件管理器將 IronOCR 整合到 C# 專案中。

按一下"工具">"NuGet 套件管理員">"管理解決方案的 NuGet 套件..."即可存取 NuGet 套件管理器 GUI。

A Comparison Between IronOCR and SyncFusion Essential PDF OCR, Figure 3

之後,將出現一個新視窗。 搜尋 IronOCR 並將其安裝到專案中。

A Comparison Between IronOCR and SyncFusion Essential PDF OCR, Figure 4

也可以使用上述相同的方法安裝 IronOCR 的其他語言套件。

4.2. 從 NuGet 網頁直接下載

您可以按照以下說明直接從 NuGet 網站下載 IronOCR:

  1. Navigate to the IronPDF NuGet Gallery Page.
  2. 從右側選單中選擇下載軟體包選項。
  3. 雙擊下載的軟體包。 它會自動安裝。

4.3. 從 IronOCR 網頁直接下載

開發者可以從 IronOCR 網站下載該庫,並將其新增為專案引用。

請依照以下說明將庫新增為 Visual Studio 中的參考。

  1. 在解決方案視窗中右鍵點選項目。
  2. 然後,選擇"新增項目參考",瀏覽下載的參考檔案的位置。
  3. 接下來,按一下"確定"以新增引用。

4.4. 使用 Visual Studio 命令列

  1. 在 Visual Studio 中,前往"工具">"NuGet 套件管理器">"套件管理器控制台"
  2. 在軟體包管理器控制台標籤中輸入以下命令:
Install-Package IronOcr
A Comparison Between IronOCR and SyncFusion Essential PDF OCR, Figure 5

該套件現在會下載/安裝到目前的專案中,並可立即使用。

A Comparison Between IronOCR and SyncFusion Essential PDF OCR, Figure 6

5. 安裝 Syncfusion Essential PDF OCR 庫

Syncfusion Essential PDF 可以透過三種不同的方式安裝。

  1. 使用 Visual Studio NuGet 套件管理器
  2. 直接從 NuGet 網頁下載。
  3. 使用 Visual Studio 命令列。

5.1. 使用 Visual Studio NuGet 管理器

與 IronOCR 一樣,開發人員也可以使用 Visual Studio 的 NuGet 套件管理器安裝 SyncFusion 的 OCR 程式庫。

像以前一樣存取套件管理器,方法是點擊"工具">"NuGet 套件管理員">"管理解決方案的 NuGet 套件..."

A Comparison Between IronOCR and SyncFusion Essential PDF OCR, Figure 7

搜尋SyncFusion OCR並安裝對應的軟體包(應該是Syncfusion.PDF.OCR.Net.Core )。

A Comparison Between IronOCR and SyncFusion Essential PDF OCR, Figure 8

Additional language packs for SyncFusion Essential PDF OCR can be downloaded from GitHub.

5.2. 從 NuGet 網頁直接下載

您可以依照以下說明直接從 NuGet 網站下載 Syncfusion Essential PDF OCR:

  1. Navigate to the package's NuGet Gallery page.
  2. 從右側選單中選擇下載軟體包選項。
  3. 雙擊下載的軟體包。 它會自動安裝。
  4. 接下來,重新載入解決方案,並在專案中開始使用它。

5.3. 使用 Visual Studio 命令列

  1. 在 Visual Studio 中,前往"工具">"NuGet 套件管理器">"套件管理器控制台"
  2. 在軟體包管理器控制台標籤中輸入以下命令:
Install-Package Syncfusion.PDF.OCR.Net.Core -Version 20.2.0.38
A Comparison Between IronOCR and SyncFusion Essential PDF OCR, Figure 9

該套件現在會下載/安裝到目前的專案中,並可立即使用。

6. 對PDF文件執行OCR識別

IronOCR 和 Syncfusion OCR 都能夠對 PDF 文件進行 OCR 識別。 在這裡,我們將討論如何在 Visual Studio 中使用它們。

6.1. 使用 IronOCR 進行 PDF OCR 文字擷取

只需幾行程式碼,開發人員就可以對整個 PDF 檔案或 PDF 檔案的特定頁面/部分執行 OCR 操作。 請看下面的程式碼片段。

using IronOcr;

var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
    // Add a PDF document and specify a password if needed
    Input.AddPdf("example.pdf", "password");
    // Read the textual content from the PDF
    var Result = Ocr.Read(Input);
    // Display the text in the console
    Console.WriteLine(Result.Text);
}
using IronOcr;

var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
    // Add a PDF document and specify a password if needed
    Input.AddPdf("example.pdf", "password");
    // Read the textual content from the PDF
    var Result = Ocr.Read(Input);
    // Display the text in the console
    Console.WriteLine(Result.Text);
}
Imports IronOcr

Private Ocr = New IronTesseract()
Using Input = New OcrInput()
	' Add a PDF document and specify a password if needed
	Input.AddPdf("example.pdf", "password")
	' Read the textual content from the PDF
	Dim Result = Ocr.Read(Input)
	' Display the text in the console
	Console.WriteLine(Result.Text)
End Using
$vbLabelText   $csharpLabel

6.2. 使用 Syncfusion Essential PDF OCR 進行 PDF OCR 文字擷取

您可以使用OCRProcessor類別對 PDF 文件以及文件的特定區域執行 OCR 操作。 請查看以下程式碼範例以了解上下文。

using Syncfusion.OCRProcessor;
using Syncfusion.Pdf.Parsing;

// Initialize the OCR processor
using (OCRProcessor processor = new OCRProcessor(@"TesseractBinaries\"))
{
    // Load the input PDF document
    PdfLoadedDocument lDoc = new PdfLoadedDocument("Input.pdf");
    // Set the OCR language
    processor.Settings.Language = Languages.English;
    // Perform OCR on the loaded PDF
    processor.PerformOCR(lDoc, @"TessData\");
    // Save the processed PDF
    lDoc.Save("Sample.pdf");
    // Close the document
    lDoc.Close(true);
}
using Syncfusion.OCRProcessor;
using Syncfusion.Pdf.Parsing;

// Initialize the OCR processor
using (OCRProcessor processor = new OCRProcessor(@"TesseractBinaries\"))
{
    // Load the input PDF document
    PdfLoadedDocument lDoc = new PdfLoadedDocument("Input.pdf");
    // Set the OCR language
    processor.Settings.Language = Languages.English;
    // Perform OCR on the loaded PDF
    processor.PerformOCR(lDoc, @"TessData\");
    // Save the processed PDF
    lDoc.Save("Sample.pdf");
    // Close the document
    lDoc.Close(true);
}
Imports Syncfusion.OCRProcessor
Imports Syncfusion.Pdf.Parsing

' Initialize the OCR processor
Using processor As New OCRProcessor("TesseractBinaries\")
	' Load the input PDF document
	Dim lDoc As New PdfLoadedDocument("Input.pdf")
	' Set the OCR language
	processor.Settings.Language = Languages.English
	' Perform OCR on the loaded PDF
	processor.PerformOCR(lDoc, "TessData\")
	' Save the processed PDF
	lDoc.Save("Sample.pdf")
	' Close the document
	lDoc.Close(True)
End Using
$vbLabelText   $csharpLabel

7. 對影像進行OCR識別

這兩個函式庫都可以在 C#.NET 和 .NET Core 應用程式中對影像執行 OCR 操作。

7.1. 使用 IronOCR 對影像進行 OCR 識別

IronOCR 的獨特之處在於,它只需兩行程式碼即可自動偵測和讀取掃描不完美的影像中的文字。

using IronOcr;

// Perform OCR and read text from the specified image
var Result = new IronTesseract().Read(@"images\11111.png").Text;
using IronOcr;

// Perform OCR and read text from the specified image
var Result = new IronTesseract().Read(@"images\11111.png").Text;
Imports IronOcr

' Perform OCR and read text from the specified image
Private Result = (New IronTesseract()).Read("images\11111.png").Text
$vbLabelText   $csharpLabel

OCR輸入影像

A Comparison Between IronOCR and SyncFusion Essential PDF OCR, Figure 10

OCR OUTPUT from IMAGE
OCR Output
Simple Data Outputs:
» NET Text Strings
» Barcode & QR Data & Images
Structured Data Outputs:
» Pages
» Blocks
» Paragraphs
» Lines
» Words
» Characters
Export Documents:
» Searchable PDFs
» hOCR / HTML Export
» Images of any Page, Text Element or Barcode

7.2. 使用 Syncfusion Essential PDF OCR 處理器對影像執行 OCR

Syncfusion Essential PDF 能夠非常準確地從影像中提取文字。

using System.Drawing;
using Syncfusion.OCRProcessor;

// Initialize the OCR processor
using (OCRProcessor processor = new OCRProcessor(@"TesseractBinaries\"))
{
    // Load the input image
    Bitmap image = new Bitmap("11111.jpeg");
    // Set the OCR language
    processor.Settings.Language = Languages.English;
    // Perform OCR on the loaded image
    string ocrText = processor.PerformOCR(image, @"TessData\");
}
using System.Drawing;
using Syncfusion.OCRProcessor;

// Initialize the OCR processor
using (OCRProcessor processor = new OCRProcessor(@"TesseractBinaries\"))
{
    // Load the input image
    Bitmap image = new Bitmap("11111.jpeg");
    // Set the OCR language
    processor.Settings.Language = Languages.English;
    // Perform OCR on the loaded image
    string ocrText = processor.PerformOCR(image, @"TessData\");
}
Imports System.Drawing
Imports Syncfusion.OCRProcessor

' Initialize the OCR processor
Using processor As New OCRProcessor("TesseractBinaries\")
	' Load the input image
	Dim image As New Bitmap("11111.jpeg")
	' Set the OCR language
	processor.Settings.Language = Languages.English
	' Perform OCR on the loaded image
	Dim ocrText As String = processor.PerformOCR(image, "TessData\")
End Using
$vbLabelText   $csharpLabel

OCR輸入影像

A Comparison Between IronOCR and SyncFusion Essential PDF OCR, Figure 11

OCR OUTPUT from IMAGE
OCR Output
Simple Data Output:
+ NET Text Strings
Dee eT Nd
tC eke ass
Biren)
Soy
Seg
ors
eae
eed
TLC
eres
Smt d
See amr'
etd ieot

8.授權

使用 IronOCR 和 Syncfusion Essential PDF 都需要軟體許可。

8.1 IronOCR 許可

IronOCR 為個人非商業專案提供免費開發許可。

IronOCR 為商業許可提供獨特的定價結構。 Lite 套餐起價為$799 ,無其他額外費用。 所有許可證均包含 30 天退款保證、一年的軟體支援和升級、開發、測試、部署、生產有效性以及永久許可證(一次性購買)。 從此頁面了解更多關於 IronOCR 的完整定價結構和許可資訊。

只需一次性支付 $1,599 費用,即可獲得 SaaS 和 OEM 商品的免版稅再分發。

A Comparison Between IronOCR and SyncFusion Essential PDF OCR, Figure 12

8.2. Syncfusion Essential PDF 許可

Syncfusion Essential PDF 提供三種類型的開發者許可證,但不提供 SaaS 和 OEM 服務。

-社群版授權。社群版授權對開發者和最多 5 名開發者的小型公司免費開放。 它還包括線上支援。 -零售許可證。零售許可證為年度許可證,組織內的每位開發人員必須單獨購買。 零售授權起價為每位開發者每年 $995 美元。 -無限制許可。此選項以更低的價格為整個組織提供相同的年度許可。

View the entire licensing structure for Syncfusion Essential PDF (and for other Syncfusion components) on the product licensing page.

A Comparison Between IronOCR and SyncFusion Essential PDF OCR, Figure 13

9.結論

IronOCR 總共支援約 125 種全球語言。 其處理能力包括:對 PDF 文件或圖像的部分內容執行 OCR,從 PDF 和照片中提取文本,以及校正品質差的圖像等等。 IronOCR優先考慮速度和準確性。 其準確率高達 99.8%,高於市場上任何其他基於 Tesseract 的 OCR 庫。 IronOCR 開箱即用,無需效能調優或影像預處理。

Syncfusion Essential PDF OCR 也使用了 Google 開源的 Tesseract 引擎。它可以對整個文件或文件的特定部分進行 OCR 識別。 Syncfusion 的 OCR 庫支援 60 多種國際語言。

IronOCR 許可證終身有效,提供無限次支援以及 SaaS 和 OEM 服務。 另一方面,Syncfusion Essential PDF OCR 提供按年付費的許可。 IronOCR 的定價從$799起,Syncfusion 的定價從每年 $995 起。

購買完整的Iron Suite ,即可享有 IronOCR 以及其他四款 Iron Software 產品折扣價。 Iron Suite套裝中包含的產品有:

  1. IronPDF
  2. IronOCR
  3. IronXL
  4. IronBarcode
  5. IronWebscraper

Iron Software 的授權頁麵包含有關上述五款產品的定價和授權的更詳細資訊。

請注意Syncfusion Essential PDF 為其各自所有者的註冊商標。 本網站與 Syncfusion Essential PDF 無任何關聯,也未獲得其認可或贊助。 所有產品名稱、標誌和品牌均為其各自擁有者的財產。 比較資料僅供參考,並反映撰寫時的公開資訊。

常見問題解答

如何使用 C# 在影像上執行 OCR?

您可以使用 IronOCR 在 C# 中對影像執行 OCR。它提供了從各種圖像格式中高準確度地擷取文字的方法,並支援超過 125 種語言。

使用 IronOCR 執行 OCR 任務有哪些優點?

IronOCR 提供 99.8% 的絕佳準確率,支援特定文件區域的 OCR,具有針對低品質掃描的影像最佳化功能,並支援多種語言。

IronOCR 與 Syncfusion 的 OCR 功能比較如何?

雖然兩者都使用 Tesseract 引擎,但與 Syncfusion 的 OCR 相比,IronOcr 支援更多版本 (3-5) 和語言 (125+),提供更好的精確度,並提供增強的影像修正功能。

IronOCR 有哪些授權選項?

IronOCR 提供免費的個人使用開發授權,商業授權的一次性費用為 1599 美元起,包括永久授權和 SaaS/OEM 保護。

我可以使用 IronOCR 從掃描的 PDF 文件中提取文字嗎?

是的,IronOCR 可以使用其基於 Tesseract 的 OCR 功能從掃描的 PDF 文件中提取文字,確保高準確性和語言支援。

IronOCR 支援哪些平台?

IronOCR 用途廣泛,支援多種平台,包括 Windows、macOS、Linux、Azure、AWS、Lambda、Mono 和 Xamarin Mac。

IronOCR 如何處理低品質的影像掃描?

IronOCR 包含可提升影像品質的功能,例如背景雜訊清除、對比強化和解析度調整,可改善低品質影像的 OCR 結果。

是否可以使用 IronOCR 對文件的特定區域執行 OCR?

是的,IronOCR 允許使用者指定文件的特定區域或頁面進行 OCR,提供文字擷取過程的彈性與控制。

如何將 IronOCR 整合到 .NET 專案中?

IronOCR 可透過 Visual Studio NuGet Package Manager、NuGet 網站或從 IronOCR 網站下載,整合至 .NET 專案中。

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