1. An image processing device comprising: an image acquiring unit configured to acquire first and second image groups including a plurality of images each sharing a common part of a subject with at least one of the other images in each of different first and second directions; a shading component calculating unit configured to calculate, as a shading component, a ratio of luminance of an area in one or more images, the area sharing a common subject with another area including a flat area whose shading component is constant in a single image other than the one or more images, to luminance of the another area, for each of the first and second image groups; and an image correcting unit configured to perform a shading correction on shading areas in the images by using the shading component, wherein the shading component includes a normalized shading component using, as a reference, luminance of the flat area in a common area where the single image and the one of the other images share the common subject, and a non-normalized shading component using, as a reference, luminance of an area other than the flat area in the common area, and the image correcting unit is configured to perform the shading correction based on the normalized shading component and the non-normalized shading component.