# 高斯滤波

高斯滤波是一种信号与图像处理方法，它将数据与归一化的高斯核进行卷积，以平滑数据、抑制噪声，代价是模糊精细细节。它是边缘检测、特征检测和多尺度图像分析的基础构件，在平滑核中占据特殊地位：n维高斯是唯一既完全圆对称又可分离的算子；其[傅里叶变换](https://www.edgepedia.org/zh/fourier-transform)仍是高斯函数，因此不会引入振铃；并且在海森堡–外尔不等式的意义上，它在空间和频率上同时达到最优局域化。<sup>[1](https://visionbook.mit.edu/blurring_2.html)</sup><sup> • </sup><sup>[2](https://www.ipol.im/pub/art/2013/87/article.pdf)</sup><sup> • </sup><sup>[3](https://www.cs.ubc.ca/~lsigal/425_2020W1/Lecture5.pdf)</sup>

| 关键事实 | 值 |
|---|---|
| 二维核 | \( g(x,y;\sigma) = \frac{1}{2\pi\sigma^{2}} \exp\left(-\frac{x^{2}+y^{2}}{2\sigma^{2}}\right) \)，归一化使权重之和为1（直流增益为1，保持图像均值）<sup>[1](https://visionbook.mit.edu/blurring_2.html)</sup> |
| 实用核半径 | 约\( 3\sigma \)；在\( 3\sigma \)处幅度约为中心值的1%，例如\( \sigma=1 \)使用7×7，\( \sigma=2 \)使用13×13，\( \sigma=4 \)使用25×25<sup>[1](https://visionbook.mit.edu/blurring_2.html)</sup><sup> • </sup><sup>[4](https://homepages.inf.ed.ac.uk/rbf/HIPR2/gsmooth.htm)</sup> |
| 可分离性 | 使用N×N核的二维卷积直接计算复杂度为\( N^{2} \)，而级联两个一维核则为2N；每像素需要\( 2K \)次乘法和\( 2(K-1) \)次加法，而非\( K^{2} \)和\( K^{2}-1 \)<sup>[1](https://visionbook.mit.edu/blurring_2.html)</sup><sup> • </sup><sup>[5](https://www.mdpi.com/2076-3417/14/11/4664)</sup> |
| 频率响应 | \( G(w;\sigma) = \exp(-w^{2}\sigma^{2}/2) \)，一个宽度随σ增大而减小的高斯函数<sup>[1](https://visionbook.mit.edu/blurring_2.html)</sup> |
| 半群性质 | \( G_{\sigma_1} * G_{\sigma_2} = G_{\sigma} \)，其中\( \sigma = \sqrt{\sigma_1^{2}+\sigma_2^{2}} \)<sup>[2](https://www.ipol.im/pub/art/2013/87/article.pdf)</sup> |
| 复杂度类别 | 朴素FIR滤波以核半径\( r \)计为\( O(r^{2}) \)，可分离为\( O(r) \)，递归为\( O(1) \)；基于DFT的卷积为\( O(N \log N) \)<sup>[6](https://www.apsipa.org/proceedings/2018/pdfs/0000875.pdf)</sup><sup> • </sup><sup>[2](https://www.ipol.im/pub/art/2013/87/article.pdf)</sup> |
| 唯一性 | 高斯是无限域上扩散方程的格林函数，这使其成为唯一的尺度空间核<sup>[7](https://people.kth.se/~tony/papers/linscsp.nonlinbook.pdf)</sup> |

## 工作原理

与高斯函数卷积是一种具有钟形权重的低通滤波：每个输出像素是其邻域的加权平均，权重按\( \exp(-x^{2}/2\sigma^{2}) \)衰减。核被归一化使其积分为1，因此滤波器具有单位直流增益并保持图像平均强度。<sup>[1](https://visionbook.mit.edu/blurring_2.html)</sup>在频域中，高斯函数将频谱乘以\( \exp(-w^{2}\sigma^{2}/2) \)，这是一种没有旁瓣的平滑衰减，这就是高斯滤波不引入振铃的原因。<sup>[1](https://visionbook.mit.edu/blurring_2.html)</sup>

由此产生两个结构性质。第一，半群性质\( G_{\sigma_1} * G_{\sigma_2} = G_{\sigma} \)（其中\( \sigma = \sqrt{\sigma_1^{2}+\sigma_2^{2}} \)）意味着一次卷积可以拆分为两遍处理，可能使用不同算法，并且是高斯金字塔的基础。<sup>[2](https://www.ipol.im/pub/art/2013/87/article.pdf)</sup><sup> • </sup><sup>[1](https://visionbook.mit.edu/blurring_2.html)</sup>第二，用\( G_{\sqrt{2t}} \)进行平滑相当于以图像为初始条件求解热扩散方程\( \partial v/\partial t = \Delta v \)，因此增大σ对应于运行扩散时间t。<sup>[8](https://www.ipol.im/pub/art/2016/117/article_lr.pdf)</sup>

## 实现方法

实践者先选择σ，再选择核半径。一种经验法则将核截断在约三个标准差处，此时幅度约为中心值的1%。各库做法不同：SciPy的gaussian_filter默认使用4.0个标准差，而OpenCV的GaussianBlur要求核尺寸为奇数正整数，或从\( \sigma_{x} \)和\( \sigma_{y} \)推导尺寸。<sup>[1](https://visionbook.mit.edu/blurring_2.html)</sup><sup> • </sup><sup>[5](https://www.mdpi.com/2076-3417/14/11/4664)</sup><sup> • </sup><sup>[9](https://docs.opencv.org/4.0.1/dc/dd3/tutorial_gausian_median_blur_bilateral_filter.html)</sup>必须显式选择边界处理方式：选项包括丢弃边界、零填充、周期环绕和反射；SciPy默认为反射。<sup>[3](https://www.cs.ubc.ca/~lsigal/425_2020W1/Lecture5.pdf)</sup>

实现选择是速度与精度之间的权衡。在固定容差下，直接FIR卷积的代价为\( O(N \cdot \sigma) \)；可分离性将每像素代价降至两个一维遍历。递归IIR实现在每像素上以恒定数量的操作运行，与σ无关。基于DFT的卷积代价为O(N log N)，但隐含周期边界；基于DCT的卷积避免了填充，非常精确但速度慢。通过积分图进行K遍盒式滤波（通常3–5遍）的代价与半径无关，韦尔斯选择公式为\( \sigma^{2} = \frac{K}{12}((2r+1)^{2} - 1) \)。<sup>[2](https://www.ipol.im/pub/art/2013/87/article.pdf)</sup>一项比较综述发现，SII和盒式滤波最快但最不精确，DCT最精确但速度慢，而德里什和范弗利特–杨–维尔贝克递归滤波器在速度/精度权衡上最佳；建议σ低于约2时使用FIR，高于此值时使用递归滤波器。<sup>[2](https://www.ipol.im/pub/art/2013/87/article.pdf)</sup>递归滤波器在大尺度上会损失精度，当\( \sigma > 16 \)时精度下降。<sup>[10](https://www.jstage.jst.go.jp/article/mta/3/1/3_12/_pdf/-char/en)</sup>在串行处理中，对于半径大于\( r = 5 \)的情况，单遍积分图调度比可分离FIR更快。<sup>[6](https://www.apsipa.org/proceedings/2018/pdfs/0000875.pdf)</sup>

## 起源

高斯平滑通过已发表文献中记载的若干脉络进入西方计算机视觉领域。伯特（Burt）和阿德尔森（Adelson）于1983年在《IRE通信系统汇刊》上提出高斯金字塔和拉普拉斯金字塔，将其作为一种基于高斯卷积半群性质的紧凑图像编码。<sup>[11](https://doi.org/10.1109/tcom.1983.1095851)</sup>克罗（Crow）于1984年在《ACM SIGGRAPH计算机图形学》上提出积分图，即盒式滤波近似背后的数据结构。<sup>[12](https://doi.org/10.1145/964965.808600)</sup>科恩德林克（Koenderink）于1984年在《生物控制论》上首次在西方文献中证明高斯平滑对于尺度空间表示的必要性，引入因果性概念，并将理论推广到更高维度。<sup>[13](https://doi.org/10.1007/bf00336961)</sup>杨（Young）和范弗利特（van Vliet）于1995年在《信号处理》上发表了[高斯滤波器](https://www.edgepedia.org/zh/gaussian-filter)的递归实现。<sup>[14](https://doi.org/10.1016/0165-1684%2895%2900020-e)</sup>魏克特（Weickert）、石川（Ishikawa）和伊米亚（Imiya）于1999年在《数学成像与视觉杂志》上发表论断，称线性尺度空间最早在日本提出。<sup>[15](https://doi.org/10.1023/a:1008344623873)</sup>

## 变体

**高斯模糊与尺度空间。** 用宽度递增的高斯函数对图像滤波，将其嵌入一个单参数派生信号族，即高斯尺度空间。<sup>[7](https://people.kth.se/~tony/papers/linscsp.nonlinbook.pdf)</sup>标准差比率为1.6的高斯差分能很好地近似拉普拉斯算子，而由尺度相差\( 2^{1/3} \approx 1.26 \)的高斯函数构建的尺度空间构造生成了用于SIFT关键点检测的尺度空间。<sup>[16](https://peterkovesi.com/papers/FastGaussianSmoothing.pdf)</sup>

**离散核与方向核。** 目前使用三种离散化：采样高斯核、积分高斯核和高斯核的离散模拟，其中最后一种在精细尺度上表现最佳。<sup>[17](https://link.springer.com/article/10.1007/s10851-024-01196-9)</sup>二项式滤波器通过[1,1]的逐次卷积逼近高斯函数；n重核的系数之和为\( 2^{n} \)，方差为\( \sigma^{2} = n/4 \)。<sup>[1](https://visionbook.mit.edu/blurring_2.html)</sup>各向异性高斯可以分解为沿一个轴的一维滤波，随后在非正交方向上进行一维滤波，从而实现快速的朝向尺度空间分析。<sup>[18](https://ivi.fnwi.uva.nl/isis/publications/2002/GeusebroekECCV2002/GeusebroekECCV2002.pdf)</sup>任意阶高斯导数都是可导向的，这意味着任意朝向的滤波器可以由基滤波器的线性组合合成，这一框架由弗里曼（Freeman）和阿德尔森（Adelson）（1991）提出。<sup>[19](https://doi.org/10.1109/34.93808)</sup>

**深度学习。** 高斯导数层和滤波器归一化将尺度空间构造引入网络。<sup>[20](https://arxiv.org/pdf/2603.02843v1.pdf)</sup><sup> • </sup><sup>[21](https://proceedings.neurips.cc/paper_files/paper/2025/file/bcf808e695420aa3c682c0ef0f91d504-Paper-Conference.pdf)</sup>

## 应用

高斯卷积是Gabor滤波、[Canny边缘检测](https://www.edgepedia.org/zh/canny-edge-detection)和SIFT特征检测的基础构件。<sup>[2](https://www.ipol.im/pub/art/2013/87/article.pdf)</sup>高斯尺度空间是SIFT尺度不变性的原因，尽管在统一的滤波器组分析中，SURF的盒式滤波近似在噪声中可能比高斯滤波器表现出更高的正确检测概率，这表明高斯滤波器并不总是特征检测的最佳选择。<sup>[8](https://www.ipol.im/pub/art/2016/117/article_lr.pdf)</sup><sup> • </sup><sup>[22](https://www.eurasip.org/Proceedings/Eusipco/Eusipco2012/Conference/papers/1569574385.pdf)</sup>在视觉领域之外，根据中心极限定理，受随机缺陷、大气湍流和传感器中的散射限制的成像，其点扩散函数在物理上表现为[高斯模糊](https://www.edgepedia.org/zh/gaussian-blur)。<sup>[23](https://dspguide.com/CH24.PDF)</sup>

## 局限与替代方案

**失效模式。** 高斯平滑是完全无差别的：它平滑噪声和所有其他内容，模糊边缘并使其更难识别，并且当从较细尺度移动到较粗尺度时，它倾向于使边缘移位。<sup>[24](https://www.mia.uni-saarland.de/weickert/Papers/book.pdf)</sup><sup> • </sup><sup>[25](https://www.csrc.sdsu.edu/reports/ACSESS200806.pdf)</sup>其机制是像素影响仅取决于空间距离，而非像素值，因此跨越不连续处的像素被一起平均。<sup>[26](https://people.csail.mit.edu/sparis/publi/2009/fntcgv/Paris_09_Bilateral_filtering.pdf)</sup>它处理高斯噪声效果良好，但在椒盐噪声上表现不佳，将噪声涂抹到更大区域，此时中值滤波更好。<sup>[4](https://homepages.inf.ed.ac.uk/rbf/HIPR2/gsmooth.htm)</sup>2023年的一项比较发现，高斯、中值和双边滤波器都会模糊边缘，而非局部均值在高计算代价下提供了最高的边缘保持。<sup>[27](https://pmc.ncbi.nlm.nih.gov/articles/PMC10073213/)</sup>

**边缘保持替代方案。** 双边滤波要求有影响的像素既在附近又具有相似值，随着范围参数\( \sigma_{\mathrm{r}} \)增大，它趋近于普通高斯卷积；其源头可追溯到奥里希（Aurich）和沃伊勒（Weule）1995年的非线性高斯滤波器。<sup>[26](https://people.csail.mit.edu/sparis/publi/2009/fntcgv/Paris_09_Bilateral_filtering.pdf)</sup><sup> • </sup><sup>[28](https://doi.org/10.1007/978-3-642-79980-8_63)</sup>快速双边近似包括线性滤波器组合（杜兰和多尔西，2002）、双边网格（陈、帕里斯和杜兰，2007）以及域变换（加斯塔尔和奥利维拉，2011）。<sup>[29](https://doi.org/10.1145/566654.566574)</sup><sup> • </sup><sup>[30](https://doi.org/10.1145/1276377.1276506)</sup><sup> • </sup><sup>[31](https://doi.org/10.1145/2010324.1964964)</sup>[各向异性扩散](https://www.edgepedia.org/zh/anisotropic-diffusion-image-processing)提供了一种基于偏微分方程的替代方案：佩罗纳–马利克方程\( \partial_t u = \mathrm{div}(g(|\nabla u|^{2})\,\nabla u) \)在可能的边缘处降低扩散率，基于它的边缘检测即使在没有非极大值抑制和滞后阈值处理的情况下也优于线性Canny检测器。<sup>[24](https://www.mia.uni-saarland.de/weickert/Papers/book.pdf)</sup>然而，佩罗纳–马利克模型缺乏经典适定性，因此不能期望唯一性和稳定性，而使用盒式空间权重的双边滤波在小邻域下渐近地表现得像它。<sup>[25](https://www.csrc.sdsu.edu/reports/ACSESS200806.pdf)</sup>

## References

1. [Blur Filters, Foundations of Computer Vision (MIT)](https://visionbook.mit.edu/blurring_2.html)
2. [A Survey of Gaussian Convolution Algorithms (Getreuer, IPOL 2013)](https://www.ipol.im/pub/art/2013/87/article.pdf)
3. [Lecture 5, Image Filtering (UBC CPSC 425)](https://www.cs.ubc.ca/~lsigal/425_2020W1/Lecture5.pdf)
4. [Spatial Filters, Gaussian Smoothing (HIPR2, Edinburgh)](https://homepages.inf.ed.ac.uk/rbf/HIPR2/gsmooth.htm)
5. [Fast Gaussian Filter Approximations Comparison on SIMD Computing Platforms (Applied Sciences, 2024)](https://www.mdpi.com/2076-3417/14/11/4664)
6. [Efficient Computational Scheduling of Box and Gaussian FIR Filtering for CPU Microarchitecture (APSIPA 2018)](https://www.apsipa.org/proceedings/2018/pdfs/0000875.pdf)
7. [Linear scale-space: Basic theory (Lindeberg and ter Haar Romeny)](https://people.kth.se/~tony/papers/linscsp.nonlinbook.pdf)
8. [Computing an Exact Gaussian Scale-Space (IPOL 2016)](https://www.ipol.im/pub/art/2016/117/article_lr.pdf)
9. [Smoothing Images, OpenCV Tutorials](https://docs.opencv.org/4.0.1/dc/dd3/tutorial_gausian_median_blur_bilateral_filter.html)
10. [O(1) Gaussian filtering via sliding DCT/DST-5 with dual-domain error minimization (IEICE MTA)](https://www.jstage.jst.go.jp/article/mta/3/1/3_12/_pdf/-char/en)
11. [P. Burt, E. Adelson (1983). The Laplacian Pyramid as a Compact Image Code. IRE Transactions on Communications Systems.](https://doi.org/10.1109/tcom.1983.1095851)
12. [Franklin C. Crow (1984). Summed-area tables for texture mapping. ACM SIGGRAPH Computer Graphics.](https://doi.org/10.1145/964965.808600)
13. [Jan J. Koenderink (1984). The structure of images. Biological Cybernetics.](https://doi.org/10.1007/bf00336961)
14. [Recursive implementation of the Gaussian filter (Signal Processing, 1995)](https://doi.org/10.1016/0165-1684%2895%2900020-e)
15. [Joachim Weickert, Seiji Ishikawa, Atsushi Imiya (1999). Linear Scale-Space has First been Proposed in Japan. Journal of Mathematical Imaging and Vision.](https://doi.org/10.1023/a:1008344623873)
16. [Fast Almost-Gaussian Filtering (Kovesi)](https://peterkovesi.com/papers/FastGaussianSmoothing.pdf)
17. [Discrete Approximations of Gaussian Smoothing and Gaussian Derivatives (JMIV, 2024)](https://link.springer.com/article/10.1007/s10851-024-01196-9)
18. [Fast anisotropic Gauss filtering (Geusebroek et al.)](https://ivi.fnwi.uva.nl/isis/publications/2002/GeusebroekECCV2002/GeusebroekECCV2002.pdf)
19. [W.T. Freeman, E.H. Adelson (1991). The design and use of steerable filters. IEEE Transactions on Pattern Analysis and Machine Intelligence.](https://doi.org/10.1109/34.93808)
20. [Scale-invariant Gaussian derivative residual networks](https://arxiv.org/pdf/2603.02843v1.pdf)
21. [Normalize Filters! Classical Wisdom for Deep Vision (NeurIPS 2025)](https://proceedings.neurips.cc/paper_files/paper/2025/file/bcf808e695420aa3c682c0ef0f91d504-Paper-Conference.pdf)
22. [Do We Really Need Gaussian Filters for Feature Point Detection? (EUSIPCO 2012)](https://www.eurasip.org/Proceedings/Eusipco/Eusipco2012/Conference/papers/1569574385.pdf)
23. [The Scientist and Engineer's Guide to DSP, Chapter 24: Linear Image Processing](https://dspguide.com/CH24.PDF)
24. [Anisotropic Diffusion in Image Processing (Weickert)](https://www.mia.uni-saarland.de/weickert/Papers/book.pdf)
25. [Image Smoothing and Edge Detection by Nonlinear Diffusion and Bilateral Filter (SDSU report)](https://www.csrc.sdsu.edu/reports/ACSESS200806.pdf)
26. [Bilateral Filtering: Theory and Applications (Paris, Kornprobst, Tumblin, Durand)](https://people.csail.mit.edu/sparis/publi/2009/fntcgv/Paris_09_Bilateral_filtering.pdf)
27. [Edge-preserving smoothing filter using fast M-estimation method (2023)](https://pmc.ncbi.nlm.nih.gov/articles/PMC10073213/)
28. [Volker Aurich, Jörg Weule (1995). Non-Linear Gaussian Filters Performing Edge Preserving Diffusion. Informatik aktuell.](https://doi.org/10.1007/978-3-642-79980-8_63)
29. [Frédo Durand, Julie Dorsey (2002). Fast bilateral filtering for the display of high-dynamic-range images. ACM Transactions on Graphics.](https://doi.org/10.1145/566654.566574)
30. [Jiawen Chen, Sylvain Paris, Frédo Durand (2007). Real-time edge-aware image processing with the bilateral grid. ACM Transactions on Graphics.](https://doi.org/10.1145/1276377.1276506)
31. [Eduardo S. L. Gastal, Manuel M. Oliveira (2011). Domain transform for edge-aware image and video processing. ACM Transactions on Graphics.](https://doi.org/10.1145/2010324.1964964)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Sep 30, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Algorithms and computational methods › Numerical, string, and geometric algorithms › Fourier and signal transforms

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/gaussian-filtering

English original: https://www.edgepedia.org/gaussian-filtering
