English OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English

他126の言語

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

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

IronOcr.Languages.Englishの内容

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

ダウンロード

英語言語パック [現代英語]

  • Zip としてダウンロード

コード例

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

// Import the IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize the IronTesseract OCR engine
        var Ocr = new IronTesseract();

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

        // Define the input source as an image file
        using (var Input = new OcrInput(@"images\English.png"))
        {
            // Perform OCR to read the text from the input
            var Result = Ocr.Read(Input);

            // Get all the recognized text
            var AllText = Result.Text;

            // Output the recognized text
            Console.WriteLine(AllText);
        }
    }
}
// Import the IronOcr namespace
using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize the IronTesseract OCR engine
        var Ocr = new IronTesseract();

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

        // Define the input source as an image file
        using (var Input = new OcrInput(@"images\English.png"))
        {
            // Perform OCR to read the text from the input
            var Result = Ocr.Read(Input);

            // Get all the recognized text
            var AllText = Result.Text;

            // Output the recognized text
            Console.WriteLine(AllText);
        }
    }
}
Imports IronOcr

Class Program
    Shared Sub Main()
        ' Initialize the IronTesseract OCR engine
        Dim Ocr As New IronTesseract()

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

        ' Define the input source as an image file
        Using Input As New OcrInput("images\English.png")
            ' Perform OCR to read the text from the input
            Dim Result = Ocr.Read(Input)

            ' Get all the recognized text
            Dim AllText = Result.Text

            ' Output the recognized text
            Console.WriteLine(AllText)
        End Using
    End Sub
End Class
$vbLabelText   $csharpLabel
  • IronOCR パッケージと適切な言語パックがインストールされていることを確認します。
  • この例ではOCRエンジンを初期化し、英語を処理するよう設定し、入力画像からテキストを読み取り、認識されたテキストを出力します。