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

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

  • タジク語
  • タジク語ベスト
  • タジクファスト

ダウンロード

タジク語言語パック[タジク語]

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

インストール

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

Install-Package IronOCR.Languages.Tajik

Code Example

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

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

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

        // Specify the language to use for OCR as Tajik
        Ocr.Language = OcrLanguage.Tajik;

        // Load the image file where the OCR is to be performed
        using (var Input = new OcrInput(@"images\Tajik.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

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

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

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

        // Specify the language to use for OCR as Tajik
        Ocr.Language = OcrLanguage.Tajik;

        // Load the image file where the OCR is to be performed
        using (var Input = new OcrInput(@"images\Tajik.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

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

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

Friend Class Program
	Shared Sub Main()
		' Create an instance of IronTesseract engine
		Dim Ocr = New IronTesseract()

		' Specify the language to use for OCR as Tajik
		Ocr.Language = OcrLanguage.Tajik

		' Load the image file where the OCR is to be performed
		Using Input = New OcrInput("images\Tajik.png")
			' Perform OCR on the input image
			Dim Result = Ocr.Read(Input)

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

			' Output the text to the console
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
  • OCR 機能を使用するためにIronTesseractのインスタンスを作成します。
  • 言語プロパティをOcrLanguage.Tajikに設定して、OCR がタジク語で処理するように指定します。
  • テキストを抽出する必要がある入力画像を読み込みます。
  • Ocr.Readメソッドは画像を処理し、抽出されたテキストを含む結果を返します。
  • 結果のTextプロパティにアクセスして、画像内で検出されたすべてのテキストを取得します。