1. An image processing apparatus comprising: an image capturing unit which captures an image, wherein the image is defined by outermost edges and includes a target object within the outermost edges; an edge detecting unit which detects edges existing within the outermost edges of the image captured by the image capturing unit; a weighting unit which performs weighting onto the edges detected by the edge detecting unit depending on whether or not the detected edges contact any of the outermost edges of the image, and which erases edges contacting the outermost edges from the detected edges; a straight edge line detecting unit which detects straight edge lines forming linear border lines of the target object based on edges of the detected edges remaining after erasure of the edges contacting the outermost edges by the weighting unit; and an area extracting unit which extracts from the image an area in which the target object exists based on the straight edge lines detected by the straight edge line detecting unit.