Image Reconstruction
Image Reconstruction
Output of Fig0533
Output of Fig0533
Question Two
Parallel-Beam Filtered Back projections involves use of different angles to reconstruct an image.
Projections are created through line integrals (summations) between two points anywhere
inside and/or outside the image. For a given angle, a projection consists of a vector of parallel
line integrals formed by a source on one side of the image and a line of detectors on the other.
The size of the projection vector is equal to the number of detectors in the array.
Code for image reconstruction.
First, we calculate synthetic projections using parallel-beam geometry and vary the number of
projection angles. For each of these calls to radon, the output is a matrix in which each column
is the Radon transform for one of the angles in the corresponding theta.
Match the parallel rotation-increment, dtheta, in each reconstruction with that used to create
the corresponding synthetic projections.
The three reconstructions (I1, I2, and I3) show the effect of varying the number of angles at
which projections are made. For I1 and I2 some features that were visible in the original
phantom are not clear. Specifically, look at the three ellipses at the bottom of each image. The
result in I3 closely resembles the original image, P.
P=imread("Fig0539(c)(shepp-logan_phantom).tif")
output_size = max(size(P));
figure
montage({I1,I2,I3},'Size',[1 3])
title(['Reconstruction from Parallel Beam Projection ' ...
'with 18, 24, and 90 Projection Angles'])
The use of parallel beam filtered back propagation reconstructs the original image as shown. We can
observe from the output images that the original image has been reconstructed and even its
background color and shape has changed. Some features of the phantom image have been eliminated
by the background, which is an effect of the reconstruction process. The output image does not appear
to be clear as the original image.
Question Three
MATLAB program to implement the image reconstruction using Fan-Bean Filtered Back
projections.
Code
Match the fan-sensor-spacing in each reconstruction with that used to create
each of the synthetic projections.
Changing the value of the 'FanSensorSpacing' effectively changes the
number of sensors used at each rotation angle. For each of these fan-beam
reconstructions, the same rotation angles are used. This is in contrast to the
parallel-beam reconstructions which each used different rotation angles.
Note that 'FanSensorSpacing' is only one parameter of several that you can
control when using fanbeam and ifanbeam. You can also convert back and
forth between parallel- and fan-beam projection data using the
functions fan2para and para2fan
P=phantom(256);
D = 250;
dsensor1 = 2;
F1 = fanbeam(P,D,'FanSensorSpacing',dsensor1);
dsensor2 = 1;
F2 = fanbeam(P,D,'FanSensorSpacing',dsensor2);
dsensor3 = 0.25;
[F3,sensor_pos3,fan_rot_angles3] = fanbeam(P,D, ...
'FanSensorSpacing',dsensor3);
montage({Ifan1,Ifan2,Ifan3},'Size',[1 3])
title(['Reconstruction from Fan Beam Projection with '...
'18, 24, and 90 Projection Angles'])
Output Image
From the analysis above we can observe that the images become clearer the projection angle increases
form 18 degrees to 90 degrees. Fan beam reveals that at higher projection angles the reconstructed
angles will be clearer with clearer sharper edges and high intensity than at lower angles. At lower angles,
the output image appears blurring and affected edges.
Result Analysis
Peak Signal to Noise Ratio (PSNR)
It computes the peak signal-to-noise ration in decibels between two images. The ratio is used to
measure the quality between the original and compressed images. When the ratio is high,
quality of the reconstructed images is better. PSNR measures the peak error.
Code for testing the PNR, SNR and MSE on the provided image.
From the code, we read the image from the local computer using ‘imread’ function, the we use
3x3 Matrix Filter to process the image and create a new filtered image using imfilter function.
Lastly, we apply the PNSR, MSE and SNR by calling the functions from Matlab image processing
tool. Output is a matrix that represent the values of the quality of images.
PNR, SNR and MSE for Question 1
%we read the code using imread function. We use Fig0533(a)(circle) as the
%test image.
P=imread("Fig0533(a)(circle).tif")
imshow(P),title("Fig0533 Image");
Output
The code above shows the values MSE (Mean Square Error), SNR (Signal to Noise Ratio), and PSNR (Peak
Signal to Noise Ratio). The three are used to test for reconstructed image qualities.
The output values of MSE, SNR and PSNR are small hence it denotes that the output image has desirable
qualities. The input image is not affected to a greater extent during reconstruction.
%PNSR
[peaksnr snr] = psnr(P,new_P);
%MSE
mse=immse(P,new_P);
%SNR
%ssimval = ssim(P,new_P);
%Print
[peaksnr mse snr]
Output
The code above shows the values MSE (Mean Square Error), SNR (Signal to Noise Ratio), and PSNR (Peak
Signal to Noise Ratio)
%PNSR
[peaksnr snr] = psnr(P,new_P3);
%MSE
mse=immse(P,new_P);
Output
The code above shows the values MSE (Mean Square Error), SNR (Signal to Noise Ratio), and PSNR (Peak
Signal to Noise Ratio) for the fan-beam filtered back projection. The values are small indicating the
output image is not affected to a great extent in-terms of qualities during reconstruction. The MSE
appears to show good results indicating that the quality of the reconstructed image after compression
has high quality.
Conclusion
PSNR, MSE, and SNR are used to measure the quality between two images. From the results shown
above during analysis, the value of PSNR (28.1416) is higher which shows that the constructed image has
a reduced peak error. Mean Squared Error is (99.7518 %). The value is close to 100%, the value is higher
which shows that the compression affected the quality of output image. SNR value is (15.7660) which is
used to calculate the sharpness of the image. The restored images appear to be sharp as compared to
the original image. The three quality measurement parameters are important as they help to determine
the quality of the output image. From their results, necessary adjustments can be made to the
computation to get the desired output image quality.