Latin Alphabet OCR in C# and .NET
IronOCRは、.NETプログラマーがラテンアルファベットを含む126言語で画像やPDF文書からテキストを読み取れるC#のソフトウェアコンポーネントです。
これはTesseractの高度なフォークであり、.NET開発者専用に構築され、速度と精度の両方で他のTesseractエンジンを定期的に上回ります。
IronOcr.Languages.LatinAlphabetの内容
このパッケージには、.NET 用の64のOCR言語が含まれています:
- LatinAlphabet
- LatinAlphabetBest
- LatinAlphabetFast
ダウンロード
ラテンアルファベット言語パック [latine]
インストール
最初にやるべきことは、ラテンアルファベットOCRパッケージをあなた for .NETプロジェクトにインストールすることです。
Install-Package IronOcr.Languages.LatinAlphabet
Code Example
このC#コード例は、画像またはPDF文書からラテンアルファベットのテキストを読み取ります。
// Install the IronOCR.languages.LatinAlphabet package first
using IronOcr;
var Ocr = new IronTesseract(); // Initialize IronTesseract instance
// Set the OCR language to LatinAlphabet
Ocr.Language = OcrLanguage.LatinAlphabet;
// Define the input image or PDF you want to read
using (var Input = new OcrInput(@"images\LatinAlphabet.png"))
{
// Perform OCR reading on the input
var Result = Ocr.Read(Input);
// Extract the recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine(AllText);
}
// Install the IronOCR.languages.LatinAlphabet package first
using IronOcr;
var Ocr = new IronTesseract(); // Initialize IronTesseract instance
// Set the OCR language to LatinAlphabet
Ocr.Language = OcrLanguage.LatinAlphabet;
// Define the input image or PDF you want to read
using (var Input = new OcrInput(@"images\LatinAlphabet.png"))
{
// Perform OCR reading on the input
var Result = Ocr.Read(Input);
// Extract the recognized text
var AllText = Result.Text;
// Output the recognized text
Console.WriteLine(AllText);
}
' Install the IronOCR.languages.LatinAlphabet package first
Imports IronOcr
Private Ocr = New IronTesseract() ' Initialize IronTesseract instance
' Set the OCR language to LatinAlphabet
Ocr.Language = OcrLanguage.LatinAlphabet
' Define the input image or PDF you want to read
Using Input = New OcrInput("images\LatinAlphabet.png")
' Perform OCR reading on the input
Dim Result = Ocr.Read(Input)
' Extract the recognized text
Dim AllText = Result.Text
' Output the recognized text
Console.WriteLine(AllText)
End Using
説明
- IronTesseract の初期化: OCR 処理を処理する
IronTesseractのインスタンスが初期化されます。
2.言語設定: OCR 言語は、 IronOCRパッケージで使用可能な言語の 1 つである LatinAlphabet に設定されています。
3.入力仕様:テキストを抽出する画像または PDF へのパスを指定する OcrInput オブジェクトが作成されます。
- OCR 実行:
IronTesseractインスタンスのReadメソッドが呼び出され、OcrInputが処理されます。 これは、抽出されたテキストを含むResultオブジェクトを返します。
5.テキスト抽出: Result オブジェクトの Text プロパティを使用して、認識されたテキストにアクセスします。
- 出力: 認識されたテキストは検証のためにコンソールに印刷されます。
ファイルが見つからないという例外を回避するには、OcrInput のファイル パスが画像または PDF ファイルを正しく指していることを確認してください。

