主题:急待解决
function [G,gabout] = gaborfilter1(I,Sx,Sy,U,V)
if isa(I,'double')~=1
I = double(I);
end
for x = -fix(Sx):fix(Sx)
for y = -fix(Sy):fix(Sy)
G(fix(Sx)+x+1,fix(Sy)+y+1) = (1/(2*pi*Sx*Sy))*exp(-0.5*((x/Sx)^2+(y/Sy)^2)+2*pi*i*(U*x+V*y));
end
end
Imgabout = conv2(I,double(imag(G)),'same');
Regabout = conv2(I,double(real(G)),'same');
gabout = uint8(sqrt(Imgabout.*Imgabout + Regabout.*Regabout));
运行时出现第七行出现Matrix dimensions must agree.错误,请问应怎末改正
if isa(I,'double')~=1
I = double(I);
end
for x = -fix(Sx):fix(Sx)
for y = -fix(Sy):fix(Sy)
G(fix(Sx)+x+1,fix(Sy)+y+1) = (1/(2*pi*Sx*Sy))*exp(-0.5*((x/Sx)^2+(y/Sy)^2)+2*pi*i*(U*x+V*y));
end
end
Imgabout = conv2(I,double(imag(G)),'same');
Regabout = conv2(I,double(real(G)),'same');
gabout = uint8(sqrt(Imgabout.*Imgabout + Regabout.*Regabout));
运行时出现第七行出现Matrix dimensions must agree.错误,请问应怎末改正