How do I make an OCR Program?

A basic approach is to make a histogram of black pixels. First: project all pixels on a line. The deep valleys in the histgram indicate separation between lines (try different angles if the paper might be tilted). Then, per line (or per page if you know the font is monospaced) project the pixels on a horizontal histogram. This will give you a strong indication of inter character spaces. As a minimum this gives you a value for the average character height and width that will help you in next steps.

After that, you need to take care of kerning (where characters overlap). Find the connected pixels, possibly by first doing dilatation or erosion on the image to compensate for scanning artifacts.

Depending on the quality of the scan image you may have to use more advanced techniques, but this will get you going.


This doesn't sound like artificial intelligence, it sounds like you're talking about OCR:

http://en.wikipedia.org/wiki/Optical_character_recognition

See google tesseract

http://code.google.com/p/tesseract-ocr/

EDIT The unedited question was asking about artificial intelligence.