Hungarian 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的內容。語言。匈牙利語

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

  • 匈牙利語
  • 匈牙利最佳
  • 匈牙利快餐

下載

匈牙利語語言包[magyar]

安裝

我們首先需要做的是將我們的匈牙利語OCR 套件安裝到您的.NET專案中。

Install-Package IronOcr.Languages.Hungarian

程式碼範例

這段 C# 程式碼範例從圖像或 PDF 文件中讀取匈牙利文文字。

// First, ensure you have installed the Hungarian OCR language pack
// via NuGet: Install-Package IronOcr.Languages.Hungarian

using IronOcr;

var Ocr = new IronTesseract();

// Set the OCR language to Hungarian.
Ocr.Language = OcrLanguage.Hungarian;

// Load the image file containing Hungarian text
using (var Input = new OcrInput(@"images\Hungarian.png"))
{
    // Perform OCR on the input image
    var Result = Ocr.Read(Input);

    // Retrieve and store the recognized text
    var AllText = Result.Text;

    // Output the recognized text to the console (for debugging purposes)
    Console.WriteLine(AllText);
}
// First, ensure you have installed the Hungarian OCR language pack
// via NuGet: Install-Package IronOcr.Languages.Hungarian

using IronOcr;

var Ocr = new IronTesseract();

// Set the OCR language to Hungarian.
Ocr.Language = OcrLanguage.Hungarian;

// Load the image file containing Hungarian text
using (var Input = new OcrInput(@"images\Hungarian.png"))
{
    // Perform OCR on the input image
    var Result = Ocr.Read(Input);

    // Retrieve and store the recognized text
    var AllText = Result.Text;

    // Output the recognized text to the console (for debugging purposes)
    Console.WriteLine(AllText);
}
$vbLabelText   $csharpLabel

這段程式碼示範如何使用IronOCR庫設定 OCR 閱讀器,以識別指定圖像檔案中的匈牙利文字。提取的文字儲存在 AllText 變數中,可根據需要在應用程式中使用。 此範例還包括一個可選的控制台輸出,用於在測試期間驗證 OCR 結果。