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

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

  • チェコ語
  • チェコベスト
  • チェコファースト

ダウンロード

チェコ語言語パック[チェコ語]

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

インストール

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

Install-Package IronOCR.Languages.Czech

Code Example

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

// Import the IronOcr namespace
using IronOcr;

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

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

        // Define the input image or PDF and perform OCR
        using (var Input = new OcrInput(@"images\Czech.png"))
        {
            // Read the input and perform OCR
            var Result = Ocr.Read(Input);

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

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

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

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

        // Define the input image or PDF and perform OCR
        using (var Input = new OcrInput(@"images\Czech.png"))
        {
            // Read the input and perform OCR
            var Result = Ocr.Read(Input);

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

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

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

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

		' Define the input image or PDF and perform OCR
		Using Input = New OcrInput("images\Czech.png")
			' Read the input and perform OCR
			Dim Result = Ocr.Read(Input)

			' Extract all recognized text
			Dim AllText = Result.Text

			' Output the recognized text to the console
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
  • 上記のコードは、 IronTesseractクラスを構成して利用し、特定の画像または PDF に対して OCR を実行する方法を示しています。
  • コードが正しく実行されるように、 IronOCR.Languages.Czechパッケージが環境にインストールされていることを確認してください。
  • OcrInputクラスは指定されたパスから画像を読み込むために使用され、 Ocr.Read()は OCR 操作を実行します。
  • Result.Textは OCR 出力が含まれ、この場合はコンソールに出力されます。