1. An image processing apparatus comprising: a detection unit that detects segments from a first image; a selection unit that selects pairs of segments formed of a predetermined number of segments counted from a higher priority in an order of length among the detected segments and segments in a second image, the second image being a model of the first image; and a calculation unit that calculates distortion of the first image with respect to the second image by using the pairs of segments.