Starting from:

$29.99

ECE4513 Assignment #2 Solution


Assignment #2

Part I Written Exercises

Problem 1 Lighting (20 points)

A. Answer the following regarding the above image (photo credit: ColinBrough from RGBStock.com). Short answers (several words) are sufficient (8 points):

a. In what direction is the dominant light source: left and above, directly above, or right and above?

b. Why is one of the temple tips (the part that rests on the ear) so bright, considering that the other tip which has the same material is very dark?

c. What causes the dark streaks in the wood (in terms of shape, albedo, reflectance, etc.)?

d. If the table were completely specular, would the glasses cast a shadow on it (explain why or why not)?



B. Answer the following using the above illustration. Suppose you have observed the intensities of three points on an object (𝐼1, 𝐼2, 𝐼3), which are lit by an infinitely distant point source (the sun). The surface normal at point 2 is exactly perpendicular to the sun. The surface normals of points 1 and 3 differ in only one angle (𝜃), as shown in the cross-section.

a. Suppose the surface has a specular component. Will the observed intensities change as the camera moves (if so why/how)? (4 points)

Finally, compute the values of 𝜃12, 𝜃23 for the observed intensities (0.5, 0.9,
0.8). (8 points)






Problem 2 Mission Impossible? (10 points)


In “Mission Impossible: Ghost Protocol”, the heroes need to work in a corridor within full view of a security guard. Their solution: erect a back-lit projection screen and project an empty hallway onto it. Assume they have ultra-super-duper projector and computer vision technology – they can update the projected image in real-time and detect/track objects. Consider the following scenarios:

a. A security camera is looking down the hallway at the screen. The camera can freely rotate but cannot otherwise move. Is it possible to put an image on the projection screen, such that the screen is undetectable for someone monitoring the camera? If not, why not? If so, what information is required? (4 points)

b. A security guard is sitting behind his desk looking down the hallway. Recently, while inspecting a pencil, the guard poked his eye, and now he has a patch covering that eye. But he can still move around and has one good eye. Is it possible to fool the security guard? If not, why not? If so, what information is required? (3 points)

c. Is it possible to fool both the security camera and the one-eyed security man at the same time? If not, why not? If so, what information is required? (3 points)

Hints: these should be short answers. One or two sentences is fine.


Problem 3 (10 points)
As the figure below shows, the Fourier transform of a “tent” function (on the left) is a squared sinc function (on the right). Advance an argument that shows that the Fourier transform of a tent function can be obtained from the Fourier transform of a box function.
(Hint: The tent itself can be generated by convolving two equal boxes.)

Problem 4 (10 points)
Images needed to be padded by appending zeros to the ends of rows and columns in the image (see the following image on the left). Do you think it would make a difference if we centered the image and surrounded it by a border of zeros instead (see image on the right), but without changing the total number of zeros used? Explain.

Problem 5 (10 points)
A continuous Gaussian lowpass filter in the continuous frequency domain has the transfer function
H, Ae(  2 2)/2 2
Show that the corresponding filter in the spatial domain is
h t z ,  A22e22 2 2(t z2)
Problem 6 (10 points)
Show that the Fourier transform of the 2-D continuous sine function
f x y ,  Asin(u x0 v y0 )
is the pair of conjugate impulses
A u0 ,v v0 )(u u0 ,v v0 )] F u v( , )  j[ ( u
2 2 2 2 2
(Hint: Use the continuous version of the Fourier transform and express the sine in terms of exponentials.)

Submission List:
• All answers in the file your_school_id_name.pdf (e.g., 1190190xx_San_Zhang.pdf ).

Part II Programming Exercises

Problem 1 Moire Pattern Suppression in Radiographs (30 points)
Please use the images “pro1_radiograph_1.jpg” and “pro1_radiograph_2.jpg” as the inputs. You can only use the following Python libraries: OpenCV OpenCV (only for loading and writing images), numpy, math, and matplotlib.
Submission List:
• Codes for the your previous implementation of the median filter in the file median_filter.py.
• Codes for the implementation in part (c) in the file notch_filter.py.
• Codes for displaying results in part (a), (b), and (c) in the file main.py.
• All code files in the folder Problem1.
• Display the results for part (a), (b), and (c) in the your_school_id_name.pdf. (e.g., 1190190xx_San_Zhang.pdf ).

(a) For each image, apply an N × N median filter in Problem 1 part (a). Adjust the window size N so that the Moire pattern is removed as much as possible while salient features are properly preserved. Report your choice of N. Display the filtered image, and comment on the quality of the filtered image.
(b) For each image, compute its Discrete Fourier Transform (DFT) (numpy.fft) and display an image showing the DFT magnitude (numpy.abs). Clearly identify and label the frequency components that correspond to the Moire pattern.
(c) For each image, design a notch filter notchFilter(img, parameter1, …) so that the frequency components for the Moire pattern are suppressed as much as possible while other frequency components are preserved. Note that the parameters of the function are defined by yourself. Apply your notch filter to the image’s DFT and display an image showing the filtered DFT magnitude. Display the filtered image in the spatial domain (numpy.fft). Compare the quality of the result to that of the filtered image from part (a). (Hint: numpy.meshgrid is useful for creating an (ωx, ωy) array.)

More products