Working with Arabic Numerals in IronOCR

This article was translated from English: Does it need improvement?
Translated
View the article in English

阿拉伯语、波斯语和乌尔都语语言包不识别阿拉伯数字? 这是 Tesseract 语言包的一个已知问题。 以下语言包可帮助解决阿拉伯数字的这一问题: [Shreeshrii's Tessdata Arabic](https://github.com/Shreeshrii/tessdata_arabic) 然后可与 IronOCR 功能一起使用,加载自定义语言包: [IronOCR 定制语言示例](https://ironsoftware.com/csharp/ocr/languages/#custom-language-example) ```csharp 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
技术作家

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

除了开发之外,Curtis 对物联网 (IoT) 有浓厚的兴趣,探索将硬件和软件集成的新方法。在空闲时间,他喜欢玩游戏和构建 Discord 机器人,将他对技术的热爱与创造力相结合。

准备开始了吗?
Nuget 下载 5,044,537 | 版本: 2025.11 刚刚发布