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 As 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 As New OcrInput()
' Specify the MICR of the image to focus on for OCR (coordinates in pixels)
Dim contentArea As 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
Install-Package IronOcr
MICR 수표 읽기
수표는 중요한 거래를 처리하는 데 있어 신뢰할 수 있는 방법입니다. IronOCR 사용하면 E-13B MICR 수표를 안정적으로 처리하여 은행 예금 및 기타 금융 워크플로를 자동화할 수 있습니다. 특수 설계된 엔진은 라우팅 번호, 계좌 번호, 수표 번호 등 중요한 정보에 대해 최고의 정확도를 제공하도록 조정되었습니다.
MICR 수표를 읽으려면 먼저 IronOCR 이 판독값이 MICR 수표 전용임을 인식하도록 OCR.Language를 OCRLanguage.MICR로 설정해야 합니다. 단, 사용하기 전에 OcrLanguage.MICR 패키지를 설치해야 하며, 그렇지 않으면 오류가 발생합니다.
그 후, IronOCR MICR 수표에서 MICR 부분을 찾도록 지정하기 위해 직사각형을 OCR 영역으로 정의하여 최고의 정확도를 보장합니다.
그 후, LoadImage를 호출하여 위 줄에 정의된 내용 영역과 함께 수표 이미지를 로드합니다. 마지막으로, 샘플 수표 이미지를 스캔하기 위해 Read 메서드를 호출합니다. 다음으로 OCR 과정에서 추출된 텍스트를 출력하세요.