Latvian OCR in C# and .NET
Curtis Chau
更新日: 2026年8月2日
このドキュメントの他のバージョン:
IronOCR は、.NET コーダーがラトビア語を含む 126 の言語で画像や PDF ドキュメントからテキストを読み取ることを可能にする C# ソフトウェア コンポーネントです。
これはTesseractの高度なフォークであり、.NET開発者専用に構築され、速度と精度の両方で他のTesseractエンジンを定期的に上回ります。
IronOcr.Languages.Latvian の内容
このパッケージには、.NET 用の 46 の OCR 言語が含まれています。
- ラトビア語
- ラトビア語Best
- ラトビアファースト
ダウンロード
ラトビア語言語パック[ラトビア語]
インストール
最初に行う必要があるのは、ラトビア語OCR パッケージを .NET プロジェクトにインストールすることです。
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);
}
}
}Imports IronOcr
Module LatvianOCRExample
Sub Main()
' Create an instance of IronTesseract for OCR
Dim Ocr As New IronTesseract()
' Set the OCR language to Latvian
Ocr.Language = OcrLanguage.Latvian
' Define the input image file path
Using Input As 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 ModuleImports IronOcr
Module LatvianOCRExample
Sub Main()
' Create an instance of IronTesseract for OCR
Dim Ocr As New IronTesseract()
' Set the OCR language to Latvian
Ocr.Language = OcrLanguage.Latvian
' Define the input image file path
Using Input As 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 Module説明
- IronOCR ネームスペース: 例では、光学文字認識機能にアクセスするために必要な
IronOcrネームスペースをインポートすることから始まります。 - IronTesseract インスタンス: 画像読み取りとテキスト抽出を処理するために、
IronTesseractオブジェクト (Ocr) が作成されます。 - 言語設定: OCR プロセスは
Ocr.Languageプロパティを設定することでラトビア語のテキストを読み取るように構成されます。 - OcrInput オブジェクト: 処理する画像ファイルを参照する
OcrInputオブジェクトが作成されます。 - 画像の読み取り:
Ocrインスタンスに対してReadメソッドを呼び出し、画像を処理してテキストを抽出し、Result変数に保存します。 - 結果の抽出: OCR の結果に
Result.Text経由でアクセスし、さらなる使用または表示のためにAllTextに保存します。 - コンソール出力: 認識されたラトビア語のテキストがコンソールに表示され、テキスト抽出の視覚的確認が得られます。
テクニカルライター
Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。