SD 575 Image Processing Lab 4 – Restoration

$30.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (5 votes)

1 Overview
The goal of this lab is to provide some hands-on experience with image restoration concepts in frequency
domain.
For the first part of this lab, we will study how to enhance images in frequency domain. The following
images will be used for testing purposes:
• cameraman.tif
• degraded.tif
These images can be found on the course website.
2 Image Restoration in the Frequency Domain
Let us now study two frequency domain based image restoration methods: inverse filtering and Wiener
filtering. Load the Camerman image (adjust intensities to range of 0 to 1). First, create a disk blur function
of radius of 4 and apply it to the image in the frequency domain:
h = fspecial(’disk’,4);
f = im2double(imread(’cameraman.tif’));
h freq = fft2(h, size(f,1), size(f,2)); % pad h
f blur = real(ifft2(h freq.*fft2(f)));
1
Plot the blurred image and the corresponding PSNR. Now apply inverse filtering to it by dividing the image
by the blurring function h freq and plot the result.
1. Compare the restored image with the original image and the blurred image. How does the restored
image and the PSNR differ from the blurred image? Is it better or worse? Why?
Now add zero-mean Gaussian noise with a variance of 0.002 to the blurred image. Apply inverse filtering
to the noisy blurred image. Plot the restored image and the PSNR.
1. Compare the restored image with the restored image from the previous step. How does the restored
image and the PSNR differ from the previous restored image? Is it better or worse? Why?
2. Can you draw any conclusions about inverse filtering when applied to noise degraded images?
Let us study the Wiener filter for image restoration. Apply Wiener filtering on the noisy blurred image used
in the previous step. Use the deconvwnr function and pass in the disk blur function as the point-spread
function (PSF) and an appropriate approximation of noise-to-signal ratio (NSR). Plot the restored image and
the PSNR.
1. Compare the restored image with the restored image from the previous step. How does the restored
image and the PSNR differ from the previous restored image? Is it better or worse? Why? Explain it
in context with the concept behind Wiener filtering.
2. Can you draw any conclusions about Wiener filtering when applied to noise degraded images?
3 Adaptive Filtering
Linear shift-invariant (LSI) filters do not take into account any structure in the image; the degree of smoothing is the same over all parts of an image. It is known, however, that people are less sensitive to noise in
regions of high image detail.
Lee developed a filter which adapts to the detail in an image. The form of the filter is
ˆf(i, j) = K(i, j)g(i, j) + (1 − K(i, j))g(i, j)
K(i, j) =
σ
2
g
(i, j) − σ
2
noise
σ
2
g
(i, j)
where g(i, j) and σ
2
g
(i, j) are the mean and variance of the intensity levels of the pixels in the m × m
neighborhood of pixel (i, j), respectively.
Let us now study noise reduction using Lee filter. Load degraded.tif and adjust intensities between
[0, 1]. Note that this filter requires an estimate of the noise variance. In class, you learned a method to
estimate the noise variance. In this lab, an easier empirical method is presented. One way to estimate the
noise variance is to capture a “flat” region of the image and calculate the variance of the intensity levels.
2
1. Use a flat region of degraded.tif and estimate the variance of the noise (getrect may be
helpful here).
Use the Matlab command colfilt to compute the local mean and variance of the image on the 5 × 5
neighborhood of each pixel:
local mean = colfilt(I, [5,5], ‘sliding’, @mean);
local var = colfilt(I, [5,5], ‘sliding’, @var);
where, local mean(i,j) and local var(i,j) are g(i, j) and σ
2
g
(i, j), respectively. Now, you can
compute elements of matrix K and denoise the image using Lee formulation. Plot the original and denoised
image, with PSNR.
1. Compare this result to that using a Gaussian low pass filter with standard deviation of 30. Note the
performance in areas of high and low detail.
2. Try varying your estimate of the noise variance. How does this change the filter’s results? Why?
3. Try changing the size of the filter neighborhood. How does this change the results? Why?
4 Report
Include in your report:
• A brief introduction.
• Pertinent graphs and images (properly labelled).
• Include code (can be included in appendix).
• Include responses to all questions.
• A brief summary of your results with conclusions.
3