1. An image processing apparatus comprising an image photographing unit, and a control unit, wherein the control unit includes: a document image acquiring unit that acquires a document image including at least an image of a document photographed by the image photographing unit; a contour extracting unit that extracts a contour of the document from the document image acquired by the document image acquiring unit, the extracting the contour being performed based on luminance; a distortion position detecting unit that detects a contour straight line located at a location where a distance between the contour extracted by the contour extracting unit and a center point of a rectangle having the minimum area surrounding the contour is shortest, the contour straight line being detected as a distortion position in the document, the contour straight line being located on the contour; and a corrected image generating unit that performs a geometric correction on the document image to extend the contour to a correction reference line determined from the distortion position detected by the distortion position detecting unit, and generates a corrected image having the distortion in the document image corrected.