Methods and systems for dewarping images allow a user to reduce distortion
in scanned images. A scanned image is processed using an optics model and
an illumination model, and resampled to reduce distortion. The dewarping
may be improved through iterative operations where a model parameter is
varied. An optimal image is obtained which corresponds to a maximum
metric as a measure of the quality of a resampled image.