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# ソフトウェア コンポーネントです。

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

IronOcr.Languages.Catalan の内容

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

  • カタロニア語
  • カタロニア語ベスト
  • カタランファスト

ダウンロード

カタロニア語言語パック[català]

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

インストール

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

Install-Package IronOCR.Languages.Catalan

Code Example

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

// Import the IronOcr namespace to use its OCR functionality
using IronOcr;

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

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

        // Define the input image or PDF from which you want to read the text
        using (var Input = new OcrInput(@"images\Catalan.png"))
        {
            // Perform OCR reading on the input
            var Result = Ocr.Read(Input);

            // Retrieve all recognized text
            var AllText = Result.Text;

            // Output the recognized text
            Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr namespace to use its OCR functionality
using IronOcr;

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

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

        // Define the input image or PDF from which you want to read the text
        using (var Input = new OcrInput(@"images\Catalan.png"))
        {
            // Perform OCR reading on the input
            var Result = Ocr.Read(Input);

            // Retrieve all recognized text
            var AllText = Result.Text;

            // Output the recognized text
            Console.WriteLine(AllText);
        }
    }
}
' Import the IronOcr namespace to use its OCR functionality
Imports IronOcr

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

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

		' Define the input image or PDF from which you want to read the text
		Using Input = New OcrInput("images\Catalan.png")
			' Perform OCR reading on the input
			Dim Result = Ocr.Read(Input)

			' Retrieve all recognized text
			Dim AllText = Result.Text

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

このコードでは:

  • OCR 操作を処理するためにIronTesseractのインスタンスを作成します。
  • Ocr.Languageはカタロニア語として指定されており、OCR エンジンはカタロニア語モデルを使用して画像を処理する必要があることを示しています。
  • OcrInputを使用して、画像または PDF ドキュメントのファイル パスを指定します。
  • Ocrオブジェクトに対してReadメソッドが呼び出され、OCR 読み取り結果が変数Resultに格納されます。
  • 最後に、 Result.Textには認識されたテキストが含まれ、コンソールに出力されます。