Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

Function mean on images input reduces the size of the output: input images = 2000 Ko, output image=35 Ko

1 view (last 30 days)
Here is my script in which I need to average a given number of images. The issue being that the function mean reduces the quality (size memory) of the final averaged image.
Script:
if true
a='tile_';%name of your image without the number
b='.tif';%image format
n=64;%number of image
z='0';
for i=1:n;
d=num2str(i);
if i<10 m=strcat(z,d);
else m=d;
end
s = strcat(a,m,b);
F(:,:,i)=imread(s);
end
span=2;%number of images per subcluster
clus=floor(n/span);% number of subcluster
for j=1:clus;
Av(:,:,j)=mean(F(:,:,(j*span-(span-1)):(j*span)),3);
end
for j=1:clus;
imwrite(Av(:,:,j),num2str(j),'tif');
end% code
end
The image saved is about 46kB when the input images were about 2000KB (the averaged on should be around 2000KB as well).
Help please !

Answers (0)

This question is closed.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!