讀取 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 Download
PM > Install-Package IronOcr
讀取 MICR 支票

讀取 MICR 支票

支票是一種值得信賴的方式來處理重大交易。 使用IronOCR,您可以可靠地處理E-13B MICR支票,以自動化銀行存款和其他金融工作流程。 專用引擎經過調整,以提供關鍵資訊(包括路由號碼、賬號和支票號碼)的最高準確性。

以下程式碼範例展示了如何僅需幾個簡單步驟掃描MICR支票。

程式碼說明

要讀取MICR支票,我們首先需要將OcrLanguage.MICR,以確保IronOCR能夠識別這次閱讀專為MICR支票。 但是,請注意必須在使用前安裝OcrLanguage.MICR套件,否則會拋出錯誤。

隨後,我們定義一個矩形作為我們的OCR區域,以指定IronOCR尋找MICR支票中的MICR部分,以確保最高的準確性。

隨後,我們調用LoadImage來載入您的支票圖像以及上一行中定義的內容區域。 最後,我們調用Read方法來掃描範例支票圖像。 然後列印出從OCR過程中提取的文字。

使用我們全面的C#指南,釋放MICR支票識別的力量!
在GitHub上查看

準備開始了嗎?

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