COMP 4102A: Assignment 1
Instructions for submission: Please submit a PDF with your solutions on theory questions. The PDF
should explain your work. For coding questions you may use C/C++ and OpenCV or Python with OpenCV
Python for this assignment. Comment your code to make it easier to grade. Include your codes for edge
detection in a folder. Submit a single zip file that contains: 1 – PDF with your answers to question 1; 2
– folder containing edge detection code, images, and readme file that explains how to run your code; 2 –
folder containing your sticks filtering code, images, and readme file that explains how to run your code.
Please submit through Brightspace. You are expected to work on the assignment individually. Do not
leave your submission to the last minute because if you run into technical issues the system will cut you
off. You can submit multiple versions of your assignment, and we will grade the latest one.
1 (30 points) Theory questions
1. (5 points) Are three dimensional rotations expressed as Rx, followed by Ry, and then Rz (rotations
around the x, y and z axis) commutative That is, does the order in which they are applied matter.
Explain the answer.
2. (8 points) Find the SVD of A, UΣV T , where A =
[
2 2 0
1 1 0
]
Hint: first find ATA, then find λ by solving det(ATA λI) = 0. Look at this example to find out
how to calculate the U and V : https://www.d.umn.edu/~mhampton/m4326svd_example.pdf
3. (4 points) Scale a vector [x y]T in the plane can be achieved by x′ = sx and y′ = sy
where s is a scalar.
(a) Write out the matrix form of this transformation.
(b) Write out the transformation matrix for homogeneous coordinates.
(c) If the transformation also includes a translation
x′ = sx+ tx and y′ = sy + ty
Write out the transformation matrix for homogeneous coordinates.
(d) What is the equivalent of the above matrix for three-dimensional vectors
4. (5 points) Find the least square solution x for Ax = b if
A =
2 0 1 1
0 2
, b =
10
1