An image processing apparatus for performing image processing using a plurality of captured images acquired by capturing the same subject in a plurality of exposure states, the image processing apparatus comprising: a target motion amount estimation unit configured to estimate a target motion amount that represents an amount of shift in the position of the subject between a first image and a second image among the captured images, the first image being captured in a first exposure state, and the second image being captured in a second exposure state different from the first exposure state; a corrected image generation unit configured to generate a corrected image by performing motion compensation on the second image based on the target motion amount; and an image processing unit configured to perform image processing using the first image and the corrected image, wherein the image processing involves compositing the first image and the corrected image and generating a composite image with a wide dynamic range, wherein the second image is captured during a time interval between the first image and a third image captured in the first exposure state at a time different from a time when the first image is captured, and the target motion amount estimation unit includes: a first motion amount estimation unit configured to estimate a first motion amount that represents an amount of shift in a position of the subject between the first image and the third image; and a target motion amount determination unit configured to estimate the target motion amount using the first motion amount, characterized in that the target motion amount estimation unit further includes a second motion amount estimation unit configured to estimate a second motion amount that represents an amount of position shift between the first image and the second image, and the target motion amount determination unit is configured to estimate the target motion amount using the first motion amount and the second motion amount. a target motion amount estimation unit configured to estimate a target motion amount that represents an amount of shift in the position of the subject between a first image and a second image among the captured images, the first image being captured in a first exposure state, and the second image being captured in a second exposure state different from the first exposure state; a corrected image generation unit configured to generate a corrected image by performing motion compensation on the second image based on the target motion amount; and an image processing unit configured to perform image processing using the first image and the corrected image, wherein the image processing involves compositing the first image and the corrected image and generating a composite image with a wide dynamic range, wherein the second image is captured during a time interval between the first image and a third image captured in the first exposure state at a time different from a time when the first image is captured, and the target motion amount estimation unit includes: a first motion amount estimation unit configured to estimate a first motion amount that represents an amount of shift in a position of the subject between the first image and the third image; and a target motion amount determination unit configured to estimate the target motion amount using the first motion amount, a first motion amount estimation unit configured to estimate a first motion amount that represents an amount of shift in a position of the subject between the first image and the third image; and a target motion amount determination unit configured to estimate the target motion amount using the first motion amount, characterized in that the target motion amount estimation unit further includes a second motion amount estimation unit configured to estimate a second motion amount that represents an amount of position shift between the first image and the second image, and the target motion amount determination unit is configured to estimate the target motion amount using the first motion amount and the second motion amount.