A distortion correction device performs pre-processing on an input image
data of a double page spread document or the like and produces an edge
image. Upper and lower ends of the document are detected from the
produced edge image. From the detected upper and lower ends of the
document, a relative position of an imaging unit with respect to the
document is detected. An approximate distance from the imaging unit to
the document, the relative position of the imaging unit and information
about the ends of the document are used to calculate respective heights
of points on the document. The input image data then undergoes geometric
conversion correction by means of information about the heights. In this
way, the distortion correction device can be provided capable of easily
and accurately correcting distortion of the image due to nonuniform
height of the surface of the object, i.e., document, regardless of
imaging conditions.