Traitement des équations avec IronOCR
IronOCR peut-il lire des équations ?
IronOCR utilise Tesseract 4/5 et devrait fonctionner assez bien pour la lecture d'équations dès sa sortie de l'emballage, bien que vous puissiez souhaiter expérimenter avec les options de configuration détaillées :
Explorer les variables de configuration de Tesseract
Vous pouvez également ajouter des modules linguistiques personnalisés à IronOCR : En savoir plus sur les modules linguistiques personnalisés
Il existe également un pack de langue pour la détection d'équations EQU : Pack de langue EQU
// 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
Dans l'exemple ci-dessus, IronOCR utilise le moteur OCR Tesseract pour lire des équations à partir d'un fichier image. Le pack de langues personnalisé pour les équations (equ) est chargé afin d'améliorer la précision de la détection. La méthode ReadEquations accepte un chemin d'accès au fichier contenant des équations, effectue une OCR et renvoie le texte reconnu.

