读取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支票,我们首先需要将 OCR.Language 设置为 OcrLanguage.MICR,以确保 IronOCR 识别到此读取专用于 MICR 支票。 但是,请注意在使用前必须安装 OcrLanguage.MICR 包,否则将抛出错误。

之后,我们将矩形定义为我们的 OCR 区域,以指定 IronOCR 在 MICR 支票中查找 MICR 部分,从而确保最高的准确度。

之后,我们调用 LoadImage 以加载您的支票图像和定义于上面行的内容区域。 最后,我们调用 Read 方法扫描示例支票图像。 然后打印出OCR识别过程提取出的文本。

通过我们全面的 C# 指南,解锁 MICR 支票识别的强大功能!
在 GitHub 上查看

准备开始了吗?

Nuget Downloads 6,357,159版本:2026.11刚刚发布