A system includes a stereoscopic camera to generate images of a document,
such as a book, that can be converted to a three-dimensional contour of
the document. A second camera take a two-dimensional image of the
document. A model is generated that defines a mapping between the
three-dimensional contour of the document and a two-dimensional flattened
(de-warped) version of the document. The model may be applied to the
two-dimensional image taken by the second camera to compensate for
warping in the image.