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.Irishの内容

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

  • アイルランド語
  • アイリッシュベスト
  • アイリッシュファースト

ダウンロード

アイルランド語パック[アイルランド語]

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

インストール

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

Install-Package IronOCR.Languages.Irish

Code Example

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

// Install the IronOCR Irish language package via NuGet:
// PM> Install-Package IronOCR.Languages.Irish

using IronOcr;

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

        // Set the language to Irish for OCR processing
        Ocr.Language = OcrLanguage.Irish;

        // Using the OCR input, specify the path to the image containing Irish text
        using (var Input = new OcrInput(@"images\Irish.png"))
        {
            // Perform OCR to read the Irish text from the image
            var Result = Ocr.Read(Input);

            // Get the recognized text as a string from the OCR result
            var AllText = Result.Text;

            // Output the recognized text
            Console.WriteLine(AllText);
        }
    }
}
// Install the IronOCR Irish language package via NuGet:
// PM> Install-Package IronOCR.Languages.Irish

using IronOcr;

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

        // Set the language to Irish for OCR processing
        Ocr.Language = OcrLanguage.Irish;

        // Using the OCR input, specify the path to the image containing Irish text
        using (var Input = new OcrInput(@"images\Irish.png"))
        {
            // Perform OCR to read the Irish text from the image
            var Result = Ocr.Read(Input);

            // Get the recognized text as a string from the OCR result
            var AllText = Result.Text;

            // Output the recognized text
            Console.WriteLine(AllText);
        }
    }
}
' Install the IronOCR Irish language package via NuGet:
' PM> Install-Package IronOCR.Languages.Irish

Imports IronOcr

Friend Class IrishOcrExample
	Shared Sub Main()
		' Create a new instance of the IronTesseract OCR engine
		Dim Ocr = New IronTesseract()

		' Set the language to Irish for OCR processing
		Ocr.Language = OcrLanguage.Irish

		' Using the OCR input, specify the path to the image containing Irish text
		Using Input = New OcrInput("images\Irish.png")
			' Perform OCR to read the Irish text from the image
			Dim Result = Ocr.Read(Input)

			' Get the recognized text as a string from the OCR result
			Dim AllText = Result.Text

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

この例では、IronOCR ライブラリの IronTesseract クラスを利用して、アイルランド語で書かれたテキストを含む画像に対して OCR を実行します。 OcrInputオブジェクトはイメージを読み込むために使用され、 Ocr.Readメソッドはイメージを処理してテキストを抽出します。 結果のテキストはAllText変数に保存され、コンソールに出力されます。