Image reconstruction of MATLAB image processing

P = phantom(256);%Generate skull phantom image
imshow§%Display skull phantom image theta1
= 0:10:170;% Projection angle, step length is 10
[R1,xp] = radon(P,theta1);% radon transformation
num_angles_R1 = size(R1,2);% the number of
angles theta2 = 0:5:175;% projection angle, step length is 5
[R2,xp] = radon(P,theta2);%radon transformation
num_angles_R2 = size(R2,2);% number of
angles theta3 = 0:2:178;% projection angle, step size is 2
[R3,xp] = radon(P,theta3);%radon transformation
num_angles_R3 = size(R3, 2); The number of% angles
N_R1 = size(R1,1); the length of the diagonal when the% angle step is 10
N_R2 = size(R2,1); the length of the diagonal when the% angle step is 5
N_R3 = size(R3,1);% the length of the diagonal when the angle step is 2
figure,
imagesc(theta3,xp,R3);% shows the Radon transform when the angle step is 2
colormap(hot); colorbar
xlabel ('Rotation angle'); ylabel('perceptron position');
output_size = max(size§);% determines the size of the transformed image
dtheta1 = theta1(2)-theta1(1);% step size
I1 = iradon(R1,dtheta1,output_size);%radon inverse transformation
figure,
subplot(1,3,1), imshow(I1)% shows the inverse transformation Image
dtheta2 = theta2(2)-theta2(1);% step size
I2 = iradon(R2,dtheta2,output_size);%radon inverse transformation
subplot(1,3,2), imshow(I2)% shows the inverse transformed image
dtheta3 = theta3(2)-theta3(1);% step size
I3 = iradon(R3,dtheta3,output_size);%radon inverse transformation
subplot(1,3,3), imshow(I3)% shows the inverse transformed image
D = 250; dsensor1 = 2;
F1 = fanbeam(P,D,'FanSensorSpacing',dsensor1); %fanbeam transformation
dsensor2 = 1;
F2 = fanbeam(P,D,'FanSensorSpacing',dsensor2); %fanbeam transformation
dsensor3 = 0.25 ;
[F3, sensor_pos3, fan_rot_angles3] = fanbeam(P,D,…
'FanSensorSpacing',dsensor3);%fanbeam transformation
figure,
imagesc(fan_rot_angles3, sensor_pos3, F3)% display fanbeam transformed image
colormap(hot); colorbar
xlabel('rotation angle'); ylabel('perceptron position')
Ifan1 = ifanbeam(F1,D,'FanSensorSpacing', …
Dsensor1,'OutputSize',output_size);%fambeam inverse transformation
figure,
subplot(1,3,1), imshow(Ifan1)% Display the reconstructed image
Ifan2 = ifanbeam(F2,D,'FanSensorSpacing',...
dsensor2,' OutputSize',output_size);%fanbeam inverse transformation
subplot(1,3,2), imshow(Ifan2)% displays the reconstructed image
Ifan3 = ifanbeam(F3,D,'FanSensorSpacing',...
dsensor3,'OutputSize',output_size); %fanbeam inverse transformation
subplot(1,3,3), imshow(Ifan3)% displays the reconstructed image
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/m0_38127487/article/details/115259449