C# および .NET でのベンガル語 OCR
Curtis Chau
更新日: 2026年8月2日
このドキュメントの他のバージョン:
IronOCR は、.NET コーダーがベンガル語を含む 126 の言語で画像や PDF ドキュメントからテキストを読み取ることを可能にする C# ソフトウェア コンポーネントです。 これはTesseractの高度なフォークであり、.NET開発者専用に構築され、速度と精度の両方で他のTesseractエンジンを定期的に上回ります。
IronOcr.Languages.Bengali の内容
このパッケージには、.NET 用の 114 の OCR 言語が含まれています。
- Bengali
- BengaliBest
- BengaliFast
- BengaliAlphabet
- BengaliAlphabetBest
- BengaliAlphabetFast
ダウンロード
ベンガル語言語パック[ベンガル語]
インストール
最初に、ベンガル語OCR パッケージを .NET プロジェクトにインストールする必要があります。
コード例
この C# コード例は、画像または PDF ドキュメントからベンガル語のテキストを読み取ります。
// Import the IronOcr namespace
using IronOcr;
class BengaliOcrExample
{
static void Main()
{
// Create an instance of IronTesseract
var Ocr = new IronTesseract();
// Specify the language for OCR
Ocr.Language = OcrLanguage.Bengali;
// Process the image and extract text
using (var Input = new OcrInput(@"images\Bengali.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Get the extracted text
var AllText = Result.Text;
// Output the extracted text to the console
System.Console.WriteLine(AllText);
}
}
}' Import the IronOcr namespace
Imports IronOcr
Friend Class BengaliOcrExample
Shared Sub Main()
' Create an instance of IronTesseract
Dim Ocr = New IronTesseract()
' Specify the language for OCR
Ocr.Language = OcrLanguage.Bengali
' Process the image and extract text
Using Input = New OcrInput("images\Bengali.png")
' Perform OCR on the input image
Dim Result = Ocr.Read(Input)
' Get the extracted text
Dim AllText = Result.Text
' Output the extracted text to the console
System.Console.WriteLine(AllText)
End Using
End Sub
End Class' Import the IronOcr namespace
Imports IronOcr
Friend Class BengaliOcrExample
Shared Sub Main()
' Create an instance of IronTesseract
Dim Ocr = New IronTesseract()
' Specify the language for OCR
Ocr.Language = OcrLanguage.Bengali
' Process the image and extract text
Using Input = New OcrInput("images\Bengali.png")
' Perform OCR on the input image
Dim Result = Ocr.Read(Input)
' Get the extracted text
Dim AllText = Result.Text
' Output the extracted text to the console
System.Console.WriteLine(AllText)
End Using
End Sub
End Class説明
- IronOCRをインポートします: 最初に、OCR操作を実行するために必要なクラスやメソッドが含まれている
IronOcr名前空間をインポートします。 - IronTesseractインスタンスを作成します: OCRを実行するためのメインクラスである
IronTesseractのインスタンスを作成します。 - 言語を設定します:
OcrLanguage.Bengaliを使用してOCR言語をベンガル語に設定します。 - OcrInput:テキストを抽出する画像へのパスを指定します。
OcrInputオブジェクトを使用して入力ファイルをロードおよび前処理します。 - テキストを読み取り抽出します:
Readメソッドを使用して、画像を処理しテキストコンテンツを読み取ります。 そのテキストはResult.Textに保存されます。 - テキストを出力します: 最後に、抽出したテキストをコンソールに出力し、結果を確認します。
テクニカルライター
Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。