Docsity

Image Processing Homework 4 - CSE190, Assignments of Computer Science

Toggle sidebar
bg1
CSE190 – Image Processing – Homework #4
Instructor: Prof. Serge Belongie. T.A.: Josh Wills.
http://www-cse.ucsd.edu/~sjb/classes/cse190
Due (in class) 1:25pm Wed. Feb. 6, 2002.
Reading
•GW 6.0-6.2.
Written exercises
1. GW, Problem 6.4.
2. GW, Problem 6.5.
3. GW, Problem 6.6.
4. GW, Problem 6.7.
5. GW, Problem 6.12.
Matlab exercises
1. Gabor Functions
In 1D, the Gabor function of width σand spatial frequency uois given by the following
complex-valued function:
h(x) = e−x2/2σ2
ej2πuox
In 2D, the corresponding expression is
h(x) = e−kxk2/2σ2
ej2πuo·x
where x= (x, y) and uo= (uo, vo), and it serves as an oriented bandpass filter. The even and
odd Gabor functions are equal to the real and imaginary parts of h, respectively.
(a) Compute eight examples of even and/or odd 1D Gabor functions on the interval x∈
[−15,16] using parameters chosen in the following ranges: σ∈[1,3] and uo= [0,0.3]. For
each example, plot the function and its Fourier transform magnitude.
(b) Compute eight examples of even and/or odd 2D Gabor functions on the interval x∈
[−15,16] ×[−15,16] using parameters chosen in the following ranges: σ∈[1,3] and
uo= [0,0.3] ×[0,0.3]. For each example, display the function (either as an image or a
surface plot) and its Fourier transform magnitude.
(c) Load in the fingerprint image of Figure 10.29(a) and visually inspect it to determine the
approximate ridge frequency. Choose two 2D Gabor functions, one even and one odd,
with kuokapproximately equal to the ridge frequency. Display the raw fingerprint image,
the even filter, and the odd filter along with the magnitudes of their respective Fourier
transforms. Note: zero-pad the filters to the size of the image before transforming them.
Now filter the fingerprint image with each Gabor function and display the results. Explain
what you observe.
Things to turn in:
•Printouts of plots for steps 1a and 1b.
•Printouts and written response for step 1c.
1
pf2

Partial preview of the text

Download Image Processing Homework 4 - CSE190 and more Assignments Computer Science in PDF only on Docsity!

CSE190 – Image Processing – Homework # Instructor: Prof. Serge Belongie. T.A.: Josh Wills. http://www-cse.ucsd.edu/~sjb/classes/cse Due (in class) 1:25pm Wed. Feb. 6, 2002.

Reading

  • GW 6.0-6.2.

Written exercises

  1. GW, Problem 6.4.
  2. GW, Problem 6.5.
  3. GW, Problem 6.6.
  4. GW, Problem 6.7.
  5. GW, Problem 6.12.

Matlab exercises

  1. Gabor Functions In 1D, the Gabor function of width σ and spatial frequency uo is given by the following complex-valued function: h(x) = e−x

(^2) / 2 σ 2 ej^2 πuox In 2D, the corresponding expression is

h(x) = e−‖x‖

(^2) / 2 σ 2 ej^2 πuo·x

where x = (x, y) and uo = (uo, vo), and it serves as an oriented bandpass filter. The even and odd Gabor functions are equal to the real and imaginary parts of h, respectively.

(a) Compute eight examples of even and/or odd 1D Gabor functions on the interval x ∈ [− 15 , 16] using parameters chosen in the following ranges: σ ∈ [1, 3] and uo = [0, 0 .3]. For each example, plot the function and its Fourier transform magnitude. (b) Compute eight examples of even and/or odd 2D Gabor functions on the interval x ∈ [− 15 , 16] × [− 15 , 16] using parameters chosen in the following ranges: σ ∈ [1, 3] and uo = [0, 0 .3] × [0, 0 .3]. For each example, display the function (either as an image or a surface plot) and its Fourier transform magnitude. (c) Load in the fingerprint image of Figure 10.29(a) and visually inspect it to determine the approximate ridge frequency. Choose two 2D Gabor functions, one even and one odd, with ‖uo‖ approximately equal to the ridge frequency. Display the raw fingerprint image, the even filter, and the odd filter along with the magnitudes of their respective Fourier transforms. Note: zero-pad the filters to the size of the image before transforming them. Now filter the fingerprint image with each Gabor function and display the results. Explain what you observe.

Things to turn in:

  • Printouts of plots for steps 1a and 1b.
  • Printouts and written response for step 1c.
  1. Gaussian derivatives vs. Gabor functions

(a) Evaluate the 1D Gaussian function e−x

(^2) / 2 σ 2 on the interval x ∈ [− 15 , 16] using σ = 3. Compute its approximate third derivative by repeated application of the centered first difference kernel. Plot the resulting function and its DFT magnitude. (b) Experimentally find parameter values for an even or odd 1D Gabor function that closely matches the Gaussian 3rd derivative. Note: you may also need to apply an amplitude scaling factor. Once you have found a good match, make plots showing the quality of the match in both the spatial domain and the frequency domain.

Things to turn in:

  • Printout of plots in steps 2a and 2b.
  1. Color Histograms

(a) Make a function in Matlab that computes the RGB color histogram for a user-selected rectangular region in an arbitrary color image. Use 32 bins for each color channel, spaced equally between 0 and 255. Concatenate the three histograms together to make a com- bined histogram of length 3 × 32 = 96. Hint: to get the histogram for the red channel, use rh=hist(R(:),32), where R is an array containing the red slice of an RGB image. Once you have computed the combined histogram, normalize it so that it sums to 1. (b) Using the above function, compute and display the color histogram for each of five different rectangular regions of your choice for Figure 6.30(a) (a bowl of strawberries). Use bar to plot each histogram, and clearly mark the x-axis to indicate the division between the R, G, and B intervals. Annotate your plot (use gtext or just mark it by hand) to explain the significance of the various peaks you observe. Along with each histogram, display the corresponding region of the image used to compute it. (c) Implement a function to compute the χ^2 distance between a pair of normalized histograms. Use this function to compare all pairs of the five histograms you computed in the previous step. Output the values in a 5 by 5 matrix; because of symmetry, only the upper triangular portion of this matrix is needed. Choose at least three representative entries in this matrix and explain their values in terms of the color distributions you compared to obtain them.

Things to turn in:

  • Code listings for steps 3a and 3c.
  • Written answers for steps 3b and 3c.
  • Printouts for steps 3b and 3c.