C# と .NET でのラトビア語 OCR
Other versions of this document:
IronOCR は、.NET コーダーがラトビア語を含む 126 の言語で画像や PDF ドキュメントからテキストを読み取ることを可能にする C# ソフトウェア コンポーネントです。
これはTesseractの高度なフォークであり、.NET開発者専用に構築され、速度と精度の両方で他のTesseractエンジンを定期的に上回ります。
IronOcr.Languages.Latvian の内容
このパッケージには、.NET 用の 46 の OCR 言語が含まれています。
- ラトビア語
- ラトビア語ベスト
- ラトビアファースト
ダウンロード
ラトビア語言語パック[ラトビア語]
インストール
最初に行う必要があるのは、ラトビア語OCR パッケージを .NET プロジェクトにインストールすることです。
Install-Package IronOCR.Languages.Latvian
Code Example
この C# コード例は、画像または PDF ドキュメントからラトビア語のテキストを読み取ります。
using IronOcr;
class LatvianOCRExample
{
static void Main()
{
// Create an instance of IronTesseract for OCR
var Ocr = new IronTesseract();
// Set the OCR language to Latvian
Ocr.Language = OcrLanguage.Latvian;
// Define the input image file path
using (var Input = new OcrInput(@"images\Latvian.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Extract all recognized text from the OCR result
var AllText = Result.Text;
// Output the recognized text to the console
Console.WriteLine(AllText);
}
}
}using IronOcr;
class LatvianOCRExample
{
static void Main()
{
// Create an instance of IronTesseract for OCR
var Ocr = new IronTesseract();
// Set the OCR language to Latvian
Ocr.Language = OcrLanguage.Latvian;
// Define the input image file path
using (var Input = new OcrInput(@"images\Latvian.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Extract all recognized text from the OCR result
var AllText = Result.Text;
// Output the recognized text to the console
Console.WriteLine(AllText);
}
}
}Imports IronOcr
Friend Class LatvianOCRExample
Shared Sub Main()
' Create an instance of IronTesseract for OCR
Dim Ocr = New IronTesseract()
' Set the OCR language to Latvian
Ocr.Language = OcrLanguage.Latvian
' Define the input image file path
Using Input = New OcrInput("images\Latvian.png")
' Perform OCR on the input image
Dim Result = Ocr.Read(Input)
' Extract all recognized text from the OCR result
Dim AllText = Result.Text
' Output the recognized text to the console
Console.WriteLine(AllText)
End Using
End Sub
End Class説明
- IronOcr 名前空間:この例では、OCR 機能にアクセスするために必要な
IronOcr名前空間をインポートすることから始まります。 - IronTesseract インスタンス:画像の読み取りとテキスト抽出を処理するために
IronTesseractオブジェクト (Ocr) が作成されます。 -言語構成: OCR プロセスは、Ocr.Languageプロパティを設定することでラトビア語のテキストを読み取るように構成されます。 - OcrInput オブジェクト:処理する画像ファイルを参照して、
OcrInputオブジェクトが作成されます。 -画像の読み取り:OcrインスタンスでReadメソッドが呼び出され、画像が処理されてテキストが抽出され、Result変数に保存されます。 -結果の抽出: OCR の結果はResult.Textを介してアクセスされ、さらに使用したり表示したりするためにAllTextに保存されます。 -コンソール出力:認識されたラトビア語のテキストがコンソールに出力され、テキスト抽出を視覚的に確認できます。





