Simple adaptive binarization code for OCR.