数字图像处理与应用 Class 4. 20200506
Lecture 4 Image Enhancement: Filtering in the Frequency Domain
The Fourier series & the Fourier transform
DFT Properties
Steps of Filtering in the Frequency Domain
Some Basic Frequency Domain Filters
Image smoothing
Image sharpening
Introduction to Fourier Transform <!--傅里叶变换简介-->
The Big Idea
任何周期性重复自身的函数都可以表示为不同频率的正弦和余弦的和乘以不同的系数——傅里叶级数 即使是非周期函数,也可以表示为sin和/或cos的积分乘以一个权重函数。这里的公式是傅里叶变换。
通过傅里叶变换对函数进行变换,可以通过逆过程进行完全重构(恢复),且不损失信息。
Introduction to Fourier Transform
(u) is the frequency variable.由上式积分可知,F(u)是由无穷个sin项和cos项之和组成,u的每个值决定了对应的sin -cos项的频率。
The Discrete Fourier Transform (DFT)
<!--离散傅里叶变换-->
Note: the coefficient 1/N also can be put in the first equation, or in both equations, or just keep the product of the two coefficients is equal to 1/N.
How to calculate the DFT
Step1: Let u=0, summing for all value of x
Step2: Substitute u=u+1, and repeat the summation over all value of x.
Step 3: If u=N-1, terminate, otherwise, return to step 2.
$ N^2 $ summations and multiplications
More
We call |F(u)| is called the magnitude or spectrum of Fourier transform (幅度或频率谱), and φ(u) is called the phase angle or phase spectrum of the transform(相角或相位谱). The square of the Fourier spectrum is called the power spectrum or spectral density (功率谱或谱密度):
一个比较
玻璃棱镜
将光分解成各种颜色的成分
每个都取决于其波长(或频率)的内容。
傅里叶变换
将一个函数分成多个成分
每个都取决于它的频率内容。
二维DFT
For two dimensional DFT, the Fourier spectrum, phase angle, and power spectrum are defined as :
Where R(u, v) and I(u, v) are the real and imaginary parts of P(u, v), respectively.
DFT Properties
Translation property: 平移性质
中心化:平移特性
Rotation property: 旋转性质
Average value: 均值特性
如果f(x,y)是一幅图像,那么在原点处的傅里叶变换的值等于图像的平均灰度值。F(0,0)称为频谱的直流分量。
卷积定理
冲击函数的筛选特性
Properties of impulse function
?
&1 The Fourier transform of an impulse at the origin of the spatial domain is a real constant.
&2 If the impulse were located elsewhere, the transform would have complex components.
&3 The magnitude would be the same, with the translation of the impulse being reflected in a nonzero phase angle in the transform.
Steps of Filtering in the Frequency Domain
Multiply the input image by (-1)^(x+y) to center the transform.
Compute F(u,v) the DFT of the image in (1).
Multiply F(u,v) by a filter function H(u,v).
Compute the inverse DFT of the result.
Obtain the real part of the result in (4).
Multiply the result in (5) with (-1)^(x+y) .
其他 <!--略-->
其他措施包括:
1,将输入图像裁剪到最接近的偶数维。2,灰度扩展。3,转换为浮点输入。4,在输出上转换为8位整数格式。5,多重过滤阶段和其他预处理和后处理功能是可能的。6,上述基本主题有许多变体。
Some Basic Frequency Domain Filters
<!--一些基本的频域滤波器-->
In Fourier transform, low frequencies are responsible for the general gray level appearance of an image over smooth areas.
在傅里叶变换中,低频负责图像在平滑区域上的一般灰度级外观。
High frequencies are responsible for detail, such as edges and noises.
高频负责细节,如边缘和噪音。
Notch filter. 陷波滤波器
Lowpass filter: smoothing filters 低通滤波器:平滑滤波器
Highpass filter: sharpening filters 高通滤波器:锐化滤波器
Filters Based on Gaussian Functions
<!--基于高斯函数的滤波器-->
Fourier transform pair
它的两个分量都是高斯的和实的。
频域滤波器越窄,则它对低频的衰减越大 导致增加模糊。
在空间域意味着一个更大的模板???
Smoothing Frequency Domain Filters
<!--平滑频域滤波器-->
通过去掉高频分量,在频域实现平滑
低通滤波器——只通过低频率,去掉高频率
三种主要的平滑频域滤波器
&1. Ideal lowpass filter
&2. Butterworth filter
&3. Gaussian filter
These three filters cover the range from very sharp (ideal) to very smooth (Gaussian) filter functions.
Ideal Low Pass Filter 理想低通滤波器
简单地切断从变换的原点到指定距离D0的所有高频分量
改变距离会D0改变滤波器的行为。D0也称为截止频率。
Ringing and Blurring: 振铃和模糊现象
Butterworth Lowpass Filters 巴特沃思低通滤波器
定义截止频率为n阶的巴特沃斯低通滤波器在距离原点D0处的传递函数为:
Ringing and Blurring: 振铃和模糊现象
Gaussian Lowpass Filters
The transfer function of a Gaussian lowpass filter is defined as:
高斯低通滤波器的傅里叶反变换也是高斯的。它将没有ringing铃声。
Lowpass Filters Compared <!--略-->
Lowpass Filtering Examples <!--略-->
Sharpening in the Frequency Domain
图像的边缘和细节与高频成分有关。
高通滤波器——只通过高频,去掉低频。
高通频率正好与低通滤波器相反,所以:
Ideal High Pass Filters <!--类比Low Pass-->
Butterworth High Pass Filters <!--略-->
Gaussian High Pass Filters
高斯高通滤波器如下:
其中D0是和之前一样的截止距离