A method and system for determining the orientation of an image of a
picture within a scanned image, including the steps of locating in the
scanned image the contour of the image of the picture, determining a
plurality of bounding boxes confining the contour of the image of the
picture, selecting one of the plurality of bounding boxes that is
substantially aligned with the contour of the image of the picture, and
calculating an angle of rotation of the picture based on the selected
bounding box.