IronOCRでアラビア数字を扱う
アラビア語、ペルシャ語、ウルドゥー語の言語パックではアラビア数字が認識されないのですか?
これは、Tesseract 言語パックの既知の問題です。
次の言語パックは、アラビア数字に関するこの問題の解決に役立つ可能性があります。 ShreeshriiのTessdata Arabic
これを IronOCR 機能と組み合わせて使用し、カスタム言語パックを読み込むことができます。 IronOCRカスタム言語の例
using IronOcr;
class ArabicNumeralOCR
{
static void Main(string[] args)
{
// Initialize a new instance of IronTesseract for OCR
var Ocr = new IronTesseract();
// Load the custom Tesseract language file for better numeral recognition
Ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata");
// Specify the image input for OCR processing
using (var Input = new OcrInput(@"images\image.png"))
{
// Execute the OCR process on the input image
var Result = Ocr.Read(Input);
// Output the recognized text
Console.WriteLine(Result.Text);
}
}
}using IronOcr;
class ArabicNumeralOCR
{
static void Main(string[] args)
{
// Initialize a new instance of IronTesseract for OCR
var Ocr = new IronTesseract();
// Load the custom Tesseract language file for better numeral recognition
Ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata");
// Specify the image input for OCR processing
using (var Input = new OcrInput(@"images\image.png"))
{
// Execute the OCR process on the input image
var Result = Ocr.Read(Input);
// Output the recognized text
Console.WriteLine(Result.Text);
}
}
}Imports IronOcr
Friend Class ArabicNumeralOCR
Shared Sub Main(ByVal args() As String)
' Initialize a new instance of IronTesseract for OCR
Dim Ocr = New IronTesseract()
' Load the custom Tesseract language file for better numeral recognition
Ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata")
' Specify the image input for OCR processing
Using Input = New OcrInput("images\image.png")
' Execute the OCR process on the input image
Dim Result = Ocr.Read(Input)
' Output the recognized text
Console.WriteLine(Result.Text)
End Using
End Sub
End Class注:この C# の例では、IronOCR でカスタム Tesseract 言語ファイルを使用して、画像内のアラビア数字の認識を向上させる方法を示します。 適切な言語パックが既にダウンロードされ、指定された場所に配置されていることを前提としています。 必ず IronOCR をインストールし、本番環境コードに必要なエラー処理を追加してください。






