Patent ID: 8648927

Claim:
An imaging device comprising: an automatic focal position determination section that determines respective in-focus positions for a plurality of subjects based on image data; a main subject determination section that determines a main subject based on the image data; a focal position shifting section that, if a physical quantity representing a difference between an in-focus position of the main subject and an in-focus position of a non-main subject is equal to or greater than a first threshold value, shifts a focal position for the non-main subject from the in-focus position of the non-main subject towards the main subject side; a focus bracket imaging section that acquires a plurality of images by sequentially capturing images at the in-focus position of the main subject and the shifted focal position of the non-main subject; a corresponding point detection section that, taking an image captured at the in-focus position of the main subject as a reference image, detects corresponding points of the plurality of the subjects between the reference image and a non-reference image that is an image other than the reference image; an image deformation section that deforms the non-reference image such that positions of the detected corresponding points are aligned; and an image generation section that generates a blur adjusted image in which a degree of blur in a region other than a region of the main subject is adjusted based on the reference image and the deformed non-reference image.