An Image processing apparatus, comprising: a detection unit configured to detect corresponding relationships between two or more pairs of lines, wherein each line of each pair Is in one image of a pair of Images, each image from the pair of images having different local deformation relative to an other image from the pair of images, wherein a line is a pixel string of pixels extending along the direction approximately perpendicular to the sides of the pair of images to be concatenated, wherein the corresponding relationships are detected by calculating feature quantities of the pair of images at image ends where the pair of images are connected, and by comparing the calculated feature quantities in the image ends of the pair of images so as to detect corresponding relationships between the lines in the pair of images, and wherein calculating a feature quantity In an image end comprises: If the image end is a black pixel, extending the line radially in a plurality of directions from the image end toward the interior of the image and obtaining a direction in which black pixels continue longest and determining the obtained direction to be the feature quantity of the image end; a correction unit configured to correct the local deformation of each of the pair of images, based on the corresponding relationships between the two or more pairs of lines, by changing an interval of at least a first pair of lines of the two or more pairs of lines, so that the interval between the first pair of lines matches an interval between a second pair of lines of the two or more pairs of lines In an area defined by the second pair of lines corresponding to the first pair of lines in the other of the images, based on the corresponding relationships between the lines, wherein the first pair of lines is included in a different image from the pair of images to the image from the pair of images that includes the second pair of lines; and a concatenation unit configured to concatenate the pair of images in which the local deformation is corrected into a single image. a detection unit configured to detect corresponding relationships between two or more pairs of lines, wherein each line of each pair Is in one image of a pair of Images, each image from the pair of images having different local deformation relative to an other image from the pair of images, wherein a line is a pixel string of pixels extending along the direction approximately perpendicular to the sides of the pair of images to be concatenated, wherein the corresponding relationships are detected by calculating feature quantities of the pair of images at image ends where the pair of images are connected, and by comparing the calculated feature quantities in the image ends of the pair of images so as to detect corresponding relationships between the lines in the pair of images, and wherein calculating a feature quantity In an image end comprises: If the image end is a black pixel, extending the line radially in a plurality of directions from the image end toward the interior of the image and obtaining a direction in which black pixels continue longest and determining the obtained direction to be the feature quantity of the image end; a correction unit configured to correct the local deformation of each of the pair of images, based on the corresponding relationships between the two or more pairs of lines, by changing an interval of at least a first pair of lines of the two or more pairs of lines, so that the interval between the first pair of lines matches an interval between a second pair of lines of the two or more pairs of lines In an area defined by the second pair of lines corresponding to the first pair of lines in the other of the images, based on the corresponding relationships between the lines, wherein the first pair of lines is included in a different image from the pair of images to the image from the pair of images that includes the second pair of lines; and a concatenation unit configured to concatenate the pair of images in which the local deformation is corrected into a single image.