IronOCR與Abbyy Finereader的比較
在本文中,我們將比較兩個常用的程式庫和應用程式,用於對PDF文件和圖像應用OCR技術。 這些是:
- ABBYY FineReader PDF軟體
- IronOCR
如何在C#中使用ABBYY Finereader SDK
- 安裝ABBYY Finereader SDK以在C#中進行OCR
- 將圖像和PDF文件轉換為Microsoft Word、可搜尋的PDF、CSV和文字
- 從PDF文件建立可編輯的PDF
- 支持PDF/A-1到PDF/A-3和PDF/UA
- 使用最新的基於AI的OCR技術來數位化、檢索、編輯、保護、共享和協作所有型別的文件
1. 簡介
1.1 ABBYY FineReader PDF — 簡介與功能
ABBYY FineReader PDF是一款由ABBYY建立的光學字元識別(OCR)應用程式。 它允許我們將圖像文件(圖片、掃描、PDF文件)和螢幕擷取轉換為可編輯的文件格式,如Microsoft Word、Microsoft Excel、Microsoft PowerPoint、富文字格式、HTML、PDF/A、可搜尋的PDF、CSV和文字(純文字)。
ABBYY FineReader是一款桌面應用程式,適用於Windows、Linux和macOS。 它還允許為PDF文件建立可編輯的格式。 我們也可以像Adobe Acrobat一樣閱讀PDF。 ABBYY FineReader將掃描文件整合到數位工作流程中。
以簡單有效的方式管理和完成文件,以節省時間和精力。 同樣的方法處理任何文件,無論是數位建立的還是從紙張轉換而來的。 您可以改變PDF中的文字、表格和完整布局,而無需先進行轉換。
ABBYY FineReader PDF可以從超過25種不同的文件格式中建立PDF,直接從紙質文件或通過幾乎任何應用程式的PDF列印機列印。 支持PDF/A-1至PDF/A-3進行長期存檔,PDF/UA保證在使用輔助軟體如螢幕閱讀器時內容是可存取的。 它還使專業人員能夠在數位工作場所中最大限度地提高效率。
使用ABBYY FineReader建立和更新您自己的互動式PDF表單,以成功收集資訊和標準化文件。 通過結合各種型別的互動字段、設置動作、編輯現有的PDF表單或在常規PDF中新增表單元素建立表單。
ABBYY FineReader能夠即刻將紙質文件、掃描和掃描的PDF轉換為可搜尋的PDF,允許您從數位檔案中檢索文件並進入它們所包含的資訊。 FineReader PDF支持所有合規級別和PDF/A格式的變體,這是業界標準的長期存檔方式,從PDF/A-1到PDF/A-3。
ABBYY最新的基於AI的OCR技術FineReader PDF使得以相同的工作流程數位化、檢索、編輯、保護、分享和合作處理各類文件變得更加容易。 FineReader還包括文件比較功能,這有助於我們比較原始文件以及轉換的PDF和圖像文件。
1.2 IronOCR — 簡介與功能
IronOCR提供的軟體供工程師們在.NET應用程式和網站中使用IronOCR for .NET來從照片和PDF中提取文字內容。 它掃描照片中的文字和條碼,支持多種全球語言; 然後可以將輸出以純文字或結構化資料的形式提供。 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. 在Visual Studio中建立新項目
打開Visual Studio軟體,進入"文件選單"。 選擇"新建專案",然後選擇"控制台應用程式"。
在相應的文字框中輸入專案名稱並選擇文件路徑。 然後,點擊建立按鈕並選擇所需的.NET Framework,如下圖所示。
Visual Studio專案將立即為所選的應用程式生成結構。 如果您選擇了控制台、Windows和網路應用程式,將會開啟Program.cs文件,您可以在其中輸入程式碼並構建/運行應用程式。
接下來,我們可以新增程式庫以測試程式碼。
3. 安裝
3.1 安裝ABBYY FineReader PDF
我們可以在這裡下載ABBYY FineReader。
上圖顯示有兩個版本,個人版和企業版,您可以根據需求下載。 選擇"下載免費試用"選項。 系統會將您重定向到如下圖所示的表單。
我們需要填寫表單以獲取EXE文件的位置。 點擊下載選項以下載文件。
文件下載完成後,我們可以雙擊EXE文件開始安裝。 完成後,它會顯示一個彈出消息,然後我們可以開始使用。
3.2 安裝IronOCR
IronOCR程式庫可以通過四種方式下載和安裝。
這些是:
- 使用Visual Studio
- 使用Visual Studio命令行
- 從NuGet網站直接下載
- 從IronPDF網站直接下載
3.2.1 使用Visual Studio
Visual Studio軟體提供NuGet Package Manager選項,允許將套件直接安裝到解決方案中。 下圖顯示如何打開NuGet Package Manager。
它提供了一個搜索框,用於顯示來自NuGet網站的套件列表。在套件管理器中,我們需要搜索關鍵字IronOCR,如下圖所示:
在上圖中,我們將獲得相關搜索項目的列表。 我們需要選擇所需的選項以將套件安裝到解決方案中。
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. OCR圖像
IronOCR和ABBYY FineReader都有將圖像轉換為文字的OCR技術。
4.1 使用ABBYY FineReader PDF
接下來,打開ABBYY FineReader PDF應用程式,它會彈出多個選項,如下圖所示。
接下來,從OCR編輯器選項中選擇"打開"選項。 這將彈出一個選項來選擇圖像文件:
選擇文件後,它將自動開始掃描圖像並轉換為可編輯的文字,然後在窗口中顯示結果,如下圖所示:
上圖顯示源圖像已轉換為可編輯文字。 然而,結果並不太精確。 ABBYY FineReader PDF應用並未識別出一些數字。這在比較窗口中顯示得很明顯——左側是源圖像,右側是OCR轉換的文字。
4.2 使用IronOCR
// Create an instance of IronTesseract for OCR operations
var Ocr = new IronTesseract();
// Configure OCR language and Tesseract version
Ocr.Language = OcrLanguage.EnglishBest;
Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5;
// Create a new OcrInput object to manage input images
using (var Input = new OcrInput())
{
// Add an image to the input for processing
Input.AddImage(@"3.png");
// Perform OCR to read text from the image
var Result = Ocr.Read(Input);
// Output the extracted text to the console
Console.WriteLine(Result.Text);
Console.ReadKey();
}
// Create an instance of IronTesseract for OCR operations
var Ocr = new IronTesseract();
// Configure OCR language and Tesseract version
Ocr.Language = OcrLanguage.EnglishBest;
Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5;
// Create a new OcrInput object to manage input images
using (var Input = new OcrInput())
{
// Add an image to the input for processing
Input.AddImage(@"3.png");
// Perform OCR to read text from the image
var Result = Ocr.Read(Input);
// Output the extracted text to the console
Console.WriteLine(Result.Text);
Console.ReadKey();
}
' Create an instance of IronTesseract for OCR operations
Dim Ocr = New IronTesseract()
' Configure OCR language and Tesseract version
Ocr.Language = OcrLanguage.EnglishBest
Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5
' Create a new OcrInput object to manage input images
Using Input = New OcrInput()
' Add an image to the input for processing
Input.AddImage("3.png")
' Perform OCR to read text from the image
Dim Result = Ocr.Read(Input)
' Output the extracted text to the console
Console.WriteLine(Result.Text)
Console.ReadKey()
End Using
Tesseract 5 API允許我們將圖像文件轉換為文字,如上所示。 我們在上面程式碼片段中建立了IronTesseract的實例。 我們還使用了一個OcrInput物件,它可以允許我們新增一個或多個圖像文件。 使用OcrInput物件方法AddImage時,我們必須在程式碼內提供可用圖像的路徑。 可以新增任意數量的圖像。 在我們之前構建的Read函式可用於執行OCR,通過解析圖像文件並將結果提取到OCR結果中。 它能夠從圖像中提取文字並將其轉換為字串。
我們還可以使用Tesseract新增多幀圖像。 AddMultiFrameTiff是此操作的另一種方法。 Tesseract程式庫讀取圖像中的每幀,並將每幀視作為獨立的頁面。 此過程將讀取圖像的第一幀,然後移至下一幀,以此類推,直到掃描完圖像的所有幀。 此方法僅支援tiff圖像格式。
上圖是IronOCR結果的輸出,顯示資料正確地轉換為可編輯的文字,結果精確無誤。
5. OCR PDF文件
IronOCR和ABBYY FineReader PDF有助於將PDF文件轉換為可編輯文字。 ABBYY FineReader PDF向使用者提供了一系列選項,例如保存頁面、編輯圖像、識別頁面等。它還提供txt、文件、HTML格式等保存選項。IronOCR還允許我們將轉換的OCR文件保存成為HTML、txt、pdf等格式。
5.1 使用ABBYY FineReader PDF
打開ABBYY FineReader PDF軟體。 這將打開一個頁面,如下圖所示,提供多個選項。
接下來,從OCR編輯器選項中選擇"打開"選項。 這將提示選擇圖像/PDF的選項。 我們可以選擇PDF或圖像,或者兩者都選擇。
選擇文件後,點擊確定按鈕。 它會自動開始掃描圖片並轉換成可編輯的文字,並在窗口中顯示結果,如下圖所示。
上圖顯示源PDF已轉換為可編輯文字。 然而,結果並不完全準確。 ABBYY FineReader PDF應用未識別出一些數字。 這在比較窗口中顯示得很明顯——左側是源PDF,右側是OCR轉換的文字。
5.2 使用IronOCR
我們還可以使用OCRInput來管理PDF文件。 Iron Tesseract類將讀取文件的每一頁。 然後從頁面中提取文字。 我們還可以使用名為AddPdf的第二個功能來打開保護的文件,這允許我們將PDF新增到我們的文件清單中(如果受到保護,則提供密碼)。 以下程式碼演示如何打開受密碼保護的PDF文件:
// Create an instance of IronTesseract for OCR operations
var Ocr = new IronTesseract();
// Create OcrInput to manage input PDFs
using (var Input = new OcrInput())
{
// Add a password-protected PDF to the input
Input.AddPdf("example.pdf", "password");
// Perform OCR to read text from the PDF
var Result = Ocr.Read(Input);
// Output the extracted text to the console
Console.WriteLine(Result.Text);
}
// Create an instance of IronTesseract for OCR operations
var Ocr = new IronTesseract();
// Create OcrInput to manage input PDFs
using (var Input = new OcrInput())
{
// Add a password-protected PDF to the input
Input.AddPdf("example.pdf", "password");
// Perform OCR to read text from the PDF
var Result = Ocr.Read(Input);
// Output the extracted text to the console
Console.WriteLine(Result.Text);
}
' Create an instance of IronTesseract for OCR operations
Dim Ocr = New IronTesseract()
' Create OcrInput to manage input PDFs
Using Input = New OcrInput()
' Add a password-protected PDF to the input
Input.AddPdf("example.pdf", "password")
' Perform OCR to read text from the PDF
Dim Result = Ocr.Read(Input)
' Output the extracted text to the console
Console.WriteLine(Result.Text)
End Using
Iron Tesseract還提供以下方法:
AddPdfPageAddPdfPages
我們可以使用AddPdfPage從PDF文件的單頁中讀取並提取內容。 只需要指定希望提取文字的頁碼。 AddPdfPages允許我們從多個指定的頁面中提取文字。 在IEnumerable<int>中,我們只需要指定頁數。 我們還必須包括文件的位置以及文件的擴展名。在以下程式碼範例中演示這一點:
// Define numbers representing pages to extract from the PDF
IEnumerable<int> numbers = new List<int> { 2, 8, 10 };
// Create an instance of IronTesseract for OCR operations
var Ocr = new IronTesseract();
// Create OcrInput to manage input PDFs
using (var Input = new OcrInput())
{
// Add a specific page from PDF for OCR
// Input.AddPdfPage("example.pdf", 10);
// Add multiple specific pages from PDF for OCR
// Input.AddPdfPages("example.pdf", numbers);
// Perform OCR to read text from the specified pages
var Result = Ocr.Read(Input);
// Output the extracted text to the console
Console.WriteLine(Result.Text);
// Save the extracted text to a file
Result.SaveAsTextFile("ocrtext.txt");
}
// Define numbers representing pages to extract from the PDF
IEnumerable<int> numbers = new List<int> { 2, 8, 10 };
// Create an instance of IronTesseract for OCR operations
var Ocr = new IronTesseract();
// Create OcrInput to manage input PDFs
using (var Input = new OcrInput())
{
// Add a specific page from PDF for OCR
// Input.AddPdfPage("example.pdf", 10);
// Add multiple specific pages from PDF for OCR
// Input.AddPdfPages("example.pdf", numbers);
// Perform OCR to read text from the specified pages
var Result = Ocr.Read(Input);
// Output the extracted text to the console
Console.WriteLine(Result.Text);
// Save the extracted text to a file
Result.SaveAsTextFile("ocrtext.txt");
}
' Define numbers representing pages to extract from the PDF
Dim numbers As IEnumerable(Of Integer) = New List(Of Integer) From {2, 8, 10}
' Create an instance of IronTesseract for OCR operations
Dim Ocr = New IronTesseract()
' Create OcrInput to manage input PDFs
Using Input = New OcrInput()
' Add a specific page from PDF for OCR
' Input.AddPdfPage("example.pdf", 10);
' Add multiple specific pages from PDF for OCR
' Input.AddPdfPages("example.pdf", numbers);
' Perform OCR to read text from the specified pages
Dim Result = Ocr.Read(Input)
' Output the extracted text to the console
Console.WriteLine(Result.Text)
' Save the extracted text to a file
Result.SaveAsTextFile("ocrtext.txt")
End Using
使用SaveAsTextFile功能,我們可以將結果儲存為文字文件,並將文件下載到輸出目錄路徑。 此外,我們可以使用SaveAsHocrFile將文件保存為HTML文件。
6. 其他功能
6.1 使用ABBYY FineReader PDF
FineReader還有一些其他選項,例如:繪製文字區域、繪製圖片區域、繪製表格區域、_繪製識別區域_等。這些有助於使用者提高OCR的性能。 此外,在進行OCR的同時,此應用程式還允許使用者完成合併PDF、拆分PDF、編輯PDF等操作。
6.2 使用IronOCR
IronOCR具有獨特的功能,允許我們從掃描的文件中讀取條碼和QR碼。 下面的程式碼顯示了我們如何從給定的圖像或文件中讀取條碼。
// Create an instance of IronTesseract for OCR operations
var Ocr = new IronTesseract();
// Configure OCR language and barcode reading
Ocr.Language = OcrLanguage.EnglishBest;
Ocr.Configuration.ReadBarCodes = true;
Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5;
// Create OcrInput to manage input images
using (var Input = new OcrInput())
{
// Add an image containing barcodes
Input.AddImage("barcode.gif");
// Perform OCR to read text and barcodes from the image
var Result = Ocr.Read(Input);
// Iterate through detected barcodes and output their values
foreach (var Barcode in Result.Barcodes)
{
Console.WriteLine(Barcode.Value);
}
}
// Create an instance of IronTesseract for OCR operations
var Ocr = new IronTesseract();
// Configure OCR language and barcode reading
Ocr.Language = OcrLanguage.EnglishBest;
Ocr.Configuration.ReadBarCodes = true;
Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5;
// Create OcrInput to manage input images
using (var Input = new OcrInput())
{
// Add an image containing barcodes
Input.AddImage("barcode.gif");
// Perform OCR to read text and barcodes from the image
var Result = Ocr.Read(Input);
// Iterate through detected barcodes and output their values
foreach (var Barcode in Result.Barcodes)
{
Console.WriteLine(Barcode.Value);
}
}
' Create an instance of IronTesseract for OCR operations
Dim Ocr = New IronTesseract()
' Configure OCR language and barcode reading
Ocr.Language = OcrLanguage.EnglishBest
Ocr.Configuration.ReadBarCodes = True
Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5
' Create OcrInput to manage input images
Using Input = New OcrInput()
' Add an image containing barcodes
Input.AddImage("barcode.gif")
' Perform OCR to read text and barcodes from the image
Dim Result = Ocr.Read(Input)
' Iterate through detected barcodes and output their values
For Each Barcode In Result.Barcodes
Console.WriteLine(Barcode.Value)
Next Barcode
End Using
上面的程式碼幫助讀取給定圖像或PDF文件中的條碼。 它能夠從一頁/圖像中讀取多個條碼。 為了讀取條碼,IronOCR有一個獨特的設置Ocr.Configuration.ReadBarCodes,這有助於讀取條碼; 預設值設為false。
讀取輸入後,資料將保存到名為OCRResult的物件中; 此物件有一個名為Barcodes的屬性,它將所有可用的條碼資料整合到一個列表中。使用foreach迴圈,我們可以逐一獲取所有條碼的詳細資訊。 此外,它將掃描條碼並讀取條碼的值——在一個過程中完成兩個操作!
此外,還支持執行緒選項,這意味著我們可以同時執行多個OCR過程。IronOCR還能夠識別指定區域的特定區域。
// Create an instance of IronTesseract for OCR operations
var Ocr = new IronTesseract();
// Create OcrInput to manage input images
using (var Input = new OcrInput())
{
// Define a specific rectangular area on the image for OCR
var ContentArea = new System.Drawing.Rectangle() { X = 215, Y = 1250, Height = 280, Width = 1335 };
// Add an image specifying the area to be processed
Input.Add("document.png", ContentArea);
// Perform OCR to read text from the specified area
var Result = Ocr.Read(Input);
// Output the extracted text to the console
Console.WriteLine(Result.Text);
}
// Create an instance of IronTesseract for OCR operations
var Ocr = new IronTesseract();
// Create OcrInput to manage input images
using (var Input = new OcrInput())
{
// Define a specific rectangular area on the image for OCR
var ContentArea = new System.Drawing.Rectangle() { X = 215, Y = 1250, Height = 280, Width = 1335 };
// Add an image specifying the area to be processed
Input.Add("document.png", ContentArea);
// Perform OCR to read text from the specified area
var Result = Ocr.Read(Input);
// Output the extracted text to the console
Console.WriteLine(Result.Text);
}
' Create an instance of IronTesseract for OCR operations
Dim Ocr = New IronTesseract()
' Create OcrInput to manage input images
Using Input = New OcrInput()
' Define a specific rectangular area on the image for OCR
Dim ContentArea = New System.Drawing.Rectangle() With {
.X = 215,
.Y = 1250,
.Height = 280,
.Width = 1335
}
' Add an image specifying the area to be processed
Input.Add("document.png", ContentArea)
' Perform OCR to read text from the specified area
Dim Result = Ocr.Read(Input)
' Output the extracted text to the console
Console.WriteLine(Result.Text)
End Using
以上是一個對特定區域進行OCR的樣本程式碼。 我們只需指定圖像或PDF上的矩形區域——IronOCR中的Tesseract引擎可實現文字識別。
7. 結論
在.NET Framework環境中使用IronOCR,Tesseract操作簡單且易於使用。 它以各種方式支持照片和PDF文件。 它還提供多種設置以提高Tesseract OCR程式庫的性能。 除了支持多種語言外,它還支持在單個操作中處理多種語言。 要了解更多關於Tesseract OCR的資訊,請存取他們的網站。
ABBYY FineReader PDF是一款使用人工智慧引擎來識別圖像/PDF文件的軟體應用程式。 它還提供多種設置以提高OCR過程的性能。 此外,它還提供了選擇多種語言的選項。 ABBYY FineReader PDF在頁面轉換的使用上有一些限制。 不同的操作系統有不同的價格。 如需了解更多關於ABBYY FineReader PDF價格詳情,請點擊這裡。
在我們的測試中,IronOCR展示出比ABBYY FineReader PDF更強的性能。 在本比較中提出的具體測試案例中,FineReader對低質量圖像中的某些字元和數字識別不夠準確,而IronOCR對那些特定場景提供了更準確的結果。 IronOCR還提供額外功能,能夠識別條碼資料並從圖像中讀取條碼值。 IronOCR套件提供了終身許可,並且不會有持續費用。 IronOCR套件在一個價格中支持多個平台。欲了解更多IronOCR價格詳情,請點擊這裡。
常見問題
是什麼讓 IronOCR 成為 ABBYY FineReader 的卓越替代品?
IronOCR 被認為優越是因其準確的 OCR 性能、處理低品質圖像的能力以及全面的功能,如讀取條形碼和 QR Code。它還提供無需經常性成本的永久授權,使其具有成本效益。
IronOCR 如何處理低品質圖像?
IronOCR 提供先進的圖像校正功能,可以提升低解析度或低品質掃描圖像的品質,從而提高 OCR 結果的準確性。
IronOCR 支持哪些平台?
IronOCR 支援多個平台,包括 Windows、Linux 和 macOS,並提供單一永久授權。
IronOCR 能對條形碼執行 OCR 嗎?
是的,IronOCR 能夠透過配置程式庫以檢測和提取條形碼值來從圖像中讀取條形碼。
using IronOCR 的多執行緒功能有什麼好處?
IronOCR 的多執行緒功能允許多個 OCR 處理同時運行,大大提高性能和處理速度。
IronOCR 支援哪些語言?
IronOCR 支援125種不同語言的OCR,讓它成為一個多用途的全球應用工具。
IronOCR 的授權與 ABBYY FineReader 的授權比較如何?
IronOCR 提供無需經常性成本的永久授權,而 ABBYY FineReader 的定價可能會根據操作系統而有所變動,並且可能涉及持續費用。
如何將 IronOCR 整合到我的 C# 專案中?
您可以使用 Visual Studio、Visual Studio 命令列或從 NuGet 網站下載來將 IronOCR 整合到您的 C# 專案中。
using IronOCR 可以轉換哪些文件格式?
IronOCR 可以將圖像和 PDF 轉換為各種可編輯格式,包括 Microsoft Word、Excel 和可搜索的 PDF。
為什麼 IronOCR 更適合讀取 QR Code?
IronOCR 由於其高準確性和穩健的功能組而在讀取 QR Code 時受到青睞,功能包括處理範圍廣泛的圖像格式和品質等級。

