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のインスタンスが初期化されます。 -
言語設定: OCRの言語は
LatinAlphabetに設定されています。これはIronOCRパッケージで利用可能な言語の一つです。 -
入力仕様:
OcrInputオブジェクトが作成され、テキストが抽出される画像またはPDFへのパスが指定されます。 -
OCRの実行:
OcrInputを処理します。 これにより、抽出されたテキストを含むResultオブジェクトが返されます。 -
テキストの抽出:
TextオブジェクトのResultプロパティを使用して、認識されたテキストにアクセスします。 - 出力: 認識されたテキストは検証のためにコンソールに印刷されます。
ファイルが見つからないという例外が発生しないよう、OcrInput内のファイルパスが、画像またはPDFファイルを正しく指していることを確認してください。

