C# と .NET での Divehi OCR

This article was translated from English: Does it need improvement?
Translated
View the article in English

他126の言語

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

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

IronOcr.Languages.Divehi の内容

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

  • ディベヒ語
  • ディベヒベスト
  • ディベヒ語ファスト

ダウンロード

ディベヒ語パック[ԋԈԀ]

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

インストール

最初に行う必要があるのは、 Divehi OCR パッケージを .NET プロジェクトにインストールすることです。

Install-Package IronOCR.Languages.Divehi

Code Example

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

// Import the IronOcr namespace
using IronOcr;

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

        // Set the OCR language to Divehi
        Ocr.Language = OcrLanguage.Divehi;

        // Load the image or PDF document into the OCR processor
        using (var Input = new OcrInput(@"images\Divehi.png"))
        {
            // Perform OCR on the input document
            var Result = Ocr.Read(Input);

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

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

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

        // Set the OCR language to Divehi
        Ocr.Language = OcrLanguage.Divehi;

        // Load the image or PDF document into the OCR processor
        using (var Input = new OcrInput(@"images\Divehi.png"))
        {
            // Perform OCR on the input document
            var Result = Ocr.Read(Input);

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

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

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

		' Set the OCR language to Divehi
		Ocr.Language = OcrLanguage.Divehi

		' Load the image or PDF document into the OCR processor
		Using Input = New OcrInput("images\Divehi.png")
			' Perform OCR on the input document
			Dim Result = Ocr.Read(Input)

			' Extract all recognized text
			Dim AllText = Result.Text

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

説明

  • IronOcr のインポート: この例では、必要な IronOcr 名前空間をインポートすることから始まります。
  • OCR エンジンの作成: OCR エンジンであるIronTesseractのインスタンスが作成されます。 -言語の指定: OCR 処理の言語はディベヒ語に設定され、その言語に合わせた正確な認識が保証されます。 -入力の読み込み: OcrInputを使用して画像または PDF ドキュメントが開かれ、テキスト抽出の準備が整います。
  • OCR の実行: Readメソッドは入力を処理し、テキストを抽出します。 -テキスト抽出: 認識されたテキストはAllTextに保存され、コンソールに出力されます。

このコードは、デジタル文書からディベヒ語の文字を読み取るために IronOCR を活用するシンプルかつ強力な方法を示しています。