Markov Networks for OCR