A method for enhancing wide dynamic range in images. The method comprises:
acquiring at least two images of a scene to be imaged, the images
acquired using different exposure times; constructing for a first image
an illumination mask comprising a set of two weight values distinctively
identifying respective areas of pixels of high or low illumination,
over-exposed or underexposed with respect to a predetermined threshold
illumination value, assigning one of the values to each pixels in them,
whereas the other value is assigned to other pixels of the other images;
using a low-pass filter to smooth border zones between pixels of one
value and pixels of the other value, thus assigning weight values in a
range between the two weight values; constructing a combined image using
image data of pixels of the first image and image data of pixels of the
other images proportional to the weight values assigned to each pixel
using the illumination mask.