Italian 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# ソフトウェア コンポーネントです。

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

IronOcr.Languages.Italian の内容

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

  • イタリア語
  • イタリアンベスト
  • イタリアンファースト
  • イタリア語(古い)
  • イタリア語オールドベスト
  • イタリア語オールドファースト

ダウンロード

イタリア語言語パック[italiano]

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

インストール

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

Install-Package IronOcr.Languages.Italian

Code Example

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

// Include IronOcr library
using IronOcr;

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

        // Set the OCR language to Italian
        Ocr.Language = OcrLanguage.Italian;

        // Read text from an image file
        using (var Input = new OcrInput(@"images\Italian.png"))
        {
            // Perform OCR to get the text content from the image
            var Result = Ocr.Read(Input);

            // Get and print all the recognized text
            var AllText = Result.Text;
            Console.WriteLine(AllText);
        }
    }
}
// Include IronOcr library
using IronOcr;

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

        // Set the OCR language to Italian
        Ocr.Language = OcrLanguage.Italian;

        // Read text from an image file
        using (var Input = new OcrInput(@"images\Italian.png"))
        {
            // Perform OCR to get the text content from the image
            var Result = Ocr.Read(Input);

            // Get and print all the recognized text
            var AllText = Result.Text;
            Console.WriteLine(AllText);
        }
    }
}
$vbLabelText   $csharpLabel

説明:

  1. IronOCRの使用: OCR 機能を利用するために、IronOcr ライブラリが含まれています。
  2. IronTesseract インスタンスの作成: IronTesseract は、OCR 処理に使用されるコア クラスです。 3.言語の設定: OCR は、Ocr.Language = OcrLanguage.Italian を使用してイタリア語を処理するように設定されています。 4.入力の読み取り: 画像ファイルを指定するために OcrInput オブジェクトが作成されます。
  3. OCR の実行: Ocr.Read(Input) は入力画像に対して OCR プロセスを実行し、テキスト結果を返します。 6.出力: 結果のテキストは AllText に保存され、コンソールに表示されます。

この例が正しく動作するには、images\Italian.png ファイル パスが正しく、ファイルが存在することを確認してください。