yangfanxing__ 发表于 2010-3-19 11:35

帮忙啊。看看这个东西有必要这么写么?

————————————————————————————————————————
function = gaborfilter(I,Sx,Sy,f,theta);
if isa(I,'double')~=1
    I = double(I);
end
for x = -fix(Sx):fix(Sx)
    for y = -fix(Sy):fix(Sy)
      xPrime = x * cos(theta) + y * sin(theta);
      yPrime = y * cos(theta) - x * sin(theta);
      h(fix(Sx)+x+1,fix(Sy)+y+1) = exp(-.5*((xPrime/Sx)^2+(yPrime/Sy)^2))*cos(2*pi*f*xPrime);
    end
end
Imgabout = conv2(I,double(imag(h)),'same');
Regabout = conv2(I,double(real(h)),'same');
gabout = sqrt(Imgabout.*Imgabout + Regabout.*Regabout);
————————————————————————————————————

大家帮忙喽一眼,根据公式写的这个东东有问题么???——

Imgabout = conv2(I,double(imag(h)),'same');
这一句是有必要的吗???好像h中不会有虚部出现???
页: [1]
查看完整版本: 帮忙啊。看看这个东西有必要这么写么?