A method is disclosed for enhancing the quality of an image dataset, such as, e.g., reducing the
noise in a noisy image
data set and increasing the contrast in the image
data set. The method may be used for
processing a sequence of image datasets, e.g.
night vision image datasets, wherein said sequence comprises at least two image datasets each having at least two pixels, and wherein each pixel has an intensity value. The method comprises calculating a
structure tensor for each pixel in an image dataset comprised in the sequence of image datasets; calculating values in a summation kernel based on said
structure tensor for each pixel in said image dataset; calculating a weighted intensity value for each pixel in said first image dataset, using as weights the values in said summation kernel; storing said weighted intensity value for each pixel in said image dataset as a processed intensity value for each corresponding pixel in a processed output image dataset; rotating a local coordinate
system in which the summation kernel is described resulting in that the coordinate axes of said local coordinate
system coincide with the directions of the eigenvectors of said
structure tensor, where said eigenvectors are described in the
global coordinate system of the image dataset, and scaling the coordinate axes of the local coordinate
system in which the summation kernel is described by an amount related to the eigenvalues of the structure
tensor via a width function W(λi)=σi, and wherein said eigenvalues depend on the amount of intensity variation in the direction of their corresponding eigenvectors, the width function being a decreasing function such that w(0)=σmax and lima→∞w=σmin. An apparatus and a computer readable medium are also provided.