Catalan OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
このドキュメントの他のバージョン:

*カタルーニャ語

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

これは、.NET 開発者専用に構築された Tesseract の高度なフォークであり、速度と精度の両方で他の Tesseract エンジンを常に上回っています。

IronOcr.Languages.Catalan の内容

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

  • カタロニア語
  • カタロニア語ベスト
  • カタランファスト

ダウンロード

カタロニア語言語パック[català]

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

インストール

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

Install-Package IronOcr.Languages.Catalan

Code Example

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

// Import the IronOcr namespace to use its OCR functionality
using IronOcr;

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

        // Set the language for OCR processing to Catalan
        Ocr.Language = OcrLanguage.Catalan;

        // Define the input image or PDF from which you want to read the text
        using (var Input = new OcrInput(@"images\Catalan.png"))
        {
            // Perform OCR reading on the input
            var Result = Ocr.Read(Input);

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

            // Output the recognized text
            Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr namespace to use its OCR functionality
using IronOcr;

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

        // Set the language for OCR processing to Catalan
        Ocr.Language = OcrLanguage.Catalan;

        // Define the input image or PDF from which you want to read the text
        using (var Input = new OcrInput(@"images\Catalan.png"))
        {
            // Perform OCR reading on the input
            var Result = Ocr.Read(Input);

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

            // Output the recognized text
            Console.WriteLine(AllText);
        }
    }
}
$vbLabelText   $csharpLabel

このコードでは:

  • OCR 操作を処理するために、IronTesseract のインスタンスを作成します。
  • Ocr.Language はカタロニア語として指定されており、OCR エンジンはカタロニア語言語モデルを使用して画像を処理する必要があることを示しています。
  • 画像または PDF ドキュメントのファイル パスを指定するには、OcrInput を使用します。
  • Read メソッドは Ocr オブジェクトに対して呼び出され、OCR 読み取り結果が変数 Result に格納されます。
  • 最後に、Result.Text には認識されたテキストが含まれており、コンソールに出力されます。