1. A method for generating a high dynamic range (HDR) image using a set of N images having different exposure levels, the method comprising: (a) generating, for each of the set of N images, an exposure quality map based on brightness levels of the pixels in the image, wherein the exposure quality map has pixels having exposure quality values calculated from the brightness levels of the pixels of the image; (b) calculating a quality score for each of a plurality of subset of M images of the set of N images, including: (b1) generating a combined exposure quality map from the exposure quality maps corresponding to the M images; and (b2) calculating the quality score from the combined exposure quality map based on the pixel values of the combined exposure quality map; (c) selecting one subset from the plurality of subsets of M images based on the calculated quality scores for the plurality of subsets; and (d) generating an HDR image using the selected subset of M images, wherein in step (a), the exposure quality map is generated by assigning, to each pixel block of the image, an exposure quality value based on a brightness value of the pixel block and an exposure quality function, wherein the exposure quality function maps brightness values within a center brightness range to more favorable exposure quality values, and maps brightness values outside of the center brightness range to less favorable exposure quality values.