线性空间滤波器 Linear Spatial Filtering
Convolution 卷积
Mean Filter
- 教学目的,不怎么用
- image correction
- 中间是9个数的平均值(9个值得weight一样)
- MATLAB: h = fspecial('average',hsize);
- 优点:reduce additive noise
- 缺点:Blur the image
Gaussian Filter
基础
- 模型
- 2D Gaussian function
- P(x,y)是高斯值,代表weight
- 越靠近中点,weight越高
- 离散高斯过滤器 Discrete Gaussian filters
- 高斯函数是连续的,但是我们只关注window → 离散
- 我们将结果归一化(normalise),使过滤器entries相加为1。
- MATLAB:h = fspecial('gaussian',hsize,sigma)
- Example
-
假设我们想使用一个5x5窗口来应用σ^2 = 1的高斯滤波器
-
相加结果为0.96,所以(每个entry)要乘1/0.96,结果相加才是1
-
- 优点:没有mean filter那么模糊
- 原因:it assigns higher weight to the center pixe
- 应用
- 半调平滑
可分离的
- 原理
- 5*5