Handling Slashed Zeros in IronOCR

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

Les zéros barrés ne sont pas reconnus correctement, ils sont identifiés comme g, 6 ou 8?

Cela peut poser problème avec les packs linguistiques de Tesseract.

Le pack linguistique suivant peut aider à résoudre ce problème avec des zéros barrés : SlashedZeroOCR

Elle peut ensuite être utilisée avec la fonctionnalité IronOCR pour charger des packs linguistiques personnalisés : Exemple de langage personnalisé dans IronOCR

// Import the IronOcr namespace
using IronOcr;

class Program
{
    static void Main(string[] args)
    {
        // Initialize IronTesseract class
        var Ocr = new IronTesseract();

        // Use a custom Tesseract language file, which may help with recognizing slashed zeros
        Ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata");

        // Specify the OCR input image
        using (var Input = new OcrInput(@"images\image.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

            // Output the recognized text to the console
            Console.WriteLine(Result.Text);
        }
    }
}
// Import the IronOcr namespace
using IronOcr;

class Program
{
    static void Main(string[] args)
    {
        // Initialize IronTesseract class
        var Ocr = new IronTesseract();

        // Use a custom Tesseract language file, which may help with recognizing slashed zeros
        Ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata");

        // Specify the OCR input image
        using (var Input = new OcrInput(@"images\image.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

            // Output the recognized text to the console
            Console.WriteLine(Result.Text);
        }
    }
}
' Import the IronOcr namespace
Imports IronOcr

Friend Class Program
	Shared Sub Main(ByVal args() As String)
		' Initialize IronTesseract class
		Dim Ocr = New IronTesseract()

		' Use a custom Tesseract language file, which may help with recognizing slashed zeros
		Ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata")

		' Specify the OCR input image
		Using Input = New OcrInput("images\image.png")
			' Perform OCR on the input image
			Dim Result = Ocr.Read(Input)

			' Output the recognized text to the console
			Console.WriteLine(Result.Text)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel
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,044,537 | Version : 2025.11 vient de sortir