Utilisation des chiffres arabes dans IronOCR

This article was translated from English: Does it need improvement?
Translated
View the article in English

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.

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
$vbLabelText   $csharpLabel

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.

Curtis Chau
Rédacteur technique

Curtis Chau détient un baccalauréat en informatique (Université de Carleton) et se spécialise dans le développement front-end avec expertise en Node.js, TypeScript, JavaScript et React. Passionné par la création d'interfaces utilisateur intuitives et esthétiquement plaisantes, Curtis aime travailler avec des frameworks modernes ...

Lire la suite
Prêt à commencer?
Nuget Téléchargements 5,167,857 | Version: 2025.11 vient de sortir