IRONSOFTWAREHOME

在IronOCR中使用自訂OCR語言包

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

如何製作自訂語言包以用於IronOCR?

建立自訂語言包需要從字型訓練新的Tesseract 4 LSTM語言檔案/字典。

網上有許多教程可説明如何完成這個步驟。 這個過程並不簡單,但幸運的是,它有相當好的文件記錄。

作為好的起點,我們建議您參考這個YouTube 教程來自Gabriel Garcia(無關)及其連結的GitHub 儲存庫

一旦完成,輸出將是.traineddata檔案。

然後可以在IronOCR中參考.traineddata檔案,如下所示:

文件資料:IronOCR 自訂語言

using IronOcr;

class Program
{
    static void Main()
    {
        // Initialize the IronTesseract OCR engine
        var Ocr = new IronTesseract();

        // Load your custom Tesseract language file (trained .traineddata file)
        Ocr.UseCustomTesseractLanguageFile("mydir/custom.traineddata");  //<--- your new font

        // Multiple fonts can be used by calling the method multiple times with different files

        // Load an image into the OCR Input for processing
        using (var Input = new OcrInput(@"images\image.png"))
        {
            // Perform OCR on the input image
            var Result = Ocr.Read(Input);

            // Output the recognized text to the console
            Console.WriteLine(Result.Text);
        }
    }
}
Curtis Chau
技術作家

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

...
閱讀更多

準備開始了嗎?

Nuget Downloads 6,254,007版本:2026.9剛剛發布

立即獲取您的30天試用金鑰
無需信用卡或帳戶建立
Key in blue circle

立即免費取得 30 天試用金鑰

Your trial license will be sent to your email address

無任何限制。100% 解鎖。無需信用卡。

OR
bullet_checked無需信用卡或建立帳號無任何限制。100% 解鎖。無需信用卡。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
獲取您的無義務諮詢
填寫以下表格或發送電子郵件至sales@ironsoftware.com
您的詳細資訊將始終保密。
被全球數百萬工程師信任
Iron Software的客戶標誌
立即獲取您的30天試用金鑰
無需信用卡或帳戶建立