Assignment 1 - Computer Vision | CS 482, Assignments of Computer Science

Material Type: Assignment; Class: Computer Vision; Subject: Computer Science; University: George Mason University; Term: Unknown 1989;

Typology: Assignments

Pre 2010

Uploaded on 02/10/2009

koofers-user-fk1
koofers-user-fk1 🇺🇸

9 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS482 Homework 1 (Due February 17th)
J. Koˇseck´a
1. Consider rigid body transformations in the plane. Draw a right triangle defined by three points A=
(2,1), B = (4,1), C = (4,6).
Consider a rotation matrix
T1=·cos θsin θ
sin θcos θ¸
a. What is the determinant of the matrix ?
b. Apply the rotation matrix to the triangle and show the result.
Consider transformation matrix
T2=·sin θcos θ
cos θsin θ¸
a. Is the matrix orthonormal ? What is the determinant of the matrix ?
b. Apply the transformation matrix to the triangle and show the result.
c. Is T2rigid body transformation (i.e. can you move the triangle from initial position to the final without
leaving the plane ? What is the difference between T1and T2, how are the results different?
2. Vector P1= [p1, p2, p3]Texpressed in frame 1. Coordinate frame 1 is rotated about axis z1by θdegrees
and then rotated around axis x1by φdegrees - both rotations are around initial stationary frame. Give a
rotation matrix that accomplishes these two rotations and coordinates of the point Pin the new frame.
3. Suppose that you are given the relative displacement between the coordinate frame {1}and {2},g21 =
(R21, T21) expressed in the frame {1}and relative displacement between the frame {3}and the frame {2}
expressed in the frame {3}, and denoted by g23 = (R23, T23). What is the relative displacement g31, between
the frame {1}and frame {3}expressed in the frame {1}?. a) Draw a figure; and write g31 in terms of given
transformations/displacements. b) Write down explicitly what is the rotational and translational part of g31,
in terms of given rotations Rij and T0
ijs.
4. Using formula for the rotation matrix in the handout, implement MATLAB function called rotmat.m that
takes as an input three angles α, β, γ and returns the corresponding rotation matrix R. The function will be
called in the following ways: R=rotmat(α, β, γ ).
5. Write a MATLAB function, which implements the image formation process.
Write a function x=project(X,R,T,K) which takes as an input image coordinates of 3D points in the
world coordinate frame and generates pixel coordinates of the projected points in the image, assuming that
(R, T ) is the displacement of the camera coordinate frame with respect to the world frame, Kis is the
matrix of intrinsic image parameters, and Xis a 3 ×nvector of the coordinates of 3D points. To test the
function consider a unit cube placed in the origin of the world coordinate system (specified by 8 vertices
[0,0,0]0,[100]0, etc, assume that the camera is translated along z-axis by some amount and rotated around
x-axis by angle 20. You can assume that matrix K is [800,0,250; 0,800,250; 0,0,1]. Generate the image
of the cube. Its enough when you plot the vertices of the cube and optionally connected them by line to
visualize it better.
6. Implement the peak-and-valley method for finding right threshold for generating binary image (e.g. compute
histogram and find peaks and valleys of the histogram). Apply the selected threshold to the image.

Partial preview of the text

Download Assignment 1 - Computer Vision | CS 482 and more Assignments Computer Science in PDF only on Docsity!

CS482 Homework 1 (Due February 17th) J. Koˇseck´a

  1. Consider rigid body transformations in the plane. Draw a right triangle defined by three points A = (2, 1), B = (4, 1), C = (4, 6). - Consider a rotation matrix T 1 =

[

cos θ − sin θ sin θ cos θ

]

a. What is the determinant of the matrix? b. Apply the rotation matrix to the triangle and show the result.

  • Consider transformation matrix T 2 =

[

sin θ cos θ cos θ − sin θ

]

a. Is the matrix orthonormal? What is the determinant of the matrix? b. Apply the transformation matrix to the triangle and show the result. c. Is T 2 rigid body transformation (i.e. can you move the triangle from initial position to the final without leaving the plane? What is the difference between T 1 and T 2 , how are the results different?

  1. Vector P 1 = [p 1 , p 2 , p 3 ]T^ expressed in frame 1. Coordinate frame 1 is rotated about axis z 1 by θ degrees and then rotated around axis x 1 by φ degrees - both rotations are around initial stationary frame. Give a rotation matrix that accomplishes these two rotations and coordinates of the point P in the new frame.
  2. Suppose that you are given the relative displacement between the coordinate frame { 1 } and { 2 }, g 21 = (R 21 , T 21 ) expressed in the frame { 1 } and relative displacement between the frame { 3 } and the frame { 2 } expressed in the frame { 3 }, and denoted by g 23 = (R 23 , T 23 ). What is the relative displacement g 31 , between the frame { 1 } and frame { 3 } expressed in the frame { 1 } ?. a) Draw a figure; and write g 31 in terms of given transformations/displacements. b) Write down explicitly what is the rotational and translational part of g 31 , in terms of given rotations Rij and T (^) ij′ s.
  3. Using formula for the rotation matrix in the handout, implement MATLAB function called rotmat.m that takes as an input three angles α, β, γ and returns the corresponding rotation matrix R. The function will be called in the following ways: R = rotmat(α, β, γ).
  4. Write a MATLAB function, which implements the image formation process. Write a function x = project(X, R, T, K) which takes as an input image coordinates of 3D points in the world coordinate frame and generates pixel coordinates of the projected points in the image, assuming that (R, T ) is the displacement of the camera coordinate frame with respect to the world frame, K is is the matrix of intrinsic image parameters, and X is a 3 × n vector of the coordinates of 3D points. To test the function consider a unit cube placed in the origin of the world coordinate system (specified by 8 vertices [0, 0 , 0]′, [100]′, etc, assume that the camera is translated along z-axis by some amount and rotated around x-axis by angle 20◦. You can assume that matrix K is [800, 0 , 250; 0, 800 , 250; 0, 0 , 1]. Generate the image of the cube. Its enough when you plot the vertices of the cube and optionally connected them by line to visualize it better.
  5. Implement the peak-and-valley method for finding right threshold for generating binary image (e.g. compute histogram and find peaks and valleys of the histogram). Apply the selected threshold to the image.