C# と .NET での中英語 OCR
IronOCR は、.NET コーダーが中英語を含む 126 の言語で画像や PDF ドキュメントからテキストを読み取ることを可能にする C# ソフトウェア コンポーネントです。
これは Tesseract の高度なフォークであり、.NET 開発者専用に構築されており、速度と精度の両方で他の Tesseract エンジンを常に上回っています。
IronOcr.Languages.MiddleEnglish の内容
このパッケージには、.NET 用の64のOCR言語が含まれています:
- 中英語
- ミドルイングリッシュベスト
- ミドルイングリッシュファースト
ダウンロード
中英語言語パック[英語 (1100-1500 年)]
インストール
最初に行う必要があるのは、中英語OCR パッケージを .NET プロジェクトにインストールすることです。
Install-Package IronOCR.Languages.MiddleEnglish
Code Example
この 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 Middle English
Ocr.Language = OcrLanguage.MiddleEnglish;
// Define the input source as an image file
using (var Input = new OcrInput(@"images\MiddleEnglish.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 Middle English
Ocr.Language = OcrLanguage.MiddleEnglish;
// Define the input source as an image file
using (var Input = new OcrInput(@"images\MiddleEnglish.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
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Initialize the IronTesseract OCR engine
Dim Ocr = New IronTesseract()
' Set the language to Middle English
Ocr.Language = OcrLanguage.MiddleEnglish
' Define the input source as an image file
Using Input = New OcrInput("images\MiddleEnglish.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- IronOCR パッケージと適切な言語パックがインストールされていることを確認します。
- この例では、OCR エンジンを初期化し、中英語を処理するように設定し、入力画像からテキストを読み取り、認識されたテキストを出力します。





