讀取 MICR 支票
using IronOcr;
using IronSoftware.Drawing;
using System;

// Create a new instance of IronTesseract for performing OCR operations
var ocr = new IronTesseract();

// Set the OCR language to MICR to recognize magnetic ink characters
// Must have MICR (IronOcr.Languages.MICR) installed beforehand
ocr.Language = OcrLanguage.MICR;

// Specify the file path of the input image containing MICR text
using (var input = new OcrInput())
{
    // Specify the MICR of the image to focus on for OCR (coordinates in pixels)
    var contentArea = new Rectangle(x: 124, y: 238, width: 309, height: 13);
    // Load the image with the defined content area
    input.LoadImage("micr.png", contentArea);
    // Run the OCR engine to read the MICR text from the input image
    var result = ocr.Read(input);

    // Output the recognized text to the console
    Console.WriteLine(result.Text);
}
NuGet 下載
PM > Install-Package IronOcr
讀取 MICR 支票

讀取 MICR 支票

支票是處理大額交易的可靠方式。 借助 IronOCR,您可以可靠地處理 E-13B MICR 支票,從而實現銀行存款和其他財務工作流程的自動化。 這款專用引擎經過精心調校,能夠為關鍵資訊(包括路由號碼、帳號和支票號碼)提供最高的準確度。

以下程式碼範例示範如何透過幾個簡單的步驟掃描 MICR 支票。

程式碼說明

若要閱讀MICR支票,我們首先需要將OCR.Language設置為OcrLanguage.MICR,以確保IronOCR識別此讀取特別針對MICR支票。 但是,請注意必須在使用前安裝OcrLanguage.MICR套件,否則將引發錯誤。

之後,我們將一個矩形定義為我們的 OCR 區域,以指定 IronOCR 在 MICR 支票中尋找 MICR 部分,從而確保最高的準確度。

之後,我們會呼叫LoadImage來載入您的支票影像及上面定義的內容區域。 最後,我們呼叫Read方法來掃描樣本支票影像。 然後列印出OCR辨識過程提取出的文字。

透過我們全面的 C# 指南,解鎖 MICR 支票識別的強大功能!
在 GitHub 查看

準備好開始了嗎?

NuGet 下載次數 6,411,693版本:2026.11剛剛發布