TP-traitement-audio-visuel/TP9/retroprojection.asv

30 lines
584 B
Plaintext
Raw Normal View History

2023-06-22 18:47:16 +00:00
function f = retroprojection(sinogramme, theta, n_rayons, n_lignes, n_colonnes)
n_theta = length(theta);
f = zeros(n_lignes, n_colonnes);
for k=1:n_theta
angle = theta(k);
for i=1:n_lignes
for j=1:n_colonnes
x = j - n_colonnes/2;
y = -i + n_lignes/2;
t = x * cos(angle) + y * sin(angle);
t = t + n_rayons/2;
t = ceil(t);
f(i, j) = f(i, j) + sinogramme(t, k);
end
end
end
f = f / n_rayons;
end