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.Vietnamese の内容

このパッケージには、.NET 用の 132 個の OCR 言語が含まれています。

  • ベトナム語
  • ベトナム語ベスト
  • ベトナムファースト
  • ベトナム語アルファベット
  • ベトナム語アルファベットベスト
  • ベトナム語アルファベット高速

ダウンロード

ベトナム語言語パック

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

インストール

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

Install-Package IronOCR.Languages.Vietnamese

Code Example

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

// You need to install the IronOCR.Languages.Vietnamese package using the following NuGet command before running this code:
// PM> Install-Package IronOCR.Languages.Vietnamese

using IronOcr;

var Ocr = new IronTesseract();

// Set the OCR language to Vietnamese
Ocr.Language = OcrLanguage.Vietnamese;

using (var Input = new OcrInput(@"images\Vietnamese.png"))
{
    // Perform OCR on the input image
    var Result = Ocr.Read(Input);

    // Extract all recognized text
    var AllText = Result.Text;

    // Example: Output the extracted text to the console
    Console.WriteLine(AllText);
}
// You need to install the IronOCR.Languages.Vietnamese package using the following NuGet command before running this code:
// PM> Install-Package IronOCR.Languages.Vietnamese

using IronOcr;

var Ocr = new IronTesseract();

// Set the OCR language to Vietnamese
Ocr.Language = OcrLanguage.Vietnamese;

using (var Input = new OcrInput(@"images\Vietnamese.png"))
{
    // Perform OCR on the input image
    var Result = Ocr.Read(Input);

    // Extract all recognized text
    var AllText = Result.Text;

    // Example: Output the extracted text to the console
    Console.WriteLine(AllText);
}
' You need to install the IronOCR.Languages.Vietnamese package using the following NuGet command before running this code:
' PM> Install-Package IronOCR.Languages.Vietnamese

Imports IronOcr

Private Ocr = New IronTesseract()

' Set the OCR language to Vietnamese
Ocr.Language = OcrLanguage.Vietnamese

Using Input = New OcrInput("images\Vietnamese.png")
	' Perform OCR on the input image
	Dim Result = Ocr.Read(Input)

	' Extract all recognized text
	Dim AllText = Result.Text

	' Example: Output the extracted text to the console
	Console.WriteLine(AllText)
End Using
$vbLabelText   $csharpLabel

このコードサンプルでは次のようになります。

  • IronTesseractのインスタンスを作成します。
  • Ocr.Language = OcrLanguage.Vietnamese;を使用して、言語をベトナム語に設定します。
  • 画像または PDF へのパスを持つOcrInputオブジェクトを作成します。
  • Readメソッドを呼び出して OCR を実行し、抽出されたテキストを取得します。
  • 抽出されたテキストはAllTextに保存され、表示したりファイルに保存するなど、必要に応じて使用できます。