C# 與 .NET 中的希臘字母 OCR
Curtis Chau
已更新: 2026年8月2日
本文檔的其他版本:
IronOCR 是一個 C# 軟體元件,允許 .NET 程式設計師從圖像和 PDF 文件中讀取 126 種語言(包括希臘字母)的文字。
它是 Tesseract 的一個高級分支,專為 .NET 開發人員構建,在速度和準確性方面通常優於其他 Tesseract 引擎。
IronOcr.Languages.Greek 的內容
此軟體包包含 102 種適用於 .NET 的 OCR 語言:
- Greek
- GreekBest
- GreekFast
- GreekAlphabet
- GreekAlphabetBest
- GreekAlphabetFast
下載
希臘字母語言包[ελληνικά]
安裝
第一步是將希臘字母OCR 套件安裝到您的 .NET 專案中。
程式碼範例
這段 C# 程式碼範例從圖像或 PDF 文件中讀取希臘字母文字。
// Import the IronOcr namespace
using IronOcr;
class GreekOcrExample
{
static void Main()
{
// Initialize the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the OCR language to Greek
Ocr.Language = OcrLanguage.Greek;
// Load the image or PDF containing Greek text
using (var Input = new OcrInput(@"images\Greek.png"))
{
// Perform OCR and get the result
var Result = Ocr.Read(Input);
// Extract all recognized text
var AllText = Result.Text;
// Output the recognized text
System.Console.WriteLine(AllText);
}
}
}' Import the IronOcr namespace
Imports IronOcr
Class GreekOcrExample
Shared Sub Main()
' Initialize the IronTesseract OCR engine
Dim Ocr As New IronTesseract()
' Set the OCR language to Greek
Ocr.Language = OcrLanguage.Greek
' Load the image or PDF containing Greek text
Using Input As New OcrInput("images\Greek.png")
' Perform OCR and get the result
Dim Result = Ocr.Read(Input)
' Extract all recognized text
Dim AllText = Result.Text
' Output the recognized text
System.Console.WriteLine(AllText)
End Using
End Sub
End Class' Import the IronOcr namespace
Imports IronOcr
Class GreekOcrExample
Shared Sub Main()
' Initialize the IronTesseract OCR engine
Dim Ocr As New IronTesseract()
' Set the OCR language to Greek
Ocr.Language = OcrLanguage.Greek
' Load the image or PDF containing Greek text
Using Input As New OcrInput("images\Greek.png")
' Perform OCR and get the result
Dim Result = Ocr.Read(Input)
' Extract all recognized text
Dim AllText = Result.Text
' Output the recognized text
System.Console.WriteLine(AllText)
End Using
End Sub
End Class- IronTesseract: 此類別負責執行OCR操作。
- OcrInput: 此類別用於載入要進行OCR處理的影像或PDF文件。
Ocr.Read(): 方法,用於對輸入資料執行 OCR 並提供辨識出的文字。
在執行此程式碼之前,請確保您的 .NET 專案中已正確安裝 IronOCR 程式庫及希臘語語言套件。此程式碼將輸出從位於 images/Greek.png 的圖像中擷取出的文字。
Curtis Chau 擁有卡爾頓大學計算機科學學士學位,專注於前端開發,擅長於 Node.js、TypeScript、JavaScript 和 React。Curtis 熱衷於創建直觀且美觀的用戶界面,喜歡使用現代框架並打造結構良好、視覺吸引人的手冊。