Nothing Special   »   [go: up one dir, main page]

MSBD 5010 (Fall 2020) : Assignment 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

MSBD 5010 (Fall 2020)

Assignment 1
Task 1 – Histogram Equalization
• Part 1: Histogram Equalization on gray-level images
(sub-task 1, sub-task 2)
• 1. Given a gray level image G, compute and display its histogram. Note: You
are not allowed to use the built-in histogram function.
• 2. Perform histogram equalization on G, then compute and display the
histogram of the result image.
• M-files need to be completed:
• histogram_eq.m
• You may create your own m-files for other operations such as computing the histogram.
Task 1 – Histogram Equalization
• Part 2: Histogram Equalization on color images in RGB modes
(sub-task 3, sub-task 4)
• 3. Given a color image C in RGB mode, perform histogram equalization on the
R, G, B channels of C separately. Rebuild a RGB image from these histogram-
equalized channels.
• 4. Compute the histograms on R, G, B channels separately and then calculate
an average histogram from these three histograms. Use this average
histogram as the basis to obtain a single-valued histogram equalization
intensity transformation function. Apply this function to the R, G, B channels
individually. Rebuild a RGB image from these processed channels.
• M-files need to be completed:
• histogram_eq.m;
• You may create your own m-files for other operations.
Task 1 – Histogram Equalization
• Part 2: Histogram Equalization on color images in RGB mode
• Sub-task 3:

Histogram
Equalization
C_R: M x N

Separate Histogram Rebuild


Equalization

C_G: M x N

C: M x N x 3 C_EQ: M x N x 3
Histogram
Equalization
C_B: M x N
Task 1 – Histogram Equalization
• Part 2: Histogram Equalization on color images in RGB mode
• Sub-task 4:

Histogram
Equalization

Average
+ Histogram Rebuild
Equalization

T(r)

Histogram
C_EQ: M x N x 3
Equalization
Task 2 – Gradient magnitude
• Complete gradient magnitude of a image
• 𝑚𝑚𝑚𝑚𝑚𝑚 ∇𝑓𝑓 ≈ 𝑧𝑧7 + 𝑧𝑧8 + 𝑧𝑧9 − 𝑧𝑧1 + 𝑧𝑧2 + 𝑧𝑧3 + | 𝑧𝑧3 + 𝑧𝑧6 + 𝑧𝑧9 −
𝑧𝑧1 + 𝑧𝑧4 + 𝑧𝑧7 |
Task 3 – Denoising in spatial domain
• 3.1 Additive uniform random noise generator
• 3.2 Arithmetic mean filter with window size = 5x5
• 3.3 Alpha-trimmed mean filter with window size = 3x3
Task 4 – High-Boost Filter
• The high-boost filtering is done by adding the original image to the
difference between the original image and its blurred image,
• 𝑔𝑔 𝑥𝑥, 𝑦𝑦 = 𝑓𝑓 𝑥𝑥, 𝑦𝑦 + 𝑘𝑘 ∗ 𝑔𝑔𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚 𝑥𝑥, 𝑦𝑦 = 𝑓𝑓 𝑥𝑥, 𝑦𝑦 + 𝑘𝑘 ∗ (𝑓𝑓 𝑥𝑥, 𝑦𝑦 − 𝑓𝑓 ̅ 𝑥𝑥, 𝑦𝑦 ), 𝑘𝑘 > 1
• M-files need to be completed:
• high_boost_filter.m
Task 5 – Periodic Noise and Denoising in the
Frequency Domain
• Periodic noise can be generated by the sine wave,
• 𝑟𝑟 𝑥𝑥, 𝑦𝑦 = 𝐴𝐴𝑥𝑥 sin(2𝜋𝜋𝑢𝑢0 𝑥𝑥 + 𝐵𝐵𝑥𝑥 /𝑀𝑀) + 𝐴𝐴𝑦𝑦 sin(2𝜋𝜋𝑣𝑣0 (𝑦𝑦 + 𝐵𝐵𝑦𝑦 )/𝑁𝑁)) ,
• We can use bandreject filters to deal with the above noise model
1
• Butterworth (𝐻𝐻𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵 𝑢𝑢, 𝑣𝑣 = 2𝑛𝑛 ) or
𝐷𝐷 𝑢𝑢,𝑣𝑣 𝑊𝑊
1+
𝐷𝐷2 𝑢𝑢,𝑣𝑣 −𝐷𝐷202
2 2
1 𝐷𝐷 𝑢𝑢,𝑣𝑣 −𝐷𝐷
−2 𝐷𝐷 𝑢𝑢,𝑣𝑣 𝑊𝑊 0
Gaussian (𝐻𝐻𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺 (𝑢𝑢, 𝑣𝑣) = 1 − 𝑒𝑒 ) is required.
• Note: For other periodic noise model, notch filters may work better
• Please determine the suitable band width and its radial center for the
periodic noise given by the above parameters.
• M-files need to be completed:
• Gen_periodic_noise.m
• Band_reject_filter.m
The spectrum after adding noise The spectrum before adding noise Butterworth bandreject filter Noisy image

Task 5 – Periodic Noise and


Denoising in the Frequency Domain

Filtering result
Task 6 – Wiener filtering
• Given the power spectra of the noise 𝑆𝑆𝜂𝜂 and the un-degraded image
𝑆𝑆𝑓𝑓 , complete the Wiener filter
• MATLAB function, e.g.: “wiener2” is not allowed for this task.
Written Question
• Topic: Fourier Representation
• Explain the significant increase in signal strength along the vertical and
horizontal axes of Fig.(d) compared with Fig.(b).
• Explain the significant increase in signal strength in the low frequency region
of Fig.(d) compared with Fig.(b).
Assignment Submission and Marking
• 1. Your submitted all the .m files (including the provided main
function) along with the written assignment. You must compress all
your files with the following filename format: [your 8-digit student
ID]_assign1.zip, e.g. 09654321_assign1.zip, into one file.

• 2. Runtime requirement: your program must be able to finish all the


above tasks within 5 minutes.
Assignment Submission and Marking
• 3. Note that we take plagiarism seriously. You are allowed to discuss
or share your idea to your classmate, but you are not allowed to
share your code/pseudocode of your assignment. Please also follow
the referencing skills at
https://libguides.ust.hk/referencing/plagiarism to avoid plagiarism.

• 4. Marks would be deducted if there are any violations of the above


requirements.
FAQ
• Can I use xxx function in Matlab?
• Ans: Unless specified otherwise, you can only use matrix/math related function, e.g.:
min(), max(), mean() etc.

• Can I discuss with my friends?


• Ans: You can discuss with your classmate, but you are not allowed to share your
code/pseudocode of your assignment.

• If I found something useful online, can I use it?


• Ans: Make sure you have followed the referencing skills at
https://libguides.ust.hk/referencing/plagiarism to avoid plagiarism and you have fully
understood the codes.

You might also like