Yesubai Rubavathi
Newbie level 4
matlab image averaging
I want to read images fromdatabase & resiz to same size for all & then take average of it. i have two images int the database.
code is:
clc;
y='z:\project\database';
dirlist=dir;
s=size(dirlist);
for m=1:256
for n=1:256
avg(m,n)=0;
end
end
for m = 3 : s
x= imread(strcat(y,'\',dirlist(m).name));
a= imresize(x,[256 256]);
for i = 1:256
for j = i:256
avg(i,j)=avg(i,j)+a(i,j);
end
end
end
av=avg./m;
figure,imshow(av);
but it won't run.
output is not correct.
plz help me to run this program.
I am expecting your reply soon.
Thankyou.
I want to read images fromdatabase & resiz to same size for all & then take average of it. i have two images int the database.
code is:
clc;
y='z:\project\database';
dirlist=dir;
s=size(dirlist);
for m=1:256
for n=1:256
avg(m,n)=0;
end
end
for m = 3 : s
x= imread(strcat(y,'\',dirlist(m).name));
a= imresize(x,[256 256]);
for i = 1:256
for j = i:256
avg(i,j)=avg(i,j)+a(i,j);
end
end
end
av=avg./m;
figure,imshow(av);
but it won't run.
output is not correct.
plz help me to run this program.
I am expecting your reply soon.
Thankyou.