1. An imaging device comprising: an image blur evaluator that evaluates the amount of blurring due to a camera shake; an imaging processor that captures a plurality of secondary images of the same object at different lens positions by driving a photographing lens; an edge contour extraction processor that extracts edge contour components of the secondary images and creates an edge contour extracted image for each of the secondary images; an image divider that divides each edge contour extracted image into a plurality of relatively large blocks when the magnitude of blurring is evaluated to be relatively substantial, and into relatively small blocks when the magnitude of the blurring is evaluated to be moderate, with each block including at least one pixel; and a distance information detector that detects distance information of the objects captured in each block based on the contrast in each of the blocks.