Handling Equations with IronOCR

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

L'IronOcr peut-il lire des équations ?

IronOcr utilise Tesseract 4/5 et devrait fonctionner assez bien avec la lecture d'équations à partir de la boîte, bien que vous puissiez vouloir expérimenter avec les options de configuration détaillées :

Explorer les variables de configuration de Tesseract

Vous pouvez également ajouter des packs linguistiques personnalisés à IronOcr : En savoir plus sur les packs linguistiques personnalisés

Il existe également un pack linguistique EQU Equation Detection : EQU Language Pack

// C# Example to demonstrate reading equations using IronOCR

using IronOcr; // Import the IronOcr namespace

public class EquationOcrExample
{
    public void ReadEquations(string imagePath)
    {
        // Instantiate the IronTesseract object
        var Ocr = new IronTesseract();

        // Load the custom EQU language for better equation detection
        Ocr.Language = Ocr.Languages.Add("equ");

        // Read and OCR the image containing equations
        using (var Input = new OcrInput(imagePath))
        {
            // Extract OcrResult from the image
            var Result = Ocr.Read(Input);

            // Output the contents of the OCR result as text
            System.Console.WriteLine(Result.Text);
        }
    }
}
// C# Example to demonstrate reading equations using IronOCR

using IronOcr; // Import the IronOcr namespace

public class EquationOcrExample
{
    public void ReadEquations(string imagePath)
    {
        // Instantiate the IronTesseract object
        var Ocr = new IronTesseract();

        // Load the custom EQU language for better equation detection
        Ocr.Language = Ocr.Languages.Add("equ");

        // Read and OCR the image containing equations
        using (var Input = new OcrInput(imagePath))
        {
            // Extract OcrResult from the image
            var Result = Ocr.Read(Input);

            // Output the contents of the OCR result as text
            System.Console.WriteLine(Result.Text);
        }
    }
}
' C# Example to demonstrate reading equations using IronOCR

Imports IronOcr ' Import the IronOcr namespace

Public Class EquationOcrExample
	Public Sub ReadEquations(ByVal imagePath As String)
		' Instantiate the IronTesseract object
		Dim Ocr = New IronTesseract()

		' Load the custom EQU language for better equation detection
		Ocr.Language = Ocr.Languages.Add("equ")

		' Read and OCR the image containing equations
		Using Input = New OcrInput(imagePath)
			' Extract OcrResult from the image
			Dim Result = Ocr.Read(Input)

			' Output the contents of the OCR result as text
			System.Console.WriteLine(Result.Text)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

Dans l'exemple ci-dessus, IronOCR utilise le moteur OCR Tesseract pour lire des équations à partir d'un fichier image. Le pack linguistique personnalisé pour les équations (equ) est chargé pour améliorer la précision de la détection. La méthode ReadEquations accepte un chemin d'accès à l'image contenant les équations, effectue l'OCR et produit le texte reconnu.

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