IRONSOFTWAREHOME
读取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);
}
Imports IronOcr
Imports IronSoftware.Drawing
Imports System

' Create a new instance of IronTesseract for performing OCR operations
Dim 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 input = New OcrInput()
    ' Specify the MICR of the image to focus on for OCR (coordinates in pixels)
    Dim 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
    Dim result = ocr.Read(input)

    ' Output the recognized text to the console
    Console.WriteLine(result.Text)
End Using
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,236,385版本:2026.9刚刚发布

Key in blue circle

立即获取免费的 30 天试用版密钥

Your trial license will be sent to your email address

无任何限制。100% 解锁。无需信用卡。

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 天试用密钥
无需信用卡或创建账户