Phụ lục
305
end
posbx=posbx+1;
end
% display the logical matrix
figure('Name','Logical matrix');
imshow(mat_log);
if isa(a,'uint8')
out=uint8(matrice);
figure('Name','Compressed image');
imshow(out);
imwrite(out, outfile);
return
end
if isa(a,'uint16')
out=uint16(matrice);
figure('Name','Compressed image');
imshow(out);
imwrite(out, outfile);
return
end
if isa(a,'double')
out=(matrice);
figure('Name','Compressed image');
imshow(out);
imwrite(out, outfile);
return
end
end
%------------------------------------------------------
if isrgb(a)
double_a=double(a);
ax=size(a,1)-mod(size(a,1),bx);
ay=size(a,2)-mod(size(a,2),by);
out_rgb=zeros(ax,ay,3);
%-----------------------------------------------------------
%-----------------------------------------------------------
% ----------------------- RED component ------------------
dvalue=double_a(:,:,1);
dx=size(dvalue,1);
dy=size(dvalue,2);