Manejo de ecuaciones con IronOCR
¿Puede IronOCR leer ecuaciones?
IronOCR utiliza Tesseract 4/5 y debería funcionar bastante bien al leer ecuaciones de manera predeterminada, aunque puede que desee experimentar con las opciones de configuración detalladas:
Explorar Variables de Configuración de Tesseract
También puede agregar paquetes de idiomas personalizados a IronOCR: Aprenda sobre paquetes de idioma personalizados
También hay un Paquete de Detección de Ecuaciones EQU: Paquete de Idioma 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 ClassEn el ejemplo anterior, IronOCR utiliza el motor OCR de Tesseract para leer ecuaciones de un archivo de imagen. El paquete de idioma personalizado para ecuaciones (equ) se carga para mejorar la precisión de detección. El método ReadEquations acepta una ruta de archivo a la imagen que contiene ecuaciones, realiza OCR y produce el texto reconocido.






