Docsity

Optimization & Stereo: Quadratic Functions, Ellipsoidal Points, SSD, & Cross-Correlation -, Assignments of Computer Science

Toggle sidebar
bg1
CMSC828D: Homework 9: Optimization and Stereo
1. Indicate how you would fit a quadratic to a function f(x,y) if you know its values,
fi, at six points on the plane, (xi,yi). ( a0 + a1x+ a2y+a3xy+a4x2+a5y2). Write a
function in Matlab that implements your algorithm. How would you use your
function to compute derivatives? Are there any degenerate configurations that
would make your function fail? Your function should treat these cases as well.
2. If you now had more than six points you could “fit” a surface to these points using
least squares. Write down your distance function. Solve the least squares problem
using the SVD algorithm described in class. Modify your Matlab function. (you
may not use any canned fitting function in Matlab).
3. Generate several points along an ellipsoidal surface given by
z=((x-2)2+(y-3)2)1/2+2
by letting x vary from –2:0.2:2 and y vary from –3:.3:3. Add Gaussian noise of
variance 0.2 to your z vector using the Matlab function randn. Test your
function on this dataset.
4. Now you are given standard deviations for the z variable σi. Modify your
function in Question 2 for this case.
5. Write functions to compute the SSD score and the cross-correlation score for
candidate matches in a pair of stereo images. Test your function on row 15 of the
given left and right images from a stereo camera. (You can obtain the images at
http://www.umiacs.umd.edu/~ramani/imageL.tif and
http://www.umiacs.umd.edu/~ramani/imageR.tif. These are respectively the left
and right images, and are rectified.) The maximum disparity is 11 pixels.

Partial preview of the text

Download Optimization & Stereo: Quadratic Functions, Ellipsoidal Points, SSD, & Cross-Correlation - and more Assignments Computer Science in PDF only on Docsity!

CMSC828D: Homework 9: Optimization and Stereo

  1. Indicate how you would fit a quadratic to a function f(x,y) if you know its values, f (^) i , at six points on the plane, ( xi ,yi ). ( a0 + a 1 x+ a 2 y+a 3 xy+a 4 x^2 +a 5 y^2 ). Write a function in Matlab that implements your algorithm. How would you use your function to compute derivatives? Are there any degenerate configurations that would make your function fail? Your function should treat these cases as well.
  2. If you now had more than six points you could “fit” a surface to these points using least squares. Write down your distance function. Solve the least squares problem using the SVD algorithm described in class. Modify your Matlab function. (you may not use any canned fitting function in Matlab).
  3. Generate several points along an ellipsoidal surface given by z = ((x-2)^2 +(y-3)^2 )1/2^ + by letting x vary from –2:0.2:2 and y vary from –3:.3:3. Add Gaussian noise of variance 0.2 to your z vector using the Matlab function randn. Test your function on this dataset.
  4. Now you are given standard deviations for the z variable σi. Modify your function in Question 2 for this case.
  5. Write functions to compute the SSD score and the cross-correlation score for candidate matches in a pair of stereo images. Test your function on row 15 of the given left and right images from a stereo camera. (You can obtain the images at http://www.umiacs.umd.edu/~ramani/imageL.tif and http://www.umiacs.umd.edu/~ramani/imageR.tif. These are respectively the left and right images, and are rectified.) The maximum disparity is 11 pixels.