C# での Fraktur アルファベット OCR

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

他126の言語

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

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

IronOcr.Languages.Frakturの内容

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

  • フラクトゥール文字
  • フラクトゥールアルファベットベスト
  • フラクトゥールアルファベットファースト

ダウンロード

Fraktur アルファベット言語パック[汎用 Fraktur]

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

インストール

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

Install-Package IronOCR.Languages.Fraktur

Code Example

この C# コード例は、画像または PDF ドキュメントからフラクトゥール アルファベットのテキストを読み取ります。

// Requires the IronOcr NuGet package and the Fraktur language package to be installed.

using IronOcr;

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

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

        // Load the image containing Fraktur text
        using (var Input = new OcrInput(@"images\Fraktur.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

            // Retrieve and display the recognized text
            var AllText = Result.Text;
            Console.WriteLine(AllText);
        }
    }
}
// Requires the IronOcr NuGet package and the Fraktur language package to be installed.

using IronOcr;

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

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

        // Load the image containing Fraktur text
        using (var Input = new OcrInput(@"images\Fraktur.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

            // Retrieve and display the recognized text
            var AllText = Result.Text;
            Console.WriteLine(AllText);
        }
    }
}
' Requires the IronOcr NuGet package and the Fraktur language package to be installed.

Imports IronOcr

Friend Class FrakturOCRExample
	Shared Sub Main()
		' Create an instance of the IronTesseract class
		Dim Ocr = New IronTesseract()

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

		' Load the image containing Fraktur text
		Using Input = New OcrInput("images\Fraktur.png")
			' Perform OCR on the input image
			Dim Result = Ocr.Read(Input)

			' Retrieve and display the recognized text
			Dim AllText = Result.Text
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

この例では:

  • OCR エンジンとして機能するIronTesseractオブジェクトを作成します。
  • OcrLanguage.Frakturを使用して、言語設定をフラクトゥール語に変更します。
  • 画像ファイル ( @"images\Fraktur.png" ) をOcrInputオブジェクトに読み込みます。
  • Ocr.Read()メソッドは入力画像を処理し、OCR 結果を返します。
  • 最後に、抽出したテキストをコンソールに出力します。