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