IronOCRで数式を扱う
Curtis Chau
更新日: 2026年7月6日
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 = OcrLanguage.Custom;
Ocr.UseCustomTesseractLanguageFile("equ.traineddata");
// Read and OCR the image containing equations
using (var Input = new OcrInput())
{
Input.LoadImage(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);
}
}
}' VB Example to demonstrate reading equations using IronOCR
Imports IronOcr ' Import the IronOcr namespace
Public Class EquationOcrExample
Public Sub ReadEquations(imagePath As String)
' Instantiate the IronTesseract object
Dim Ocr As New IronTesseract()
' Load the custom EQU language for better equation detection
Ocr.Language = OcrLanguage.Custom
Ocr.UseCustomTesseractLanguageFile("equ.traineddata")
' Read and OCR the image containing equations
Using Input As New OcrInput()
Input.LoadImage(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' VB Example to demonstrate reading equations using IronOCR
Imports IronOcr ' Import the IronOcr namespace
Public Class EquationOcrExample
Public Sub ReadEquations(imagePath As String)
' Instantiate the IronTesseract object
Dim Ocr As New IronTesseract()
' Load the custom EQU language for better equation detection
Ocr.Language = OcrLanguage.Custom
Ocr.UseCustomTesseractLanguageFile("equ.traineddata")
' Read and OCR the image containing equations
Using Input As New OcrInput()
Input.LoadImage(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上記の例では、IronOCRはTesseract OCRエンジンを利用して画像ファイルから方程式を読み取ります。方程式用のカスタム言語パック(equ)が検出精度を向上させるためにロードされます。 ReadEquations メソッドは、方程式を含む画像のファイルパスを受け取り、OCRを実行し、認識されたテキストを出力します。
テクニカルライター
Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。