A Fully Automatic System for Restoration of Historical Document Images