Obsluga rownan za pomoca IronOCR
Czy IronOCR potrafi czytac rownania?
IronOCR korzysta z Tesseract 4/5 i powinien działać calkiem dobrze z odczytywaniem rownan po wyjeciu z pudelka, ale możesz chciec poeksperymentowac z opcjami szczegółowej konfiguracji:
Poznaj zmienne konfiguracji Tesseract
Możesz również dodac własne pakiety językowe do IronOCR: Dowiedz sie więcej o własnych pakietach językowych
Istnieje również EQU Equation Detection Language Pack: 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
W przykladzie powyzej IronOCR wykorzystuje silnik OCR Tesseract do odczytywania rownan z pliku obrazu. Wczytywany jest wlasny pakiet jezykowy dla rownan (equ), aby zwiekszyc dokladnosc wykrywania. Metoda ReadEquations akceptuje sciezke do obrazu zawierajacego rownania, wykonuje OCR i wyswietla rozpoznany tekst.

