Geometry Restoration and Dewarping of Camera-Captured Document Images