Patent ID: 8730380

Claim:
An imaging device comprising: an imaging unit that includes an imaging element in which phase-difference detection pixels are disposed in a partial region within a light-receiving surface and captures a subject with light made incident on the light-receiving surface of the imaging element via an optical system whose focal point position is movable; a first detector which, on the basis of image signals obtained by image capture by the imaging unit, repeatedly computes, while moving the focal point position of the optical system, a focus evaluation value within a detection region set in an image expressed by the image signals and detects a focus position in the detection region from the relationship between the focal point positions and the focus evaluation values; a second detector that detects a focus position on the basis of detection signals output from the phase-difference detection pixels; an acquiring unit that causes processing that detects focus positions of plural detection regions set in the image to be repeated by the first detector and, when focusing is instructed via an instructing unit, acquires the focus positions of the plural detection regions detected immediately before by the first detector; and a controller which, when focusing is instructed via the instructing unit, selects the first detector in a case where the number of detection regions whose deviation in detected focus position with respect to a focus position detected in a reference detection region among the plural detection regions is within a preset threshold value is less than a predetermined value, selects the second detector in a case where the number of detection regions whose deviation in detected focus position is within the threshold value is equal to or greater than the predetermined value, causes focus position detection to be performed by the selected detector, and causes focus control of the optical system by a focus controller to be performed using the focus position detected by the selected detector.