This project is the lab exercise of cource EE326 Digital Image Processing in Southern University of Science and Technology
For discussion, you can contact me by yuant2018@mail.sustech.edu.cn
In this course we will learn to install anaconda and use numpy as well as matplotlib which you cannot use in the following labs.
In this course we will try to use different algorithms of Image Interpolation to resize the image.
- Use nearest neighbor interpolation and bilinear interpolation to interpolate a grey scale image.
- Use Python function “interp2” from packet “scipy” or your own written algorithm to interpolate a grey scale image by using bicubic interpolation.
In the lab, input_image
is the file name of the input image, output_image
is the file name of the output image, input_hist
and output_hist
are lists containing the histogram of the input image and output image, and spec_hist
is a list containing a specified histogram of the input image; m_size
is the scale of the neighborhood size, and n_size
is the scale of the filter size.
Task I:
< 785F a id="user-content-task-i" class="anchor" aria-label="Permalink: Task I:" href="#task-i">Implement the histogram equalization to the input images Q3_1_1.tif and Q3_1_2.tif.
Specify a histogram for image Q3_2.tif, such that by matching the histogram of Q3_2.tif to the specified one, the image is enhanced. Implement the specified histogram matching to the input image Q3_2.tif. You may refer to the histogram given in the Lecture Notes 3 page 49, but not necessary to use the same one. Illustrate your specified histogram graphically and numerically in your report.
Implement the local histogram equalization to the input images Q3_3.tif.
Implement an algorithm to reduce the salt-and-pepper noise of an image. The input image is Q3_4.tif.
Implement the Sobel filter to the input images Q5_1.tif in both spatial domain and frequency domain.
Compare the results. Refer to slides 78 to 81 of Lecture 4
Steps for Filtering in the Frequency Domain
- Given an input image
$f(x,y)$ of size M x N, obtain the padding parameters P and Q. Typically, P = 2M and Q = 2N. - Form a padded image,
$f_p(x,y)$ of size P x Q by appending the necessary number of zeros to f (x,y) - Multiply
$f_p (x,y)$ by$(-1)^{x+y}$ to center its transform - Compute the DFT, F(u,v) of the image from step 3
- Generate a real, symmetric filter function*, H(u,v), of size P x Q with center at coordinates (P/2, Q/2)
- Form the product G(u,v) = H(u,v)F(u,v) using array multiplication
- Obtain the processed image
- Obtain the final processed result, g(x,y), by extracting the M x N region from the top, left quadrant of
$g_p (x,y)$
Implement the Gaussian low pass and high pass to the input image Q5_2.tif. results for 𝐷 0 = 30 , 60 , and 160, respectively.
Implement the Butterworth notch filters to the input images Q5_3.tif. 114 of Lecture 4.