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# ソフトウェア コンポーネントです。

これは、.NET 開発者専用に構築された Tesseract の高度なフォークであり、速度と精度の両方で他の Tesseract エンジンを常に上回っています。

IronOcr.Languages.Arabic の内容

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

  • アラビア語
  • アラビア語ベスト
  • アラビア語高速
  • アラビア語アルファベット
  • アラビア語アルファベットベスト
  • アラビア語アルファベット高速

ダウンロード

アラビア語言語パック[العربية]

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

インストール

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

Install-Package IronOCR.Languages.Arabic

Code Example

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

// Import the IronOcr namespace to use its classes.
using IronOcr;

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

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

// Use a using statement to ensure that resources are disposed of correctly.
using (var Input = new OcrInput(@"images\Arabic.png"))
{
    // Perform OCR on the input image or document.
    var Result = Ocr.Read(Input);

    // Retrieve all recognized text from the document.
    var AllText = Result.Text;

    // Optionally, you can output the text to the console or use it otherwise.
    // Console.WriteLine(AllText);
}
// Import the IronOcr namespace to use its classes.
using IronOcr;

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

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

// Use a using statement to ensure that resources are disposed of correctly.
using (var Input = new OcrInput(@"images\Arabic.png"))
{
    // Perform OCR on the input image or document.
    var Result = Ocr.Read(Input);

    // Retrieve all recognized text from the document.
    var AllText = Result.Text;

    // Optionally, you can output the text to the console or use it otherwise.
    // Console.WriteLine(AllText);
}
' Import the IronOcr namespace to use its classes.
Imports IronOcr

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

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

' Use a using statement to ensure that resources are disposed of correctly.
Using Input = New OcrInput("images\Arabic.png")
	' Perform OCR on the input image or document.
	Dim Result = Ocr.Read(Input)

	' Retrieve all recognized text from the document.
	Dim AllText = Result.Text

	' Optionally, you can output the text to the console or use it otherwise.
	' Console.WriteLine(AllText);
End Using
$vbLabelText   $csharpLabel