如何理解Gabor滤波器
介绍
我们已经知道,傅里叶变换是一种信号处理中的有力工具,可以帮助我们将图像从空域转换到频域,并提取到空域上不易提取的特征。但是经过傅里叶变换后,图像在不同位置的频度特征往往混合在一起,但是Gabor滤波器却可以抽取空间局部频度特征,是一种有效的纹理检测工具。Figure 1: A sinusoid and it's Fourier spectrum
如何生成一个Gabor滤波器
在二维空间中,使用一个三角函数(如正弦函数)与一个高斯函数叠加我们就得到了一个Gabor滤波器[1],如下图。
Figure 2: Gabor filter composition: (a) 2D sinusoid oriented at 30◦ with the x-axis, (b) a Gaussian kernel, (c) the corresponding Gabor filter. Notice how the sinusoid becomes spatially localized.
Gabor核函数
二维Gabor核函数由一个高斯函数和一个余弦函数相乘得出,其中θ,ϕ,γ,λ,σθ,ϕ,γ,λ,σ为参数。
在OpenCV中的getGaborKernel函数里需要传入的参数除了上述5个外,还需要传入卷积核的大小。
cv::Mat getGaborKernel(Size ksize, double sigma, double theta, double lambd, double gamma, double psi=CV_PI*0.5, int ktype=CV_64F ); |
Figure 3: The Gabor Filter in frequency with the orientation of 0°, 45°, 90°.