Document Image Enhancement and Recognition in Low Resource Scenarios : Application to Ciphers and Handwritten Text