C# と .NET でのスペイン語 OCR
Other versions of this document:
IronOCR は、.NET コーダーがスペイン語を含む 126 の言語で画像や PDF ドキュメントからテキストを読み取ることを可能にする C# ソフトウェア コンポーネントです。
これはTesseractの高度なフォークであり、.NET開発者専用に構築され、速度と精度の両方で他のTesseractエンジンを定期的に上回ります。
IronOcr.Languages.Spanish の内容
このパッケージには、.NET 用のいくつかの OCR 言語オプションが含まれています。
- スペイン語
- スペイン語ベスト
- スペイン語高速
- スペイン語(古い)
- スペイン語(旧ベスト)
- SpanishOldFast
ダウンロード
スペイン語言語パック[español]
インストール
最初に、スペイン語OCR パッケージを .NET プロジェクトにインストールする必要があります。
Install-Package IronOCR.Languages.Spanish
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 Spanish
Ocr.Language = OcrLanguage.Spanish;
// Use a using block to manage the OcrInput resource
using (var Input = new OcrInput(@"images\Spanish.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Extract all text from the OCR result
var AllText = Result.Text;
// The 'AllText' variable now contains the Spanish text
}// Import the IronOcr namespace
using IronOcr;
// Create a new instance of the IronTesseract class
var Ocr = new IronTesseract();
// Set the OCR language to Spanish
Ocr.Language = OcrLanguage.Spanish;
// Use a using block to manage the OcrInput resource
using (var Input = new OcrInput(@"images\Spanish.png"))
{
// Perform OCR on the input image
var Result = Ocr.Read(Input);
// Extract all text from the OCR result
var AllText = Result.Text;
// The 'AllText' variable now contains the Spanish text
}' Import the IronOcr namespace
Imports IronOcr
' Create a new instance of the IronTesseract class
Private Ocr = New IronTesseract()
' Set the OCR language to Spanish
Ocr.Language = OcrLanguage.Spanish
' Use a using block to manage the OcrInput resource
Using Input = New OcrInput("images\Spanish.png")
' Perform OCR on the input image
Dim Result = Ocr.Read(Input)
' Extract all text from the OCR result
Dim AllText = Result.Text
' The 'AllText' variable now contains the Spanish text
End Using上記のコードは、IronOCR ライブラリを使用して、 Spanish.pngという名前の画像ファイルからスペイン語のテキストを読み取って抽出する方法を示しています。 必要な名前空間を含め、必要に応じてブロックを使用してリソースを適切に処理するようにしてください。





