使用 IronOCR 處理方程式

Curtis Chau
Curtis Chau
Updated: 2026年6月29日

IronOCR 可以讀取方程式嗎?

IronOCR 使用 Tesseract 4/5,應該能夠很好地直接讀取方程式,但您可能想要嘗試詳細的配置選項:

探索 Tesseract 配置變數

您也可以將自定義語言包加入 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);
        }
    }
}

在上述範例中,IronOCR 利用 Tesseract OCR 引擎從圖像文件中讀取方程式。方程式的自定義語言包 (equ) 已載入以提高檢測精確性。 ReadEquations 方法接受包含方程式的圖像的文件路徑,執行 OCR 後輸出識別的文字。

Curtis Chau擁有Carleton大學的電腦科學學士學位,專精於前端開發,擁有Node.js、TypeScript、JavaScript和React的專業知識。Curtis熱衷於建立直觀且美觀的使用者介面,喜愛使用現代框架並建立結構良好、視覺吸引力的手冊。

閱讀更多

準備開始了嗎?

Nuget Downloads 6,357,159版本:2026.11剛剛發布