Utilisation des chiffres arabes avec le logiciel OCR IronOCR
Les packs de langue arabe, persan et ourdou ne reconnaissent pas les chiffres arabes ?
Il s'agit d'un problème connu avec les packs de langue Tesseract pour la reconnaissance de texte.
Le pack de langue suivant peut aider à résoudre ce problème avec les chiffres arabes : Tessdata arabe de Shreeshrii
Cette fonctionnalité peut ensuite être utilisée avec IronOCR pour charger des packs de langue personnalisés : Exemple de langue personnalisée IronOCR
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
Remarque : cet exemple C# montre comment utiliser un fichier de langue Tesseract personnalisé dans IronOCR pour améliorer la reconnaissance des chiffres arabes dans les images. Il suppose que vous avez déjà téléchargé le pack de langue approprié et que vous l'avez placé à l'emplacement spécifié. Veillez à installer IronOCR et à ajouter la gestion des erreurs nécessaire dans le code de production.

