C# と .NET でのトンガ語 OCR

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

他126の言語

IronOCR は、.NET 開発者がトンガ語を含む 126 の言語で画像や PDF ドキュメントからテキストを読み取ることができる C# ソフトウェア コンポーネントです。 これは、.NET 開発者専用にカスタマイズされた Tesseract の高度なフォークであり、速度と精度の両方において他の Tesseract エンジンを常に上回っています。

IronOcr.Languages.Tonga の内容

このパッケージには、トンガ専用の 3 つの OCR 言語モデルが含まれています。

  • 到着した
  • トンガベスト
  • トンガファスト

ダウンロード

Tonga 言語パック [faka Tonga]

  • Zipファイルとしてダウンロードします。
  • NuGetを使用してインストールします。

インストール

Tonga OCR 機能の使用を開始するには、次の NuGet コマンドを使用して、Tonga OCR パッケージを .NET プロジェクトにインストールします。

Install-Package IronOCR.Languages.Tonga

Code Example

次の C# コード例は、IronOCR を使用して画像または PDF ドキュメントからトンガ語のテキストを読み取る方法を示しています。

// Include the necessary IronOcr namespace
using IronOcr;

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

        // Set the OCR engine to use the Tonga language pack
        Ocr.Language = OcrLanguage.Tonga;

        // Load the input image or PDF into OcrInput
        using (var Input = new OcrInput(@"images\Tonga.png"))
        {
            // Perform OCR to read the text from the image
            var Result = Ocr.Read(Input);

            // Retrieve the full text recognition result
            var AllText = Result.Text;

            // Output the result or process further as needed
            System.Console.WriteLine(AllText);
        }
    }
}
// Include the necessary IronOcr namespace
using IronOcr;

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

        // Set the OCR engine to use the Tonga language pack
        Ocr.Language = OcrLanguage.Tonga;

        // Load the input image or PDF into OcrInput
        using (var Input = new OcrInput(@"images\Tonga.png"))
        {
            // Perform OCR to read the text from the image
            var Result = Ocr.Read(Input);

            // Retrieve the full text recognition result
            var AllText = Result.Text;

            // Output the result or process further as needed
            System.Console.WriteLine(AllText);
        }
    }
}
$vbLabelText   $csharpLabel
  • このコード例は、IronTesseract OCR エンジンを初期化し、トンガ語を使用するように設定する方法を示しています。
  • 指定されたパスから画像をOcrInputオブジェクトに読み込みます。
  • Ocr.Read()メソッドは入力を処理してテキストを抽出し、 Result.Textプロパティを介して認識されたテキストを取得します。
  • 最後に、抽出されたテキストは、アプリケーション内で必要に応じて出力または処理できます。