在生產環境中測試,無水印。
在任何需要的地方都能運行。
獲得 30 天的全功能產品。
在幾分鐘內上手運行。
試用產品期間完全訪問我們的支援工程團隊
本文將比較兩個使用光學字符識別 (OCR) 的軟體庫,這些軟體庫用於自動檢測和提取圖像和掃描文件中的打印文本。 首先,我們將討論這兩個函式庫的功能。 接下來,我們將檢查並比較它們的文本識別和提取能力,使用由這兩個庫生成的示例源代碼。 最後,我們將比較這些庫的授權和定價。
我們將在本文中比較的庫有:
Syncfusion 的 Essential PDF 程式庫整合了 OCR 功能,以支援在 PDF 文件中的掃描影像上進行圖像文字處理。
Syncfusion 的 OCR 處理器可以與 Tesseract 版本 3(3.02 和 3.05)和 4 一起使用。該函式庫可以納入 .NET Core 和 ASP.NET 應用程式中。
SyncFusion Essential PDF 的 OCR 功能特色包括:
OCRProcessor
類可以用來對 PDF 文件執行 OCR。 它基於 Tesseract 數據處理器,Tesseract 被認為是世界上最好的 OCR 處理器之一。IronOCR 是一個 C# 軟體庫,可讓 .NET 平台開發人員識別和讀取圖片及 PDF 文件中的文字。 這是一個僅適用於 .NET 的 OCR 庫,使用強大的 Tesseract 引擎。Tesseract 版本 3 到 5 可以直接在 Windows、macOS、Linux、Azure、AWS、Lambda、Mono 和 Xamarin Mac 上運行。
IronOCR 支援的語言比市面上所有 OCR 引擎都多,支持125 種語言(預設僅安裝英語)。
.NET 開發人員對他們的文檔擁有完全的控制權,可以根據需要進行修改。
IronOCR 提供了獨特的功能組合,用於整合、簽署、匯出、讀取視覺內容,並從照片中提取細節,無論使用者的技術背景或硬體複雜度如何。
IronOCR SDK 在準確性方面勝過其他 OCR 庫,達到 99.8% 的準確率。
IronOCR 類別為 C# 開發人員提供廣泛的控制權。 他們為其開發人員提供 OCR(圖像和 PDF 到文字)功能,並在每個特定實例中進行細緻的性能調整。
IronOCR 包含配置選項,使該庫能夠處理非理想質量的圖像。 其中一些可用的配置包括:清除背景噪音、增强对比度、增强分辨率、语言、策略、旋转和拉直、颜色空间、检测深色背景上的白色文字和输入图像类型。
IronOCR 支援超過 125 種國際語言。
Iron Tesseract 可以讀取多種圖片格式以及 PDF 檔案。 此功能不適用於標準的免費Tesseract引擎。 如果您的掃描品質較差,OCR 輸入允許您自動修復所需的屬性。
OCRInput 類別為 C# 程式設計師提供了對輸入的細緻控制。 圖片輸入隨後由開發人員進行預處理,以提高速度和準確性。 這樣就不需要在進行 OCR 處理之前使用 Photoshop 批量腳本或 ImageMagick 來準備照片了。
IronOCR允許其終端用戶對圖像的特定區域執行OCR。
IronOCR 使用 Tesseract 3、4 或 5 掃描每個頁面時,會返回一個高級結果物件。這其中包含位置數據、圖像、文本、統計置信度、替代符號選擇、字體名稱、字體大小裝飾、字體粗細,以及對於以下每項的位置信息:
IronOCR 允許開發者在單一文件中使用多種語言。 此功能對 .NET 服務提供商極為有利。
在本文中,我們將使用新的 Visual Studio 控制台應用程式來演示 IronOCR 和 Syncfusion Essential PDF 的 OCR 處理能力。
打開 Visual Studio 軟體,進到檔案選單,選擇新專案。 然後,選擇控制台應用程序。
輸入專案名稱並在相應的文本框中選擇路徑。 接下來,點擊創建按鈕,然後選擇所需的 .NET 框架,如下圖所示:
Visual Studio 專案現在將為新的控制台應用程式生成結構。 完成後將打開 program.cs 文件。
我們現在將這兩個庫添加到項目中。
IronOCR 程式庫可以透過四種方式下載和安裝。 這些是:
使用 Visual Studio 的 NuGet 套件管理器
直接從 NuGet 網頁下載。
直接從 IronOCR 網頁下載。
您可以使用 Visual Studio 的 NuGet 套件管理器將 IronOCR 整合到 C# 專案中。
透過點擊工具 > NuGet 套件管理員 > 管理 NuGet 解決方案的套件...來訪問 NuGet 套件管理員 GUI
之後,將出現一個新視窗。 在專案中搜尋 IronOCR 並安裝該套件。
可以使用上述相同的方法安裝IronOCR的其他語言包。
IronOCR 可以按照以下指示直接從 NuGet 網站下載:
導航到[IronPDF NuGet Gallery Page](https://www.nuget.org/packages/IronOCR/" target="_blank" rel="nofollow noopener noreferrer)
從右側菜單中選擇下載套件選項。
開發人員可以從 IronOCR 網站下載該庫並將其作為專案引用添加。
按照以下說明在 Visual Studio 中將該庫添加為參考。
在解決方案窗口中右鍵點擊專案。
然後,選擇新增專案參考並瀏覽下載參考的位址。
在 Visual Studio 中,前往工具 > NuGet 套件管理員 > 套件管理員主控台
在套件管理器主控台標籤頁中輸入以下行:
該套件現在將下載/安裝到當前項目,並準備使用。
Syncfusion Essential PDF 可以通過三種不同的方式安裝。
使用 Visual Studio 的 NuGet 套件管理器
直接從 NuGet 網頁下載。
與IronOCR一樣,開發人員也可以使用Visual Studio的NuGet包管理器安裝SyncFusion的OCR庫。
如前所述,點擊工具 > NuGet 套件管理員 > 管理解決方案的 NuGet 套件...以存取套件管理員
搜索SyncFusion OCR並安裝相應的套件(應為Syncfusion.PDF.OCR.Net.Core
)
SyncFusion Essential PDF OCR 的其他語言包可以從 [GitHub](https://github.com/tesseract-ocr/tessdata" target="_blank" rel="nofollow noopener noreferrer) 下載。
您可以按照以下說明從NuGet網站直接下載Syncfusion Essential PDF OCR:
導航至套件的[NuGet 資源庫頁面](https://www.nuget.org/packages/Syncfusion.PDF.OCR.Net.Core" target="_blank" rel="nofollow noopener noreferrer)。
從右側菜單中選擇下載套件選項。
雙擊下載的包。 將自動安裝。
在 Visual Studio 中,前往工具 > NuGet 套件管理員 > 套件管理員主控台
Install-Package Syncfusion.PDF.OCR.Net.Core -Version 20.2.0.38
該套件現在將下載/安裝到當前項目,並準備使用。
IronOCR 和 Syncfusion OCR 都能對 PDF 文件進行光學字符識別 (OCR)。 在這裡,我們將討論如何在 Visual Studio 中使用它們兩者。
只需幾行程式碼,開發者即可對整個 PDF 或特定頁面/部分進行 OCR。 考慮以下程式碼片段。
using IronOcr;
var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
Input.AddPdf("example.pdf", "password");
var Result = Ocr.Read(Input);
Console.WriteLine(Result.Text);
}
using IronOcr;
var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
Input.AddPdf("example.pdf", "password");
var Result = Ocr.Read(Input);
Console.WriteLine(Result.Text);
}
Imports IronOcr
Private Ocr = New IronTesseract()
Using Input = New OcrInput()
Input.AddPdf("example.pdf", "password")
Dim Result = Ocr.Read(Input)
Console.WriteLine(Result.Text)
End Using
您可以使用 OCRProcessor 類別對 PDF 文件以及文件中的區域進行光學字符識別 (OCR)。 查看下面的代碼範例以了解上下文。
using Syncfusion.OCRProcessor;
using Syncfusion.Pdf.Graphics;
using Syncfusion.Pdf.Parsing;
//initialize the ocr processor
using (OCRProcessor processor = new OCRProcessor(@"TesseractBinaries\"))
{
PdfLoadedDocument lDoc = new PdfLoadedDocument("Input.pdf");
processor.Settings.Language = Languages.English;
processor.PerformOCR(lDoc, @"TessData\");
lDoc.Save("Sample.pdf");
lDoc.Close(true);
}
using Syncfusion.OCRProcessor;
using Syncfusion.Pdf.Graphics;
using Syncfusion.Pdf.Parsing;
//initialize the ocr processor
using (OCRProcessor processor = new OCRProcessor(@"TesseractBinaries\"))
{
PdfLoadedDocument lDoc = new PdfLoadedDocument("Input.pdf");
processor.Settings.Language = Languages.English;
processor.PerformOCR(lDoc, @"TessData\");
lDoc.Save("Sample.pdf");
lDoc.Close(true);
}
Imports Syncfusion.OCRProcessor
Imports Syncfusion.Pdf.Graphics
Imports Syncfusion.Pdf.Parsing
'initialize the ocr processor
Using processor As New OCRProcessor("TesseractBinaries\")
Dim lDoc As New PdfLoadedDocument("Input.pdf")
processor.Settings.Language = Languages.English
processor.PerformOCR(lDoc, "TessData\")
lDoc.Save("Sample.pdf")
lDoc.Close(True)
End Using
這兩個程式庫都能在C#.NET和.NET Core應用程式中對影像進行OCR。
IronOCR 獨特之處在於其能夠只使用兩行代碼就能自動檢測並從不完美的掃描圖像中讀取文字。
using IronOcr;
var Result = new IronTesseract().Read(@"images\11111.png").Text;
using IronOcr;
var Result = new IronTesseract().Read(@"images\11111.png").Text;
Imports IronOcr
Private Result = (New IronTesseract()).Read("images\11111.png").Text
OCR OUTPUT form 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
Syncfusion Essential PDF 能夠非常精確地從圖像中提取文本。
using (OCRProcessor processor = new OCRProcessor(@"TesseractBinaries\"))
using Syncfusion.OCRProcessor;
using Syncfusion.Pdf.Graphics;
using Syncfusion.Pdf.Parsing;
{
//loading the input image
Bitmap image = new Bitmap("11111.jpeg");
//Set OCR language to process
processor.Settings.Language = Languages.English;
//Process OCR by providing the bitmap image, data dictionary and language
string ocrText= processor.PerformOCR(image, @"TessData\");
}
using (OCRProcessor processor = new OCRProcessor(@"TesseractBinaries\"))
using Syncfusion.OCRProcessor;
using Syncfusion.Pdf.Graphics;
using Syncfusion.Pdf.Parsing;
{
//loading the input image
Bitmap image = new Bitmap("11111.jpeg");
//Set OCR language to process
processor.Settings.Language = Languages.English;
//Process OCR by providing the bitmap image, data dictionary and language
string ocrText= processor.PerformOCR(image, @"TessData\");
}
Using processor As New OCRProcessor("TesseractBinaries\")
Using Syncfusion.OCRProcessor
End Using
End Using
Using Syncfusion.Pdf.Graphics
Using Syncfusion.Pdf.Parsing
'loading the input image
Dim image As New Bitmap("11111.jpeg")
'Set OCR language to process
processor.Settings.Language = Languages.English
'Process OCR by providing the bitmap image, data dictionary and language
Dim ocrText As String= processor.PerformOCR(image, "TessData\")
End Using
End Using
影像之文字辨識輸出
OCR輸出
簡單資料輸出:
+ .NET 字串
Dee eT Nd
tC eke ass
Biren)
牛奶製品
段
ORS
eae
eed
TLC
是
Smt d
查看 amr'
etd ieot
IronOCR 和 Syncfusion Essential PDF 的使用需要軟體授權。
IronOCR 為個人和非商業專案提供免費的開發許可證。
IronOCR 提供商業授權的獨特定價結構。 輕量版套件起價為$749,無其他費用。 所有授權均包含30天退款保證、一年軟體支援與升級、開發、測試、暫行、有效生產以及永久授權(一次性購買)。 瞭解有關 IronOCR 完整定價結構和授權資訊的更多信息,請參閱此頁面。
只需一次性支付 $1599,即可獲得SaaS和OEM商品的免版稅再分配權。
Syncfusion Essential PDF 提供三種開發者授權,但不提供 SaaS 和 OEM 覆蓋。
Unlimited License。這個選項為整個組織提供每年的授權,但價格較低。
在[產品授權頁面](https://www.syncfusion.com/sales/products" target="_blank" rel="nofollow noopener noreferrer)查看Syncfusion Essential PDF以及其他Syncfusion元件的整體授權結構。
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 的價格從$749起,Syncfusion 的價格從每年 $995 開始。
透過購買完整的Iron Suite,以折扣價獲得IronOCR以及其他四款Iron Software產品。 Iron Suite 中捆绑的产品包括:
IronPDF
IronOCR
IronXL
IronBarcode
IronWebscraper
Iron Software 的授權頁面包含有關上述五款產品的定價和授權的更詳細資訊。