在 IronOCR 中使用阿拉伯数字
This article was translated from English: Does it need improvement?
TranslatedView the article in English
阿拉伯语、波斯语和乌尔都语语言包无法识别阿拉伯数字?
这是 Tesseract 语言包的一个已知问题。
以下语言包或许有助于解决阿拉伯数字的显示问题: Shreeshrii 的 Tessdata 阿拉伯语
然后可以将其与 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$vbLabelText $csharpLabel
注意:此 C# 示例演示了如何在 IronOCR 中使用自定义 Tesseract 语言文件来提高图像中阿拉伯数字的识别率。 它假定您已经下载了相应的语言包并将其放置在指定位置。 请务必安装 IronOCR 并在生产代码中添加必要的错误处理。
准备开始了吗?
Nuget 下载 5,246,844 | 版本: 2025.12 刚刚发布






