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

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

  • エストニア語
  • エストニア語ベスト
  • エストニアファースト

ダウンロード

エストニア語言語パック[エストニア語]

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

インストール

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

Install-Package IronOCR.Languages.Estonian

Code Example

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

// Import the IronOcr namespace
using IronOcr;

// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();

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

// Load the image or PDF from which text needs to be extracted
using (var Input = new OcrInput(@"images\Estonian.png"))
{
    // Perform OCR to read text from the specified input
    var Result = Ocr.Read(Input);

    // Extract all the recognized text from the OCR result
    var AllText = Result.Text;
}
// Import the IronOcr namespace
using IronOcr;

// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();

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

// Load the image or PDF from which text needs to be extracted
using (var Input = new OcrInput(@"images\Estonian.png"))
{
    // Perform OCR to read text from the specified input
    var Result = Ocr.Read(Input);

    // Extract all the recognized text from the OCR result
    var AllText = Result.Text;
}
' Import the IronOcr namespace
Imports IronOcr

' Create a new instance of the IronTesseract class
Private Ocr = New IronTesseract()

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

' Load the image or PDF from which text needs to be extracted
Using Input = New OcrInput("images\Estonian.png")
	' Perform OCR to read text from the specified input
	Dim Result = Ocr.Read(Input)

	' Extract all the recognized text from the OCR result
	Dim AllText = Result.Text
End Using
$vbLabelText   $csharpLabel

コードの説明:

  • IronTesseract:これは、OCR 操作を実行するために IronOCR によって提供される主要なクラスです。
  • Ocr.Language:このプロパティを設定することで、OCR 中に使用する言語を定義します。 ここではエストニア語に設定されています。
  • OcrInput:読み取る画像または PDF ドキュメントを指定するために使用されます。 入力としてファイルパスを受け取ります。
  • Ocr.Read(Input):このメソッドは指定された入力を処理し、OCR を実行します。
  • Result.Text:このプロパティには、画像または PDF ドキュメントから正常に認識され抽出されたすべてのテキストが含まれます。