Phụ lục
310
matrice(ii:ii+bx-1,jj:jj+by-...
1)=(double(blocco_binario).*mu)+(double(~blocco_binario).*ml);
posby=posby+1;
end
posbx=posbx+1;
end
out_rgb(:,:,3)=matrice;
%------------------------------------------ -----------------
if isa(a,'uint8')
out=uint8(out_rgb);
figure('Name','Compressed image');
imshow(out);
imwrite(out, outfile);
return
end
if isa(a,'uint16')
out=uint16(out_rgb);
figure('Name','Compressed image');
imshow(out);
imwrite(out, outfile);
return
end
if isa(a,'double')
out=(out_rgb);
figure('Name','Compressed image');
imshow(out);
imwrite(out, outfile);
return
end
end
%------------------------------------------------------
2. dctcompr (Mục 13.2 chương 13)
function [im] = dctcompr (infile,coeff,outfile)
% DCTCOMPR (infile,coeff,outfile)
% Image compression based on Discrete Cosine Transform.
% Written by Luigi Rosa – L’Aquila - Italia
% infile is input file name present in the current directory
% coeff is the number of coefficients with the most energy
% outfile is output file name which will be created
%*****************************************************************