Arabic OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Other versions of this document:

IronOCR ist eine C# Softwarekomponente, die es .NET-Entwicklern ermöglicht, Text aus Bildern und PDF-Dokumenten in 126 Sprachen, einschließlich Arabisch, zu lesen.

Es ist ein fortgeschrittener Fork von Tesseract, der ausschließlich für .NET-Entwickler entwickelt wurde und sowohl in der Geschwindigkeit als auch in der Genauigkeit regelmäßig andere Tesseract-Engines übertrifft.

Inhalte von IronOcr.Languages.Arabic

Dieses Paket enthält 108 OCR-Sprachen für .NET:

  • Arabisch
  • ArabicBest
  • ArabicFast
  • Arabisches Alphabet
  • ArabicAlphabetBest
  • ArabicAlphabetFast

Download

Arabisches Sprachpaket style='white-space:default'>[العربية]

Installation

Das Erste, was wir tun müssen, ist das Arabische OCR-Paket in Ihrem .NET-Projekt zu installieren.

Install-Package IronOCR.Languages.Arabic

Beispielcode

Dieses C#-Codebeispiel liest arabischen Text aus einem Bild oder PDF-Dokument.

// 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