Sundanese OCR in C# and .NET
このドキュメントの他のバージョン:
IronOCR は、.NET コーダーがスンダ語を含む 126 の言語で画像や PDF ドキュメントからテキストを読み取ることを可能にする C# ソフトウェア コンポーネントです。
これはTesseractの高度なフォークであり、.NET開発者専用に構築され、速度と精度の両方で他のTesseractエンジンを定期的に上回ります。
IronOcr.Languages.Sundanese の内容
このパッケージには、.NET 用の 52 の OCR 言語が含まれています。
- スンダ語
- スンダ語Best
- スンダファースト
ダウンロード
スンダ語言語パック[スンダ語]
インストール
最初に、 Sundanese OCR パッケージを .NET プロジェクトにインストールする必要があります。
Install-Package IronOcr.Languages.Sundanese
Code Example
この C# コード例は、画像または PDF ドキュメントからスンダ語のテキストを読み取ります。
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();
// Specify the language the OCR engine should use
Ocr.Language = OcrLanguage.Sundanese;
// Initialize the OCR input with an image file containing Sundanese text
using (var Input = new OcrInput(@"images\Sundanese.png"))
{
// Process the input and get the result
var Result = Ocr.Read(Input);
// Extract all recognized text from the result
var AllText = Result.Text;
// Output the recognized text
System.Console.WriteLine(AllText);
}
}
}
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();
// Specify the language the OCR engine should use
Ocr.Language = OcrLanguage.Sundanese;
// Initialize the OCR input with an image file containing Sundanese text
using (var Input = new OcrInput(@"images\Sundanese.png"))
{
// Process the input and get the result
var Result = Ocr.Read(Input);
// Extract all recognized text from the result
var AllText = Result.Text;
// Output the recognized text
System.Console.WriteLine(AllText);
}
}
}
' Import the IronOcr namespace
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Create a new instance of the IronTesseract class
Dim Ocr = New IronTesseract()
' Specify the language the OCR engine should use
Ocr.Language = OcrLanguage.Sundanese
' Initialize the OCR input with an image file containing Sundanese text
Using Input = New OcrInput("images\Sundanese.png")
' Process the input and get the result
Dim Result = Ocr.Read(Input)
' Extract all recognized text from the result
Dim AllText = Result.Text
' Output the recognized text
System.Console.WriteLine(AllText)
End Using
End Sub
End Class
説明
- まず、
IronOcr名前空間をインポートして、その OCR 機能を使用します。 IronTesseractのインスタンスが作成され、これがメインの OCR エンジンとして機能します。LanguageプロパティをOcrLanguage.Sundaneseに設定することで、エンジンがスンダ語のテキストを読み込むことを想定していることを指定します。- OCRエンジンの画像ファイルのソースを指定するために、
OcrInputオブジェクトを作成します。 Readメソッドは入力を処理し、テキストの認識を試みます。- 認識されたテキストは
AllText変数に格納され、その後コンソールに出力されます。
この設定により、.NET 環境で IronOCR ライブラリを使用して、画像からスンダ語のテキストを堅牢に認識できるようになります。

