1. A method of reducing distortion in a scanned image having illumination data, comprising: determining defocus distance data according to the illumination data; determining dewarping factor data according to the defocus distance data; and resampling the image according to the dewarping factor data.