Estonian OCR in C# and .NET
This article was translated from English: Does it need improvement?
Translated
View the article in English
本文件的其他版本:
IronOCR 是一款 C# 軟體元件,讓 .NET 開發人員能夠從 126 種語言(包括愛沙尼亞語)的圖片和 PDF 文件中讀取文字。 這是 Tesseract 的進階分支版本,專為 .NET 開發人員打造,無論在速度或準確度方面,其表現均經常優於其他 Tesseract 引擎。
IronOcr.Languages.Estonian 的內容
此套件包含以下適用於 .NET 的 OCR 語言:
- 愛沙尼亞語
- 愛沙尼亞語Best
- 愛沙尼亞語Fast
下載
愛沙尼亞語語言套件 [eesti]
安裝
我們首先必須將愛沙尼亞語 OCR 套件安裝至您的 .NET 專案中。
Install-Package IronOcr.Languages.Estonian
程式碼範例
此 C# 程式碼範例用於從圖片或 PDF 文件中讀取愛沙尼亞語文字。
// Import the IronOcr namespace
using IronOcr;
// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();
// Set the OCR language to Estonian
Ocr.Language = OcrLanguage.Estonian;
// Load the image or PDF from which text needs to be extracted
using (var Input = new OcrInput(@"images\Estonian.png"))
{
// Perform OCR to read text from the specified input
var Result = Ocr.Read(Input);
// Extract all the recognized text from the OCR result
var AllText = Result.Text;
}
// Import the IronOcr namespace
using IronOcr;
// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();
// Set the OCR language to Estonian
Ocr.Language = OcrLanguage.Estonian;
// Load the image or PDF from which text needs to be extracted
using (var Input = new OcrInput(@"images\Estonian.png"))
{
// Perform OCR to read text from the specified input
var Result = Ocr.Read(Input);
// Extract all the recognized text from the OCR result
var AllText = Result.Text;
}
' Import the IronOcr namespace
Imports IronOcr
' Create a new instance of the IronTesseract class
Private Ocr = New IronTesseract()
' Set the OCR language to Estonian
Ocr.Language = OcrLanguage.Estonian
' Load the image or PDF from which text needs to be extracted
Using Input = New OcrInput("images\Estonian.png")
' Perform OCR to read text from the specified input
Dim Result = Ocr.Read(Input)
' Extract all the recognized text from the OCR result
Dim AllText = Result.Text
End Using
$vbLabelText
$csharpLabel
程式碼說明:
- IronTesseract:這是 IronOCR 提供的主要類別,用於執行 OCR 操作。
- Ocr.Language:透過設定此屬性,我們可指定 OCR 過程中應使用的語言。 此處設定為愛沙尼亞語。
- OcrInput:用於指定要讀取的圖像或 PDF 文件。 它接受檔案路徑作為輸入。
- Ocr.Read(Input):此方法會處理指定的輸入內容,並對其執行 OCR 處理。
- Result.Text:此屬性包含所有已從圖片或 PDF 文件中成功識別並擷取的文字。

