请教一下我这个程序哪里有错误~
function(f1,f2)=match(01.jpg,02.jpg);f1=001.jpg;
f2=002.jpg;
f1=double(rgb2gray(imread('01.jpg')));
f2=double(rgb2gray(imread('02.jpg')));
histeq(f1);
histeq(f2);
=size(Mx);
=size(My);
Mx=;
My=[-1 0 1,-2 0 2,-1 0 1];
Sx(1,:)=Y(1,:);
Sx(:,1)=Y(:,1);
for i=2:m-1
for j=2:n-1
Sx(i,j)=Y(i-1,j-1)+2Y(i-1,j)+Y(i-1,j+1)-Y(i+1,j-1)-2Y(i+1,j)-Y(i+1,j+1)
Sy(i,j)=-X(i-1,j-1)+X(i-1,j+1)-2X(i,j-1)+2X(i,j+1)-X(i+1,j-1)+X(i+1,j+1)
end
end
for i=1:m
if d=2
S(i,j)=YSx(i,j)^2+XSy(i,j)^2/2d
end
end
for i=1:m
j=1:n
if abs(S(i,j))<1
W(i,j)=1-2abs(S(i,j))^2+abs(S(i,j))^3
else if 1<=abs(S(i,j))&abs(S(i,j))<=2
W(i,j)=4-8abs(S(i,j))+5abs(S(i,j))^2-abs(S(i,j))^3
else if abs(S(i,j))>2
W(i,j)=0
end
end
end
end 记得eight好像已经回答过类似问题了。
修改了一下,你自己运行一下,看看是否正确。
希望以后多搜索论坛。
%%%%%%%%%%%%%%%%%%%
function =match()%你的输出变量可能有问题
% f1=imread(001.jpg);
% f2=imread(002.jpg);
f1=double(rgb2gray(imread('01.jpg')));
f2=double(rgb2gray(imread('02.jpg')));
histeq(f1);
histeq(f2);
=size(Mx);
=size(My);
Mx=;
My=[-1 0 1,-2 0 2,-1 0 1];
Sx(1,:)=Y(1,:);
Sx(:,1)=Y(:,1);
for i=2:m-1
for j=2:n-1
Sx(i,j)=Y(i-1,j-1)+2Y(i-1,j)+Y(i-1,j+1)-Y(i+1,j-1)-2Y(i+1,j)-Y(i+1,j+1)
Sy(i,j)=-X(i-1,j-1)+X(i-1,j+1)-2X(i,j-1)+2X(i,j+1)-X(i+1,j-1)+X(i+1,j+1)
end
end
for i=1:m
if d=2
S(i,j)=YSx(i,j)^2+XSy(i,j)^2/2d
end
end
for i=1:m
j=1:n
if abs(S(i,j))<1
W(i,j)=1-2abs(S(i,j))^2+abs(S(i,j))^3
else if 1<=abs(S(i,j))&abs(S(i,j))<=2
W(i,j)=4-8abs(S(i,j))+5abs(S(i,j))^2-abs(S(i,j))^3
else if abs(S(i,j))>2
W(i,j)=0
end
end
end
end
[ 本帖最后由 xjzuo 于 2007-5-14 17:26 编辑 ]
谢谢!
谢谢版主
页:
[1]