在IronOCR中使用阿拉伯數字

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

阿拉伯語、波斯語和烏爾都語語言包無法識別阿拉伯數字嗎?

這是Tesseract語言包已知的問題。

以下語言包可能有助於解決阿拉伯數字的問題: Shreeshrii's 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);
        }
    }
}

注意:此C#範例演示如何在IronOCR中使用自定義Tesseract語言檔案以提高在圖像中識別阿拉伯數字的能力。 假設您已經下載了適當的語言包並將其放置在指定的位置。 確保安裝IronOCR並在產品程式碼中加入必要的錯誤處理。

Curtis Chau擁有Carleton大學的電腦科學學士學位,專精於前端開發,擁有Node.js、TypeScript、JavaScript和React的專業知識。Curtis熱衷於建立直觀且美觀的使用者介面,喜愛使用現代框架並建立結構良好、視覺吸引力的手冊。

閱讀更多

準備開始了嗎?

Nuget Downloads 6,357,159版本:2026.11剛剛發布