C# でのキリル文字 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.Cyrillic の内容

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

  • キリル文字
  • キリル文字アルファベットベスト
  • キリル文字アルファベット高速

ダウンロード

キリル文字言語パック[キリル文字]

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

インストール

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

Install-Package IronOCR.Languages.Cyrillic

Code Example

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

using IronOcr;

public class OcrExample
{
    public void ReadCyrillicText()
    {
        // Initialize a new instance of the IronTesseract OCR engine
        var Ocr = new IronTesseract();

        // Set the OCR engine to use the Cyrillic language package
        Ocr.Language = OcrLanguage.Cyrillic;

        // Create a new OCR input from an image file
        using (var Input = new OcrInput(@"images\Cyrillic.png"))
        {
            // Read the image using the OCR engine
            var Result = Ocr.Read(Input);

            // Retrieve Recognized Text
            var AllText = Result.Text;

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

public class OcrExample
{
    public void ReadCyrillicText()
    {
        // Initialize a new instance of the IronTesseract OCR engine
        var Ocr = new IronTesseract();

        // Set the OCR engine to use the Cyrillic language package
        Ocr.Language = OcrLanguage.Cyrillic;

        // Create a new OCR input from an image file
        using (var Input = new OcrInput(@"images\Cyrillic.png"))
        {
            // Read the image using the OCR engine
            var Result = Ocr.Read(Input);

            // Retrieve Recognized Text
            var AllText = Result.Text;

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

Public Class OcrExample
	Public Sub ReadCyrillicText()
		' Initialize a new instance of the IronTesseract OCR engine
		Dim Ocr = New IronTesseract()

		' Set the OCR engine to use the Cyrillic language package
		Ocr.Language = OcrLanguage.Cyrillic

		' Create a new OCR input from an image file
		Using Input = New OcrInput("images\Cyrillic.png")
			' Read the image using the OCR engine
			Dim Result = Ocr.Read(Input)

			' Retrieve 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 : これは、OCR タスクを構成および実行するために使用する OCR エンジン クラスです。
  • OcrInput : OCR を実行する入力画像またはドキュメントを表すクラス。
  • OcrLanguage.Cyrillic : OCR エンジンが認識にキリル言語パッケージを使用するように指定します。
  • Result.Text : OCR 結果オブジェクトから認識されたテキストにアクセスします。

この例では、キリル文字のテキストを含む画像を処理してテキストを抽出する簡単な使用例を示します。