1. An image processing apparatus comprising: an image input unit for taking image data, generated by capturing an image of a document having a rectangle region and a tab portion provided on a side of the rectangle region, as input; a line determination unit for detecting from coordinates of pixels in the image data and on a side of the image data having a tab portion in said image data, a line extending the boundary of the tab portion opposite to the boundary of the rectangle region, and a line extending the boundary of the rectangle region; a selector for selecting, in accordance with a setting that designates an outside or an inside of said document region, a line in the outside or in the inside of said document region from the lines detected by said line determination unit; and an image cropper for cropping an image of said document region with said selected line as a boundary line.