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 程式設計師能夠從 126 種語言的圖片和 PDF 文件中讀取文字,其中包含希臘字母。

這是 Tesseract 的進階分支版本,專為 .NET 開發人員打造,無論在速度或精準度方面,表現均定期優於其他 Tesseract 引擎。

IronOcr.Languages.Greek 內容

此套件包含 102 種適用於 .NET 的 OCR 語言:

  • 希臘文
  • 希臘文Best
  • 希臘文Fast
  • 希臘字母
  • 希臘字母Best
  • 希臘字母Fast

下載

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

安裝

第一步是將希臘字母 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.Co/nsole.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.Co/nsole.WriteLine(AllText);
        }
    }
}
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
$vbLabelText   $csharpLabel
  • IronTesseract:此類別負責執行 OCR 操作。
  • OcrInput:此類別用於載入圖像或 PDF 檔案以進行 OCR 處理。
  • Ocr.Read(): 用於對輸入資料執行 OCR 並提供辨識文字的方法。

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