1. An image processing apparatus, which generates a background-blurred image from two images captured by changing an in-focus position, comprising: a calculator configured to calculate coordinate conversion information for associating a position of a first image with a position of a second image; a region setting portion configured to set a first region in the first image and set a second region associated with the first region in the second image based on the coordinate conversion information; an evaluation value obtaining portion configured to compare the first region with the second region to obtain an evaluation value, and to determine whether the first region in the first image is a foreground region or a background region based on the evaluation value; and an image generating portion configured to combine the first image and a blurred image, which is obtained by blurring the first image, based on the evaluation value and to generate the background-blurred image, wherein the image generating portion is configured to use the first image for the foreground region and use the blurred image for the background region.