Arabische Ziffern mit IronOCR lesen – Texterkennung für arabische Schriftzeichen
Die Arabisch-, Persisch- und Urdu-Sprachpakete erkennen keine arabischen Ziffern?
Dies ist ein bekanntes Problem mit den Tesseract-Sprachpaketen.
Das folgende Sprachpaket kann helfen, dieses Problem mit arabischen Ziffern zu lösen: Shreeshriis Tessdata Arabisch
Dies kann dann mit der IronOCR-Funktion verwendet werden, um benutzerdefinierte Sprachpakete zu laden: IronOCR Benutzerdefiniertes Sprachbeispiel
using IronOcr;
class ArabicNumeralOCR
{
static void Main(string[] args)
{
// Initialize a new instance of IronTesseract for OCR
var Ocr = new IronTesseract();
// Load the custom Tesseract language file for better numeral recognition
Ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata");
// Specify the image input for OCR processing
using (var Input = new OcrInput(@"images\image.png"))
{
// Execute the OCR process on the input image
var Result = Ocr.Read(Input);
// Output the recognized text
Console.WriteLine(Result.Text);
}
}
}
using IronOcr;
class ArabicNumeralOCR
{
static void Main(string[] args)
{
// Initialize a new instance of IronTesseract for OCR
var Ocr = new IronTesseract();
// Load the custom Tesseract language file for better numeral recognition
Ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata");
// Specify the image input for OCR processing
using (var Input = new OcrInput(@"images\image.png"))
{
// Execute the OCR process on the input image
var Result = Ocr.Read(Input);
// Output the recognized text
Console.WriteLine(Result.Text);
}
}
}
Imports IronOcr
Friend Class ArabicNumeralOCR
Shared Sub Main(ByVal args() As String)
' Initialize a new instance of IronTesseract for OCR
Dim Ocr = New IronTesseract()
' Load the custom Tesseract language file for better numeral recognition
Ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata")
' Specify the image input for OCR processing
Using Input = New OcrInput("images\image.png")
' Execute the OCR process on the input image
Dim Result = Ocr.Read(Input)
' Output the recognized text
Console.WriteLine(Result.Text)
End Using
End Sub
End Class
Hinweis: Dieses C#-Beispiel zeigt, wie man eine benutzerdefinierte Tesseract-Sprachdatei in IronOCR verwendet, um die Erkennung von arabischen Ziffern innerhalb von Bildern zu verbessern. Es wird vorausgesetzt, dass Sie das entsprechende Sprachpaket bereits heruntergeladen und am angegebenen Ort platziert haben. Stellen Sie sicher, dass IronOCR installiert ist und fügen Sie die notwendige Fehlerbehandlung im Produktionscode hinzu.

