C# と .NET でのシリア語 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.Syriac の内容

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

  • シリア語
  • シリア語ベスト
  • シリア・ファスト
  • シリア語アルファベット
  • シリア語アルファベットベスト
  • シリア語アルファベット高速

ダウンロード

シリア語言語パック [シリア語]

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

インストール

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

Install-Package IronOCR.Languages.Syriac

Code Example

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

// Import the IronOcr library
using IronOcr;

class Program
{
    static void Main()
    {
        // Instantiate the IronTesseract object
        var Ocr = new IronTesseract();

        // Set the language to Syriac
        Ocr.Language = OcrLanguage.Syriac;

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

            // Retrieve the full recognized text
            var AllText = Result.Text;

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

class Program
{
    static void Main()
    {
        // Instantiate the IronTesseract object
        var Ocr = new IronTesseract();

        // Set the language to Syriac
        Ocr.Language = OcrLanguage.Syriac;

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

            // Retrieve the full recognized text
            var AllText = Result.Text;

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

Friend Class Program
	Shared Sub Main()
		' Instantiate the IronTesseract object
		Dim Ocr = New IronTesseract()

		' Set the language to Syriac
		Ocr.Language = OcrLanguage.Syriac

		' Create an OCR input from an image file
		Using Input = New OcrInput("images\Syriac.png")
			' Read the image and extract the text
			Dim Result = Ocr.Read(Input)

			' Retrieve the full recognized text
			Dim AllText = Result.Text

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

この例では:

  • OCR を処理するためにIronTesseractのインスタンスを作成します。
  • この言語の正確なテキスト認識を確実にするために、 Ocr.LanguageSyriacに設定されています。
  • シリア語のテキストを含む画像をOcrInputに読み込み、 Ocr.Readを使用して処理します。
  • 認識されたテキストはResult.Textに保存され、アプリケーションでさらに利用できるようになります。