在 IronOCR 中使用阿拉伯數字

This article was translated from English: Does it need improvement?
Translated
View 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);
        }
    }
}
$vbLabelText   $csharpLabel

注意:此 C# 範例示範如何在 IronOCR 中使用自訂 Tesseract 語言檔案來提高影像中阿拉伯數字的辨識率。 它假定您已經下載了相應的語言包並將其放置在指定位置。 請務必安裝 IronOCR 並在生產代碼中加入必要的錯誤處理。

柯蒂斯·週
技術撰稿人

Curtis Chau擁有卡爾頓大學電腦科學學士學位,專長於前端開發,精通Node.js、TypeScript、JavaScript和React。他熱衷於打造直覺美觀的使用者介面,喜歡使用現代框架,並擅長撰寫結構清晰、視覺效果出色的使用者手冊。

除了開發工作之外,柯蒂斯對物聯網 (IoT) 也抱有濃厚的興趣,致力於探索硬體和軟體整合的創新方法。閒暇時,他喜歡玩遊戲和製作 Discord 機器人,將他對科技的熱愛與創造力結合。

準備好開始了嗎?
Nuget 下載 5,299,091 | 版本: 2025.12 剛剛發布