Western Frisian OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English

還有126種語言

IronOCR是一個 C# 軟體元件,允許.NET設計師從圖像和 PDF 文件中讀取 126 種語言的文本,包括西弗里斯蘭語。

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

IronOCR的內容。語言。西弗里西亞語

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

  • 西弗里西亞人
  • WesternFrisianBest
  • 西弗里斯蘭快餐

下載

西弗里斯蘭語語言包 [Frysk]

安裝

我們首先需要做的是將我們的西弗里西亞語OCR 套件安裝到您的.NET專案中。

Install-Package IronOcr.Languages.WesternFrisian

程式碼範例

這段 C# 程式碼範例從圖像或 PDF 文件中讀取西弗里西亞語文字。

// Import the IronOcr library
using IronOcr;

class WesternFrisianOcrExample
{
    static void Main()
    {
        // Create a new instance of IronTesseract, which is the OCR engine 
        var Ocr = new IronTesseract();

        // Set the language to Western Frisian
        Ocr.Language = OcrLanguage.WesternFrisian;

        // Perform OCR on a given image
        using (var Input = new OcrInput(@"images\WesternFrisian.png"))
        {
            // Read the input image and store the result
            var Result = Ocr.Read(Input);

            // Extract the text from the result
            string AllText = Result.Text;

            // Output the recognized text to the console
            System.Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr library
using IronOcr;

class WesternFrisianOcrExample
{
    static void Main()
    {
        // Create a new instance of IronTesseract, which is the OCR engine 
        var Ocr = new IronTesseract();

        // Set the language to Western Frisian
        Ocr.Language = OcrLanguage.WesternFrisian;

        // Perform OCR on a given image
        using (var Input = new OcrInput(@"images\WesternFrisian.png"))
        {
            // Read the input image and store the result
            var Result = Ocr.Read(Input);

            // Extract the text from the result
            string AllText = Result.Text;

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

在這個例子中,我們:

  • 初始化 OCR 引擎 IronTesseract
  • 將 OCR 流程設定為使用 OcrLanguage.WesternFrisian 語言選項識別西弗里西亞語文字。
  • 讀取位於路徑 images\WesternFrisian.png 的圖片檔案。
  • 將識別出的文字儲存在 AllText 中,並將其列印到控制台。