C# および .NET でのディベヒ語 OCR
IronOCR は、.NET コーダーがディベヒ語を含む 126 の言語で画像や PDF ドキュメントからテキストを読み取ることを可能にする C# ソフトウェア コンポーネントです。
これはTesseractの高度なフォークであり、.NET開発者専用に構築され、速度と精度の両方で他のTesseractエンジンを定期的に上回ります。
IronOcr.Languages.Divehi の内容
このパッケージには、.NET 用の 43 の OCR 言語が含まれています。
- Divehi
- DivehiBest
- DivehiFast
ダウンロード
ディベヒ語パック[ԋԈԀ]
インストール
最初に行う必要があるのは、 Divehi OCR パッケージを .NET プロジェクトにインストールすることです。
コード例
この C# コード例は、画像または PDF ドキュメントからディベヒ語のテキストを読み取ります。
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create an instance of the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the OCR language to Divehi
Ocr.Language = OcrLanguage.Divehi;
// Load the image or PDF document into the OCR processor
using (var Input = new OcrInput(@"images\Divehi.png"))
{
// Perform OCR on the input document
var Result = Ocr.Read(Input);
// Extract all recognized text
var AllText = Result.Text;
// Output the extracted text to the console
Console.WriteLine(AllText);
}
}
}' Import the IronOcr namespace
Imports IronOcr
Module Program
Sub Main()
' Create an instance of the IronTesseract OCR engine
Dim Ocr As New IronTesseract()
' Set the OCR language to Divehi
Ocr.Language = OcrLanguage.Divehi
' Load the image or PDF document into the OCR processor
Using Input As New OcrInput("images\Divehi.png")
' Perform OCR on the input document
Dim Result = Ocr.Read(Input)
' Extract all recognized text
Dim AllText = Result.Text
' Output the extracted text to the console
Console.WriteLine(AllText)
End Using
End Sub
End Module' Import the IronOcr namespace
Imports IronOcr
Module Program
Sub Main()
' Create an instance of the IronTesseract OCR engine
Dim Ocr As New IronTesseract()
' Set the OCR language to Divehi
Ocr.Language = OcrLanguage.Divehi
' Load the image or PDF document into the OCR processor
Using Input As New OcrInput("images\Divehi.png")
' Perform OCR on the input document
Dim Result = Ocr.Read(Input)
' Extract all recognized text
Dim AllText = Result.Text
' Output the extracted text to the console
Console.WriteLine(AllText)
End Using
End Sub
End Module説明
・IronOCRのインポート: 例は必要なIronOCRの名前空間をインポートすることから始まります。
・OCRエンジンの作成: OCRエンジン、IronTesseractのインスタンスが作成されます。
・言語の指定: Divehiの言語がOCR処理に設定され、その言語に合わせた正確な認識を確保します。
・入力の読み込み: 画像またはPDFドキュメントがOcrInputを使用して開かれ、テキスト抽出の準備が整います。
・OCRの実行: Readメソッドが入力を処理し、テキストを抽出します。
・テキスト抽出: 認識されたテキストはAllTextに保存され、コンソールに出力されます。
このコードは、デジタル文書からディベヒ語の文字を読み取るために IronOCR を活用するシンプルかつ強力な方法を示しています。
Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。