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

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

  • デンマーク語
  • デンマークベスト
  • デンマークファースト
  • デンマーク語フラクタ

ダウンロード

デンマーク語言語パック[デンマーク語]

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

インストール

最初のステップは、デンマーク語のOCR パッケージを .NET プロジェクトにインストールすることです。

Install-Package IronOCR.Languages.Danish

Code Example

この C# コード例では、IronOCR を使用して画像または PDF ドキュメントからデンマーク語のテキストを読み取ります。

// Import the IronOcr namespace to access OCR functionalities
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize the IronTesseract object, which will handle OCR operations
        var Ocr = new IronTesseract();

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

        // Using a 'using' statement to ensure the OcrInput object is disposed of correctly
        using (var Input = new OcrInput(@"images\Danish.png"))
        {
            // Perform OCR on the input image and store the result
            var Result = Ocr.Read(Input);

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

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

class Program
{
    static void Main()
    {
        // Initialize the IronTesseract object, which will handle OCR operations
        var Ocr = new IronTesseract();

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

        // Using a 'using' statement to ensure the OcrInput object is disposed of correctly
        using (var Input = new OcrInput(@"images\Danish.png"))
        {
            // Perform OCR on the input image and store the result
            var Result = Ocr.Read(Input);

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

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

Friend Class Program
	Shared Sub Main()
		' Initialize the IronTesseract object, which will handle OCR operations
		Dim Ocr = New IronTesseract()

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

		' Using a 'using' statement to ensure the OcrInput object is disposed of correctly
		Using Input = New OcrInput("images\Danish.png")
			' Perform OCR on the input image and store the result
			Dim Result = Ocr.Read(Input)

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

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

この例では、画像ファイルからデンマーク語のテキストを読み取るためのIronOCRの設定方法を示します。IronTesseract IronTesseractはデンマーク語を使用するように設定されており、画像はOcrInputで読み込まれます。 Ocr.Read OCR を実行し、認識されたテキストを抽出して印刷します。