Patent ID: 8477390

Claim:
An image processor comprising a control unit, wherein the control unit includes an image obtaining unit that obtains an image including a document area corresponding to a document read by an image reader; an edge coordinate detecting unit that detects coordinate values of edge candidate pixels, which are candidates of pixels composing an edge of the document area based on the image obtained by the image obtaining unit; a tilt calculating unit, or a tilt obtaining unit that obtains the tilt of the document area detected by a predetermined sensor; an edge end coordinate extracting unit; a straight line calculating unit that calculates a straight line corresponding to the edge based on the tilt of the document area calculated by the tilt calculating unit or obtained by the tilt obtaining unit and a coordinate value of an edge end candidate pixel extracted by the edge end coordinate extracting unit; at least one tilt correcting unit that corrects the tilt of the document area by rotating the document area based on the straight line corresponding to the edge calculated by the straight line calculating unit, and an area clipping unit that clips the document area from the image based on the straight line corresponding to the edge calculated by the straight line calculating unit; wherein the tilt calculating unit calculates an edge candidate straight line, which is a candidate of the straight line corresponding to the edge, based on the coordinate values of the edge candidate pixels, and calculates the tilt of the document area based on the edge candidate straight line calculated, and the edge end coordinate extracting unit corrects the coordinate values of the edge candidate pixels by correcting the edge candidate straight line by appropriately moving the edge candidate straight line in parallel so as to pass through the outermost edge candidate pixel, based on the coordinate values of the edge candidate pixels and the tilt of the document area calculated by the tilt calculating unit or obtained by the tilt obtaining unit, and extracts an outermost one of the coordinate values of the edge candidate pixels after being corrected as the coordinate value of the edge end candidate pixel.