Week 7 Homework -- Nov 29, 2011 see images: 07week_HW_Q*.jpg HW7Q1 Perspective Projection Object X -- size of thing out there somewhere Range Z -- distance object to lens Focal Length f -- distance of lens to image Image x -- size of image dropping minus sign, want all numbers to be positive in this example... X(meters) Z(meters) f(mm) x(mm) x = X * f / Z 10 100 10 ??? xmm = 1mm 10,000mm 100,000mm 10mm f = Z * x / X 20 400 ??? 1 fmm = 20mm 20,000mm 400,000mm 1mm !!!miscopied this into the answers as 30mm !!gdmit!!! so got it wrong Z = X * f / x 2 ??? 40 1 Zm = 80m 2m .040m .001m X = Z * x / f ??? 300 100 1 Xm = 3m 300m .1m .001m HW7Q2 Linear or Not -- BTFOM a function is linear if the resulting pixel is a linear combination of input pixels -- could be weighted by constants or summed...but squares, etc are non-linear Linear Non-linear gradient kernel -1,1 L -- any kernel convolution is linear -- 5x5 gaussian kernel L -- see kernel above, gaussian just has many different values -- absolute value L <***wrong, it is NON (if pix is negative just map back to abs value) -- abs value in NON-linear, "kink" at 0 where direction changes gradient magnitude kernel N sqr root of the sum of image gradients: sqrt( Ix^2 + Iy^2 ) -- non-lin because of squares and roots, ...but I still don't understand if/how this turns into the "regular" 2d edge finder kernels... -- average brightness L of all greyscale image pixels -- same as gaussian with a single multiplier value in every location -- HW7Q3 Gradient Image calculate a gradient image given a 3x3 image with pixel values: 2 0 2 4 100 102 2 4 2 and all values outside the image are 0 want to obtain another 3x3 image by convolving image with the kernel: -1,0,1 and taking the absolute value of each pixel (ignore minus sign) to get a new 3x3 matrix (for each value you get a linear combination...) == 0 0 0 100 98 100 4 0 4 GDM -- I guessed the right way to go about it... HW7Q4 Stereo see image: 07week_HW_Q4.jpg for a well calibrated stereo camera using two pinhole cameras whose displacement is B, distance to image is f, distance to Object is Z (he said distance to image but drew distance to pinholes...) and the displacement of the two image x's "dx" in mm, f is in mm, B and Z are in meters dx(mm) f(mm) B(m) Z(m) Z = f * B / dx 4 40 0.1 ??? Zm = 1m .004m .04m 0.1m B = dx * Z / f 0.05 50 ??? 100 Bm = .1m 0.00005m 0.05m 100m f = dx * Z / B 0.1 ??? 0.2 50 fmm = 25mm 0.1mm 200mm 50,000mm dx = f * B / Z ??? 200 1 50 dxmm = 4mm 200mm 1000mm 50,000mm HW7Q5 Correspondence in Stereo dynamic programming approach using scan lines left scan line: R R B B B R R right scan line: R R R B B B R ...obviously there's a shift going on... where does the left line middle B pixel (4 from left) go on the right line? cost of bad match (of two colors that don't correspond) = 20 cost of (an assumed) occlusion or dis-occlusion = 10 find the optimal alignment and check the box for the correspondence then change the cost of occlusion to 100 find the optimal alignment and check the box for the correspondence for occlusion = 10: R R R B B B R ^ for occlusion = 100: R R R B B B R ^ HW7Q6 Structure from Motion not full grown which is hard to do on paper see image: 07week_HW_Q6.jpg have two cameras A,B (at 90deg to each other in drawing) and three features to see each camera sees different features on Left, Center, Right (of image) just call features 1,2,3 (don't know which is which) if Camera A sees 1,2,3 L,C,R what does camera B see? if Camera B sees 1,2,3 L,C,R what does camera A see? ARE THE IMAGES INVERTED??? no, not according to the example in: Video 18.2 Projection Question see image: 18class_SFM_Quiz.jpg for A123 -> B 3,1,2 for B123 -> A 2,3,1