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

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

  • サンスクリット語
  • サンスクリット語ベスト
  • サンスクリットファスト

ダウンロード

サンスクリット語パック[ससकतम]

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

インストール

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

Install-Package IronOCR.Languages.Sanskrit

Code Example

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

// Import the IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Create an instance of IronTesseract for OCR operations
        var Ocr = new IronTesseract
        {
            // Set the OCR language to Sanskrit
            Language = OcrLanguage.Sanskrit
        };

        // Define the input image or PDF file containing Sanskrit text
        using (var Input = new OcrInput(@"images\Sanskrit.png"))
        {
            // Perform OCR to read the text from the Input
            var Result = Ocr.Read(Input);

            // Capture the extracted text
            var AllText = Result.Text;

            // Print the extracted text to the console
            System.Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Create an instance of IronTesseract for OCR operations
        var Ocr = new IronTesseract
        {
            // Set the OCR language to Sanskrit
            Language = OcrLanguage.Sanskrit
        };

        // Define the input image or PDF file containing Sanskrit text
        using (var Input = new OcrInput(@"images\Sanskrit.png"))
        {
            // Perform OCR to read the text from the Input
            var Result = Ocr.Read(Input);

            // Capture the extracted text
            var AllText = Result.Text;

            // Print the extracted text to the console
            System.Console.WriteLine(AllText);
        }
    }
}
' Import the IronOcr namespace
Imports IronOcr

Friend Class Program
	Shared Sub Main()
		' Create an instance of IronTesseract for OCR operations
		Dim Ocr = New IronTesseract With {.Language = OcrLanguage.Sanskrit}

		' Define the input image or PDF file containing Sanskrit text
		Using Input = New OcrInput("images\Sanskrit.png")
			' Perform OCR to read the text from the Input
			Dim Result = Ocr.Read(Input)

			' Capture the extracted text
			Dim AllText = Result.Text

			' Print the extracted text to the console
			System.Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
  • この例では、サンスクリット語の画像または PDF で OCR を実行するように IronTesseract を構成する方法を示します。
  • Ocr.Read()メソッドは入力を処理し、 Result.Textプロパティを介してアクセスできるテキスト コンテンツを抽出します。