1. An imaging device having a function of mixing a plurality of images captured under different exposure conditions, comprising: a detecting means configured for detecting positional deviations and amounts of shaking among the plurality of images, and a mixing means configured for measuring a difference in the pixels from a first image and a second image corrected in positional deviation based on detection results of the detecting means and the difference in a corresponding pixel at an edge of the respective images and increasing a mixing ratio of the first image to the second image when the difference value exceeds a threshold value set in advance and lowering the mixing ratio of the first image to the second image when the difference value is at or below the threshold value.