How OCR Works: The Basic Principles