如何计算Gabor滤波器中的空间频率? [英] How to calculate the Spatial frequency in Gabor filter?

查看:187
本文介绍了如何计算Gabor滤波器中的空间频率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题描述了gabor过滤器系列及其应用很好。但是,没有描述滤波器的波长(空间频率)。 gabor小波的创建在以下for循环中完成:

This question describe the gabor filter family and its application pretty well. Though, there is nothing described about the wavelength (spatial frequency) of the filter. The creation of gabor wavelets are done in the following for loop:

for v = 0 : 4
    for u = 1 : 8
        GW = GaborWavelet ( R, C, Kmax, f, u, v, Delt2 ); % Create the Gabor wavelets
          figure( 2 );
         subplot( 5, 8, v * 8 + u ),imshow ( real( GW ) ,[]); % Show the real part of Gabor wavelets

         GW_ALL( v*8+u, :) = GW(:);

    end

    figure ( 3 );
     subplot( 1, 5, v + 1 ),imshow ( abs( GW ),[]); % Show the magnitude of Gabor wavelets

end

我知道第二个循环变量是具有pi / 8间隔的方向。虽然,我不知道第一个循环变量如何与此代码中的空间频率(波长)相关联,其函数 [pixels / cycle] 。有人可以帮忙吗?

I know that the second loop variable is the orientation with pi/8 intervals. Though, I don't know how the first loop variable is linked with the spatial frequency (wavelength) in this code and its function [pixels/cycle]. Can anyone help?

推荐答案

我终于找到了答案。 GaborWavelet函数定义如下:

I found the answer finally. The GaborWavelet function is defined as follows:

function GW = GaborWavelet (R, C, Kmax, f, u, v, Delt2)
k = ( Kmax / ( f ^ v ) ) * exp( 1i * u * pi / 8 );% Wave Vector
kn2 = ( abs( k ) ) ^ 2;
GW = zeros ( R , C );
for m = -R/2 + 1 : R/2
    for n = -C/2 + 1 : C/2
        GW(m+R/2,n+C/2) = ( kn2 / Delt2 ) * exp( -0.5 * kn2 * ( m ^ 2 + n ^ 2 ) / Delt2) * ( exp( 1i * ( real( k ) * m + imag ( k ) * n ) ) - exp ( -0.5 * Delt2 ) );
    end
end

Kmax 是最大频率, f 是间隔系数, v 是分辨率。间距系数 f 通常被视为 sqrt(2)
基于这个纸, k = 2 * pi * f * exp(i *θ),代码 Kmax = fmax * 2 * pi 没有描述,是找到滤波器波长的关键。我还阅读了这个实现,并注意到波长很容易可以使用 f = 1 / lambda 找到lambda是正弦波的波长。

The Kmax is the maximum frequency, f is the spacing factor and v is the resolution. The spacing factor f is usually considered as sqrt(2). Based on this paper, k= 2*pi*f*exp(i*ϑ) and in the code Kmax=fmax*2*pi which is not described and is the key to find the wavelength of the filter. I also read this implementation and noticed that wavelength can easily be found using f = 1/lambda where lambda is wavelength of sinusoid.

例如,如果 Kmax = pi / 2 v = 0 ,所以 k = Kmax * exp(1i * u * pi / 8)并考虑到上面提到的公式, lambda = 2 * pi / Kmax = 4 [像素/周期]

So for example, if Kmax=pi/2 and v=0, so the k=Kmax*exp(1i*u*pi/8) and considering the above mentioned formula, lambda = 2*pi/Kmax = 4 [pixel/cycle].

这篇关于如何计算Gabor滤波器中的空间频率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆