MATLAB 中图像去噪的几何均值滤波器

Geometric mean filter for denoising image in MATLAB

我是 MATLAB 新手。我不知道如何使用几何平均滤波器来过滤噪声图像。对于算术平均过滤器,我使用这个:

H = fspecial('average',5);
a = imfilter(a, H);

几何均值滤波有没有类似的方法?

是的。我建议阅读在 The Mathworks 工作的 Steve Eddins 的 Wikipedia page about geometric mean as well as this blog

借用史蒂夫的解释(实际上是整个code/example):

The local geometric mean filter multiplies together all the pixel values in the neighborhood and then takes the N-th root, where N is the number of pixels in the neighborhood.

因此,就 Matlab 代码而言,h 是内核,其中填充了具有您用来计算平均值的邻域大小的内核,I 是您的图像:

geo_mean = imfilter(log(I), h, 'replicate');
geo_mean = exp(geo_mean);
geo_mean = geo_mean .^ (1/numel(h));

希望对您有所帮助!