Maltese OCR in C# and .NET

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

比勒-馬耳他語 新增 125 種 OCR 語言

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

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

IronOCR的內容。語言。馬爾他語

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

  • 馬耳他語
  • MalteseBest
  • MalteseFast

下載

馬耳他語語言包 [Malti]

安裝

我們首先需要做的就是將我們的馬耳他語OCR 套件安裝到您的.NET專案中。

Install-Package IronOcr.Languages.Maltese

程式碼範例

這段 C# 程式碼範例從圖像或 PDF 文件中讀取馬耳他語文字。

// Import the IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize the IronTesseract OCR engine
        var Ocr = new IronTesseract();

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

        // Define the input image or PDF document
        using (var Input = new OcrInput(@"images\Maltese.png"))
        {
            // Perform OCR on the input and retrieve the result
            var Result = Ocr.Read(Input);

            // Get all the recognized text
            var AllText = Result.Text;

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

class Program
{
    static void Main()
    {
        // Initialize the IronTesseract OCR engine
        var Ocr = new IronTesseract();

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

        // Define the input image or PDF document
        using (var Input = new OcrInput(@"images\Maltese.png"))
        {
            // Perform OCR on the input and retrieve the result
            var Result = Ocr.Read(Input);

            // Get all the recognized text
            var AllText = Result.Text;

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

在這個例子中,IronTesseract OCR 引擎用於從名為 Maltese.png 的圖像檔案中讀取文字。 識別出的文字隨後會列印到控制台。 請確保圖像路徑正確,並且圖像檔案包含馬耳他語文本,以便 OCR 能夠有效運作。 using 語句確保資源在不再需要時妥善處置。