Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read check number and bank routing number of scanned check [closed]

Tags:

c#

.net

windows

ocr

I m scanning the check and i want to read the check number and bank routing number of that scanned check. please can any one help me with sample code.

like image 409
Honey Avatar asked Jan 20 '23 03:01

Honey


1 Answers

The original scheme for the routing and account numbers used in the US and many other places around the world was optimized specifically for its ability to be machine read. Early on they used a single channel magnetic read head in order to perform this read, as the ink used to print these numbers was magnetic. This meant that the numbers could be read even if obscured with stamps, writing other other printed material.

In fact, the ability to read these is rather simple once you understand how the characters are formed. Probably the easiest way to understand is to look at the first page of the related patent:

http://www.freepatentsonline.com/3000000.pdf

Sample of one type of OCR

So you have a number, and next to each number is a short graph. This graph describes the amount of ink used to print the number as you scan across the number horizontally.

As you can readily see, each number has a very unique signature. The actual MICR font (E-13B) is even more distinct in this regard, and the special characters and terminators surrounding the numbers have the same characteristic - they have a unique signature when you scan horizontally along them and figure out how much "black" was used for each vertical column.

I don't have the MICR spec in front of me, but its boxy appearance occurs on a grid of, I believe, 0.013 inches.

So you need merely do a little feature identification (find the corners of the check, as the numbers are always printed in the same spot) then you can simply scan each vertical column, add up the number of pixels that are black to form the "signal" and look for the features. By resizing the image so you get four pixels per 0.013 inches, you reduce the amount of data you have to process. If you do your feature identification perfectly, you can reduce your resolution to 1 pixel per 0.013 inches and get very close to comparing a few large integers per digit.

They will be distinct enough that you should be able to brute force it, but if you are into digital signal processing (or handy with google and wikipedia) then you can use a simple correlator to identify the digits very quickly, even using a higher resolution.

Other resources:

  • http://mdn.morovia.com/kb/entry/10616/Check-Processing-Fonts-Around-the-World/
  • http://en.wikipedia.org/wiki/Magnetic_ink_character_recognition
  • http://home.comcast.net/~hayosh/HISTMICR.pdf
like image 175
Adam Davis Avatar answered Jan 31 '23 01:01

Adam Davis