C# と .NET でのスンダ語 OCR

This article was translated from English: Does it need improvement?
Translated
View the article in English
Other versions of this document:

*スンダ語

IronOCR は、.NET コーダーがスンダ語を含む 126 の言語で画像や PDF ドキュメントからテキストを読み取ることを可能にする C# ソフトウェア コンポーネントです。

これはTesseractの高度なフォークであり、.NET開発者専用に構築され、速度と精度の両方で他のTesseractエンジンを定期的に上回ります。

IronOcr.Languages.Sundanese の内容

このパッケージには、.NET 用の 52 の OCR 言語が含まれています。

  • スンダ語
  • スンダベスト
  • スンダファースト

ダウンロード

スンダ語言語パック[スンダ語]

  • Zip形式でダウンロード
  • NuGetでインストール

インストール

最初に、 Sundanese OCR パッケージを .NET プロジェクトにインストールする必要があります。

Install-Package IronOCR.Languages.Sundanese

Code Example

この C# コード例は、画像または PDF ドキュメントからスンダ語のテキストを読み取ります。

// Import the IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Create a new instance of the IronTesseract class
        var Ocr = new IronTesseract();

        // Specify the language the OCR engine should use
        Ocr.Language = OcrLanguage.Sundanese;

        // Initialize the OCR input with an image file containing Sundanese text
        using (var Input = new OcrInput(@"images\Sundanese.png"))
        {
            // Process the input and get the result
            var Result = Ocr.Read(Input);

            // Extract all recognized text from the result
            var AllText = Result.Text;

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

class Program
{
    static void Main()
    {
        // Create a new instance of the IronTesseract class
        var Ocr = new IronTesseract();

        // Specify the language the OCR engine should use
        Ocr.Language = OcrLanguage.Sundanese;

        // Initialize the OCR input with an image file containing Sundanese text
        using (var Input = new OcrInput(@"images\Sundanese.png"))
        {
            // Process the input and get the result
            var Result = Ocr.Read(Input);

            // Extract all recognized text from the result
            var AllText = Result.Text;

            // Output the recognized text
            System.Console.WriteLine(AllText);
        }
    }
}
' Import the IronOcr namespace
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Create a new instance of the IronTesseract class
		Dim Ocr = New IronTesseract()

		' Specify the language the OCR engine should use
		Ocr.Language = OcrLanguage.Sundanese

		' Initialize the OCR input with an image file containing Sundanese text
		Using Input = New OcrInput("images\Sundanese.png")
			' Process the input and get the result
			Dim Result = Ocr.Read(Input)

			' Extract all recognized text from the result
			Dim AllText = Result.Text

			' Output the recognized text
			System.Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

説明

  • OCR 機能を使用するには、まずIronOcr名前空間をインポートします。
  • メインの OCR エンジンとして機能するIronTesseractのインスタンスが作成されます。
  • エンジンがスンダ語のテキストを読み取ることを指定するには、 LanguageプロパティをOcrLanguage.Sundaneseに設定します。
  • OCR エンジンの画像ファイル ソースを指定するために、 OcrInputオブジェクトを作成します。
  • Readメソッドは入力を処理し、テキストを認識しようとします。
  • 認識されたテキストはAllText変数に保存され、その後コンソールに出力されます。

この設定により、.NET 環境で IronOCR ライブラリを使用して、画像からスンダ語のテキストを堅牢に認識できるようになります。