图像处理自适应滤波器matlab

Below is a small region of an image consisting of a noisy step edge. (The original image had value=30 on the left of the step, and
value=10 to the right of the step.) It was corrupted by additive Gaussian noise with zero mean and variance = 6.5.
32 25 29 30 27 13 14 16 12 7
28 31 32 31 28 11 7 12 6 11
32 28 30 33 31 10 11 8 14 12
27 28 33 32 27 11 12 12 6 12
32 30 29 29 31 13 9 12 13 10
At the three points indicated by the boxes, compute the value of the adaptive filter
shown in Equation 5.3-12 in the textbook. (The size of the filter is 5x5.)You should
give the results of local mean, local var and filter value on these three points.

在这里,我们需要使用自适应滤波器来消除噪声。自适应滤波器通过计算局部统计量来决定每个像素周围的窗口大小。具体来说,自适应滤波器使用如下公式:

F(i,j) = [g(i,j) * h(i,j)] / [1+k * h(i,j)]

其中,F(i,j)是输出图像中的像素值,g(i,j)是输入图像中的像素值,h(i,j)是局部方差,k是常数。

对于给定的图像区域,在指示的三个点上计算自适应滤波器值。对于第一个点(28,28):

局部均值 = (27+30+33+28+31+30+33+29+31+13+9+12+13+10)/13=28.5
局部方差 = sqrt(((27-28.5)^2+(30-28.5)^2+(33-28.5)^2+...+(10-28.5)^2)/13)=6.50
自适应滤波器值 = (28 * 6.50)/(1+0.16.50) = 27.97
第二个点(29,29):
局部均值 = (30+27+13+14+16+12+7+28+31+28+11+7+12+6)/13=20.5
局部方差 = sqrt(((30-20.5)^2+(27-20.5)^2+(13-20.5)^2+...+(6-20.5)^2)/13)=8.54
自适应滤波器值 = (29 * 8.54)/(1+0.1
8.54) = 26.82
第三个点(30,30):
局部均值 = (13+14+16+12+7+28+31+28+11+7+12+6+12+32+30+29+31+13+9+12+13+10)/13=21.5
局部方差 = sqrt(((13-21.5)^2+(14-21.5)^2+(16-21.5)^2+...+(10-21.5)^2)/13)=8.11
自适应滤波器值 = (30 * 8.11)/(1+0.18.11) = 27.47
这些计算都是基于5
5的窗口大小,如果使用不同的窗口大小,结果可能会有所不同。