1. An image processing apparatus, comprising: an acceptance unit that accepts image data and reading data read from a medium on which an image of the image data is formed; an extraction unit that extracts rectangular images by segmenting one image of the image data and the reading data to have a size calculated based on an error which occurs from an image forming apparatus forming the image of the image data on the medium and/or an image reading apparatus reading the medium; a first searching unit that selects at least one of the rectangular images extracted by the extraction unit, set a search range calculated from the error, searches for a matching position of the selected rectangular image in the other image of the image data and the reading data; an estimation unit that estimates a matching position of a rectangular image in the other image on the basis of the matching position of the selected rectangular image in the other image; a second searching unit that searches for a matching position of the other rectangular image in the other image using the matching position estimated by the estimation unit as a reference; and a comparison unit that compares the rectangular image extracted by the extraction unit with the rectangular image in the other image at the position searched by the first and second searching units.