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

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

  • パンジャブ語
  • パンジャビベスト
  • パンジャビファスト

ダウンロード

パンジャブ語言語パック[パンジャブ語]

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

インストール

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

Install-Package IronOCR.Languages.Panjabi

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();

        // Set the language to Panjabi
        Ocr.Language = OcrLanguage.Panjabi;

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

            // Extract and store the recognized text from the OCR result
            var AllText = Result.Text;
        }
    }
}
// Import the IronOcr namespace
using IronOcr;

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

        // Set the language to Panjabi
        Ocr.Language = OcrLanguage.Panjabi;

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

            // Extract and store the recognized text from the OCR result
            var AllText = Result.Text;
        }
    }
}
' Import the IronOcr namespace
Imports IronOcr

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

		' Set the language to Panjabi
		Ocr.Language = OcrLanguage.Panjabi

		' Define the input image or PDF file
		Using Input = New OcrInput("images\Panjabi.png")
			' Perform OCR on the input file
			Dim Result = Ocr.Read(Input)

			' Extract and store the recognized text from the OCR result
			Dim AllText = Result.Text
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

説明

  • IronTesseract : これは、OCR 操作用に IronOCR によって提供されるメイン クラスです。
  • Ocr.Language : OCR エンジンが使用する言語を指定します。 ここでは、パンジャブ語に設定されています。
  • OcrInput : このクラスは、OCR を実行する必要がある入力ファイル (画像または PDF) を指定するために使用されます。
  • Ocr.Read() : このメソッドは実際の OCR タスクを実行し、抽出されたテキストを含む結果を返します。
  • Result.Text : 入力ファイルに対して OCR を実行した後に抽出されたテキストが含まれます。

この例では、IronOCR ライブラリを効果的に使用して、.NET アプリケーション内の画像または PDF ドキュメントからパンジャブ語のテキストを抽出する方法を示します。