Indexing of Historical Document Images: Ad Hoc Dewarping Technique for Handwritten Text