CS559 - Spring 2008 - Project 1 "Theoretical Background" Assignment Please answer the following 5 questions (each with multiple parts). You do not need to write down answers for the "food for thought" questions, but if you write down answers we will look at them. Turn your answers in by placing a file in your handin directory under P1-Stage3. Please provide either a plain text file (.txt) or an acrobat file (.pdf). We will use the AFS file modification date to determine when the assignment was turned in. If you choose to work in pencil and paper, please either type your answers in (preferred), or scan your pages in. This assignment is due on Monday noon Feb 18. Questions: 1. Let f, g, and h be the discrete signals: f = [ 1 2 1 3 1 4 1 5 1 6 2 5 3 4 3 ] g = 1/5 [1 1 1 1 1] h = 1/6 [1 2 3] For these first 3 parts, compute the ``whole sequence'' of the convolution: 1.A compute f*g 1.B compute f*h 1.C compute f*g*h For these next 3 parts, assume that f has its ``zero'' at the first entry, g and h are ``zero centered'', and compute the convolutions to provide signals over the same domain as f (your answers should be 15 samples long). (hint: most of these answers can be copied from 1.A and 1.B) 1.D compute f*g using zero-padding to handle the boundaries 1.E compute f*g using reflection to handle the boundaries 1.F compute f*g using kernel renormalization to handle the boundaries 2. Consider reconstructing the signal from the following samples (the first sample was at t=0): f = [ 1 2 1 3 1 2 2 ] Compute the value of the reconstructed signal at t=1.5, t=2, and t=3.25 with the following reconstruction filters (your answer for each should be 3 numbers). 2.A The unit box (g(t) = 1 if -.5 <= t < .5, 0 otherwise) Note: in the book, this is the continuous case and r=1/2 2.B The unit tent (g(t) = (1+t) if -1 < t <= 0, 1-t if 0 < t <= 1, and 0 otherwise) Note: in the book, this is the tent filter of r=1 2.C The box of r=1 (see the book) 2.D The tent of r=2 (again see the book) 3. Consider resampling the following signal: [ 0 0 4 4 0 0 4 0 4 0 4 0 0 0 4 0 0 0 ] using the kernel 1/4 [1 2 1] 3.A If you resample the signal at half the sampling rate, what result would you get? 3.B If you made a small change in how you sampled in 3.A (say, chose even instead of odd values), would the results be very much different? What does this say about the adequacy of the kernel for doing this resampling? 3.C If you resample the signal at 1/3rd the samping rate (pick every third sample), what result would you get? 3.D If you made a small change in how you sampled in 3.C (say, shifted the sampling position by 1), could the results be very much different? What does this say about the adequacy of the kernel for doing this resampling? 4. A seperable kernel is one where you can achieve a 2D convolution by doing two seperate convolutions, one in each dimension. (or in higher dimensions, an nD convolution by doing n seperate convolutions). What 2D convolution is achieved by doing the following 1D convolutions in one dimension then the other? Your answer should be a 2D ``matrix'' of numbers (the 2D convolution kernel). 4.A 1/5 [ 1 1 1 1 1 ] 4.B 1/16 [ 1 4 6 4 1 ] 4.C 1/2 [1 -1 2 -1 1] Consider doing an NxN convolution that is seperable on an MxM image. Assume that M >> N. What is the assymptotic complexity (big O) of: 4.D Doing the convolution as 2 1D convolutions (of kernel size N)? 4.E Doing the convolution as 1 2D convolution (kernel size of NxN)? Your answer should be a function of M and N. (hint 1: ignore the boundary conditions (since we're talking about assymptotic complexity) - just assume that the kernel always overlaps the image) 5. Let pixel A have color 255,192,64 and alpha value of 127 (out of 255). Let pixel B have color 0,255,255, and alpha value of 255. Let pixel C have color 0,255,255, and alpha value of 192. (it should be obvious that these values are not premultiplied) What is the value (R,G,B,A) of: 5.A A over B 5.B B over A 5.C A over C 5.D C over A