

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Information about homework 2 for the image processing course cse190 at the university of california, san diego. The homework includes reading assignments, written exercises, and matlab exercises. The topics covered include gradient functions, canny edge detection, laplacian of gaussian edge detection, and discrete fourier transforms.
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!


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. Jan. 23, 2002.
Reading
Written exercises
Matlab exercises
Gσ (x) =
2 πσ^2
e−x
(^2) / 2 σ 2
To produce a discrete approximation to a Gaussian with effective width σ^2 , use the N th row of Pascal’s triangle, where N = 4σ^2 + 1. The corresponding normalization factor is 2−(N^ −1).
(a) Make plots comparing the binomial kernel to the continuous Gaussian kernel for σ^2 =
Things to turn in:
(a) Examine the gradient function and explain how it is implemented in terms of convolu- tion. (The commands which and type may be useful for this purpose. Alternatively, you can apply gradient to an impulse and inspect the result.)
(b) Implement the simplified version of the Canny edge detector as described in lecture. The syntax of your function should be as follows: [E,M,A]=canny(I,sig,tau), where E contains the detected edges, M contains the smoothed gradient magnitude, A contains the gradient angle, I is the input image, sig represents σ for the smoothing filter, and tau is the threshold τ. You do not need to implement hysteresis thresholding, but you do need to implement oriented nonmaximal suppression. For extra credit, implement hysteresis thresholding with edge tracking. (c) Run your edge detector on Figure 10.4(a) using τ = 5 and the following three values for σ^2 : 0. 5 , 1, and 3. (Note: to save ink, invert E before printing it.) Discuss how the choice of σ effects the results. (d) Apply your edge detector to Figure 1.14(c), adjusting σ and τ as you see fit. Display the resulting edges and the parameter settings used.
Things to turn in:
(a) Use fspecial with the ’LoG’ option to construct a 15×15 isotropic Laplacian of Gaussian kernel with SIGMA=2. Call the kernel H. Make a mesh plot of -H. (b) Using conv2 with the ’same’ option, apply H to Figure 10.15(a) and call the result F. Display the original image, the filtered image, and the filtered image thresholded at zero. (c) Display the zero crossings of F as a contour plot superimposed on the raw image. (Hint: use contour with level set parameter [0 0].) (d) The contour plot in the previous step displays the zero crossings regardless of edge strength. We can use the gradient magnitude to suppress contours for weak edges as follows. Compute the smoothed gradient magnitude M as in the previous exercise, using σ = 2. Set all pixels in F for which M<tau equal to NaN. Pick a value of τ in the interval [2, 6]. Now reproduce the superimposed contour plot with this threshold in place.
You will notice that there is no choice for τ that finds all the meaningful edges in the image while suppressing the spurious ones. This is a reminder that edge detection is a low level operation; without high level knowledge of the objects that are meaningful in this image, one cannot hope to detect and localize the boundaries correctly.
Things to turn in:
Compute and display the DFT of the following 1D signals. The Matlab function for the 1D DFT is fft. For each DFT, use stem to display the following three plots: (1) original signal, (2) DFT magnitude (using abs), (3) DFT phase (using angle). In the latter two plots, use fftshift to place the DC component at the middle. Label the axes and put a title on each plot. Set the y axis range on the phase plots to [−π, π].
(a) δ(x − xo) for x = 0, 1 ,... , 7 with the following values of xo: 0, 1 , 4. (b) cos ωox for x = 0, 1 ,... , 7 with the following values of ωo: 0, π/ 4 , π/ 2 , π.