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

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

  • ポーランド語
  • ポーランドベスト
  • ポーランドファースト

ダウンロード

ポーランド語言語パック:

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

インストール

最初に、ポーランド語OCR パッケージを .NET プロジェクトにインストールします。

NuGet パッケージ マネージャーを使用してインストールするには、次のコマンドを実行します。

Install-Package IronOCR.Languages.Polish

Code Example

この C# コード例は、IronOCR を使用して画像または PDF ドキュメントからポーランド語のテキストを読み取る方法を示しています。

// Install the IronOcr.Languages.Polish package via NuGet before using this code.
using IronOcr;

public class PolishOcrExample
{
    public void ReadPolishTextFromImage()
    {
        // Initialize the IronTesseract object
        var Ocr = new IronTesseract();

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

        // Provide the path to the image or PDF file containing Polish text
        using (var Input = new OcrInput(@"images\Polish.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

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

            // Display or process the recognized text
            Console.WriteLine(AllText);
        }
    }
}
// Install the IronOcr.Languages.Polish package via NuGet before using this code.
using IronOcr;

public class PolishOcrExample
{
    public void ReadPolishTextFromImage()
    {
        // Initialize the IronTesseract object
        var Ocr = new IronTesseract();

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

        // Provide the path to the image or PDF file containing Polish text
        using (var Input = new OcrInput(@"images\Polish.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

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

            // Display or process the recognized text
            Console.WriteLine(AllText);
        }
    }
}
' Install the IronOcr.Languages.Polish package via NuGet before using this code.
Imports IronOcr

Public Class PolishOcrExample
	Public Sub ReadPolishTextFromImage()
		' Initialize the IronTesseract object
		Dim Ocr = New IronTesseract()

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

		' Provide the path to the image or PDF file containing Polish text
		Using Input = New OcrInput("images\Polish.png")
			' Perform OCR on the input image
			Dim Result = Ocr.Read(Input)

			' Extract all recognized text
			Dim AllText = Result.Text

			' Display or process the recognized text
			Console.WriteLine(AllText)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

このスクリプトは、OCR エンジンを初期化し、言語 (ポーランド語) を指定し、"images\Polish.png"にある画像を処理してテキストを抽出し、表示します。 コードを実行する前に、ファイル パスが正しいことと、OCR パッケージがインストールされていることを確認してください。