1. An image processing device, comprising: a merging portion that generates a merged image by merging together a first image obtained by shooting, a second image obtained by shooting with an exposure time that is longer than an exposure time with which the first image is shot, and a third image generated by filtering out a high-frequency component from the first image; and a differential value calculation portion that calculates a differential value between each pair of corresponding pixels in the second and third images and an edge intensity value calculation portion that extracts edges in an image based on the first image and calculates an edge intensity value of each pixel, wherein the merging portion determines a first merging ratio for each pixel according to the differential value, the first merging ratio being a merging ratio between the second and third images; the merging portion determines a second merging ratio of each pixel according to the edge intensity value, the second merging ratio being a merging ratio between the first image and the second and third images; and the merging portion generates the merged image by pixel-by-pixel merging processing based on the first and second merging ratios.