在 IronOCR 中使用阿拉伯数字

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

阿拉伯语、波斯语和乌尔都语语言包无法识别阿拉伯数字?

这是 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);
        }
    }
}

注意:此 C# 示例演示了如何在 IronOCR 中使用自定义 Tesseract 语言文件来提高图像中阿拉伯数字的识别率。 它假定您已经下载了相应的语言包并将其放置在指定位置。 请务必安装 IronOCR 并在生产代码中添加必要的错误处理。

Curtis Chau 拥有卡尔顿大学的计算机科学学士学位,专注于前端开发,精通 Node.js、TypeScript、JavaScript 和 React。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。

阅读更多

准备开始了吗?

Nuget Downloads 6,357,159版本:2026.11刚刚发布