使用 IronOCR 处理方程式
This article was translated from English: Does it need improvement?
TranslatedView the article in English
IronOCR 能读取方程式吗?
IronOCR 使用 Tesseract 4/5,开箱即用,读取方程式的效果应该相当不错,不过您可能需要尝试一下更详细的配置选项:
您还可以向 IronOCR 添加自定义语言包:了解自定义语言包
此外,还有一个 EQU 方程式检测语言包: 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);
}
}
}$vbLabelText $csharpLabel
在上面的例子中,IronOCR 使用 Tesseract OCR 引擎从图像文件中读取方程式。为了提高识别精度,加载了自定义的方程式语言包 ( equ )。 ReadEquations方法接受包含方程式的图像的文件路径,执行 OCR,并输出识别出的文本。
准备开始了吗?
Nuget 下载 5,299,091 | 版本: 2025.12 刚刚发布






