C# と .NET でのラオス語 OCR

This article was translated from English: Does it need improvement?
Translated
View the article in English
Other versions of this document:

IronOCR は、.NET コーダーがラオス語を含む 126 の言語で画像や PDF ドキュメントからテキストを読み取ることを可能にする C# ソフトウェア コンポーネントです。

これはTesseractの高度なフォークであり、.NET開発者専用に構築され、速度と精度の両方で他のTesseractエンジンを定期的に上回ります。

IronOcr.Languages.Laoの内容

このパッケージには、.NET用の複数のOCR言語モデルが含まれています:

  • 労働
  • 労働Best
  • 労働Fast
  • 労働Alphabet
  • ラオ語アルファベットベスト
  • ラオ語アルファベット高速

ダウンロード

ラオス語パック[ラオス語]

  • Zip形式でダウンロード
  • NuGetでインストール

インストール

最初に、.NET プロジェクトにラオス語OCR パッケージをインストールする必要があります。

Install-Package IronOCR.Languages.Lao

Code Example

この C# コード例では、画像または PDF ドキュメントからラオス語のテキストを読み取ります。

// Import the IronOcr namespace to use its OCR functionality
using IronOcr;

// Create a new IronTesseract instance
var Ocr = new IronTesseract();
// Set the OCR language to Lao
Ocr.Language = OcrLanguage.Lao;

// Use a using statement to ensure proper disposal of resources
using (var Input = new OcrInput(@"images\Lao.png"))
{
    // Perform OCR on the input image
    var Result = Ocr.Read(Input);
    // Extract all text from the OCR result
    var AllText = Result.Text;

    // Output the recognized text for verification
    Console.WriteLine(AllText);
}
// Import the IronOcr namespace to use its OCR functionality
using IronOcr;

// Create a new IronTesseract instance
var Ocr = new IronTesseract();
// Set the OCR language to Lao
Ocr.Language = OcrLanguage.Lao;

// Use a using statement to ensure proper disposal of resources
using (var Input = new OcrInput(@"images\Lao.png"))
{
    // Perform OCR on the input image
    var Result = Ocr.Read(Input);
    // Extract all text from the OCR result
    var AllText = Result.Text;

    // Output the recognized text for verification
    Console.WriteLine(AllText);
}
' Import the IronOcr namespace to use its OCR functionality
Imports IronOcr

' Create a new IronTesseract instance
Private Ocr = New IronTesseract()
' Set the OCR language to Lao
Ocr.Language = OcrLanguage.Lao

' Use a using statement to ensure proper disposal of resources
Using Input = New OcrInput("images\Lao.png")
	' Perform OCR on the input image
	Dim Result = Ocr.Read(Input)
	' Extract all text from the OCR result
	Dim AllText = Result.Text

	' Output the recognized text for verification
	Console.WriteLine(AllText)
End Using
$vbLabelText   $csharpLabel

説明:

  • このコードは、ラオス語専用の OCR を実行するために IronOCR を設定および使用する方法を示しています。
  • IronTesseractは、OCR 操作を実行するために使用されるメイン クラスです。
  • 言語は、 Ocr.Languageを使用してラオス語に設定されています。
  • OcrInputは、OCR 処理用に画像または PDF ドキュメントを読み込むために使用されるクラスです。
  • Ocr.Readメソッドは入力を処理し、認識されたテキストを含む結果を返します。
  • usingステートメントは、リソースが使用後に解放されることを保証します。
  • 最後に、認識されたテキストがコンソールに出力され、出力が検証されます。