Greek Alphabet OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
本文檔的其他版本:

IronOCR是一個 C# 軟體元件,允許.NET設計師從圖像和 PDF 文件中讀取 126 種語言(包括希臘字母)的文字。

它是 Tesseract 的一個高級分支,專為.NET開發人員構建,在速度和準確性方面通常優於其他 Tesseract 引擎。

IronOCR的內容.語言.希臘語

此軟體包包含 102 種適用於.NET的 OCR 語言:

  • 希臘文
  • GreekBest
  • GreekFast
  • 希臘字母
  • GreekAlphabetBest
  • GreekAlphabetFast

下載

希臘字母語言包[ελληνικά]

安裝

第一步是將希臘字母OCR 套件安裝到您的.NET專案中。

Install-Package IronOcr.Languages.Greek

程式碼範例

這段 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
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);
        }
    }
}
$vbLabelText   $csharpLabel
  • IronTesseract :此類負責執行 OCR 操作。
  • OcrInput :此類用於載入影像或 PDF 檔案以進行 OCR 處理。
  • Ocr.Read() : 對輸入資料執行 OCR 並提供識別文字的方法。

在執行此程式碼之前,請確保IronOCR庫和希臘語語言套件已正確安裝在您的.NET專案中。 這段程式碼將輸出從位於 images/Greek.png 的圖像中提取的文字。