Add page-wise dewarping function