cropping,refactoring

cropping on long images, refactoring of settings and small refactoring
of ocr.py