1. An image processing apparatus which composes a plurality of images captured while changing an exposure amount, comprising: a CPU implementing the functions of a displacement detection unit, a correction unit, a moving object region detection unit, a moving object region composition unit, an image composition unit and a moving object processing unit, wherein: the displacement detection unit is configured to detect a displacement amount between the plurality of images; the correction unit is configured to correct a displacement between the images based on the displacement amount detected by the displacement detection unit; the moving object region detection unit is configured to detect a moving object region from the plurality of images for which the displacement has been corrected; the moving object region composition unit is configured to compose a detection result of an underexposed image and a correctly exposed image with a detection result of the underexposed image and an overexposed image; the image composition unit j configured to compose the plurality of images for which the displacement has been corrected to generate a composite image; and the moving object processing unit is configured to replace a region corresponding to the moving object region of the composite image with an image obtained by performing weighted addition of the plurality of images.