Reference
Computer Vision: Algorithms and Applications (2nd Edition), Richard Szeliski
Chapter 3.1, 3.2
Filters (滤波器)
Image filtering
modify the pixels in an image based on some function of a local neighborhood of each pixel.
Linear filtering
Replace each pixel by a linear combination (a weighted sum) of its neighbors. (cross-correlation, convolution)
the prescription for the linear combination is called the "kernel"
cross-correlation (滑动点积、互相关)
- can think of the dot product between local neighborhood and kernel for each pixel
convolution (卷积)
- same as cross-correlation, except the kernel is "flipped" (horizontally and vertically)
- convolution is commutative and associative (可交换,可结合)
Gaussian kernel (高斯核函数)
- 高斯滤波(平滑),即用某一尺寸的二维高斯核与图像进行卷积。前面的常数是做归一化处理。(can be ignored, as we should re-normalize weights to sum to 1 in any case)
- 高斯核是对连续高斯函数的离散近似,通常对高斯曲面进行离散采样和归一化得出,这里,归一化指的是卷积核所有元素之和为1。
- 去掉图像的高频部分(低通滤波)
- 均值滤波 vs. 高斯滤波 vs. 中值滤波:均值滤波是线性滤波,会将图像中的边缘信息以及特征信息“模糊”掉,会丢失很多特征。均值滤波用中心像素周围的八个像素的均值替换掉原来中心像素的值。中值