Automatic processing of documents and bank cheques