An imaging apparatus, comprising
- an imaging optical system configured to image a subject image;
- a solid-state image pickup device configured to convert the subject image imaged by the imaging optical system into an electrical signal and output the electrical signal as image data;
- a photographing position determining device configured to determine a plurality of photographing positions having different focal positions of the imaging optical system to continuously photograph a subject;
- a continuously-photographing processing device configured to obtain a plurality of photographed images by continuously photographing the subject through the solid-state image pickup device at the plurality of photographing positions determined by the photographing position determining device;
- an image data dividing device configured to divide the image data into a plurality of sections;
- a section focus information obtaining device configured to obtain section focus information about a focused state of each of the plurality of sections at a plurality of reference positions;
- a section focusing position calculating device configured to calculate a focusing position in which each of the plurality of sections is in the focused state based on the section focus information obtained by the section focus information obtaining device;
- and
- a focusing position distribution information obtaining device configured to calculate a number of focused sections each being in the focused state at each reference position based on the focusing positions of the plurality of sections calculated by the section focusing position calculating device and obtain focusing position distribution information,
- wherein the image data dividing device includes
- a large section dividing device configured to divide the image data into a first predetermined number of large sections each having a first predetermined size, and
- a small section dividing device configured to divide the image data into a second predetermined number of small sections each having a second predetermined size smaller than the first predetermined size, the second predetermined number being larger than the first predetermined number;
- and
- the photographing position determining device includes
- a device configured to determine one or more reference positions different from each other as the photographing positions based on the focusing position distribution information of the large sections obtained by the focusing position distribution information obtaining device for the plurality of large sections, and when a number of the photographing positions determined based on the focusing position distribution information of the large sections is less than a predetermined number of the photographing positions, to additionally determine the reference position as the photographing position based on the focusing position distribution information of the small sections obtained by the focusing position distribution information obtaining device for the plurality of small sections such that the predetermined number of the determined photographing positions different from each other is obtained.