A method for enhancing wide dynamic range in images is disclosed. The
method comprises acquiring at least two images of a scene to be imaged,
the images acquired using different exposure times. For a first image an
illumination mask is constructed corresponding to the illumination in the
scene, comprising a set of continuous 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 weight values to each pixels,
whereas other weight value is assigned to other pixels of the other
images. A spatial low-pass filter is used to smooth border zones on the
illumination mask, thus assigning pixels in the border zones new
continuous weight values in a range between the weight values. A combined
image is constructed using combined weight values with image data of
pixels assigned with one weight value of the first image and image data
of pixels assigned with other weight value of the other images and in
pixels corresponding to the border zones using image data from the images
proportional to the new weight values.