49 lines
997 B
Matlab
49 lines
997 B
Matlab
clear;
|
|
close all;
|
|
taille_ecran = get(0,'ScreenSize');
|
|
L = taille_ecran(3);
|
|
H = taille_ecran(4);
|
|
|
|
load donnees;
|
|
|
|
figure('Name','Tomographie : resolution algebrique','Position',[0.2*L,0,0.8*L,0.5*H]);
|
|
|
|
% Affichage de l'image originale :
|
|
subplot(1,3,1);
|
|
imagesc(I);
|
|
colormap gray;
|
|
axis off;
|
|
axis equal;
|
|
title('Image d''origine','FontSize',20);
|
|
|
|
% Affichage du sinogramme :
|
|
subplot(1,3,2);
|
|
imagesc(sinogramme);
|
|
colormap gray;
|
|
axis off;
|
|
axis equal;
|
|
title('Sinogramme','FontSize',20);
|
|
drawnow;
|
|
|
|
% Algorithme de Kaczmarz :
|
|
n_boucles = 10;
|
|
f = zeros(size(W, 2), 1);
|
|
|
|
delete("saves/exo1.gif");
|
|
figure;
|
|
for k = 1:n_boucles
|
|
f = kaczmarz(f, p, W);
|
|
|
|
% Affichage de la solution :
|
|
% subplot(1,3,3);
|
|
img = reshape(f,nb_lignes,nb_colonnes);
|
|
imagesc(img);
|
|
colormap gray;
|
|
axis off;
|
|
axis equal;
|
|
title("Resultat de la tomographie " + num2str(k) + "/" + num2str(n_boucles));
|
|
drawnow;
|
|
|
|
export_fig(gcf, "saves/exo1rick_" + num2str(k) + ".png", '-png', '-painters', '-m2');
|
|
end
|