Docsity

Solution Key for Assignment 1 - Computer Vision Systems | CAP 6411, Assignments of Computer Science

Toggle sidebar
bg1
Solution for Assignment #1
Khurram Hassan-Shafique
To prove statements of Q.2, I have first proved that a matrix Ais a rotation matrix if and only if it is orthonormal
and det A= 1 (There may be other ways to prove the same statements). The definitions and other properties
used in the proofs are given below:
Definition: An n×nmatrix Aover Ris said to be orthonormal iff AtA=I. Equivalently, A−1=At.
Lemma: The following are equivalent.
(i)Ais orthonormal.
(ii)Ax.Ay =x.y for all vectors xand y.
(iii) The columns of Aare mutually orthogonal unit vectors.
Proof. The equivalence of (i) and (iii) is trivial. To prove that (i) implies (ii), assume that Ais orthonormal then
Ax.Ay = (Ax)t(Ay)
=xtAtAy
=xtIy
=xty
=x.y
To prove that (ii) implies (i), assume that Ax.Ay =x.y for all xand y, then we have
ei.ej=ei.ej
⇒et
iej=Aei.Aej
⇒et
iIej=et
iAtAej
⇒et
iIej−et
iAtAej= 0
⇒et
i(I−AtA)ej= 0
⇒I−AtA= 0
⇒AtA=I
Therefore A is orthonormal.
Definition: Let SOnbe the set of all n×northonormal matrices Asuch that det A= 1.
Theorem: Ais a 2 dimensional rotation matrix if and only if A∈SO2.
Proof: =⇒Let Abe a 2-D rotation matrix, then
AtA="cos θ−sin θ
sin θcos θ#" cos θsin θ
−sin θcos θ#="cos2θ+ sin2θcos θsin θ−sin θcos θ
sin θcos θ−cos θsin θsin2θ+ cos2θ#="1 0
0 1 #=I
1
pf3
pf4

Partial preview of the text

Download Solution Key for Assignment 1 - Computer Vision Systems | CAP 6411 and more Assignments Computer Science in PDF only on Docsity!

Solution for Assignment

Khurram Hassan-Shafique

To prove statements of Q.2, I have first proved that a matrix A is a rotation matrix if and only if it is orthonormal and det A = 1 (There may be other ways to prove the same statements). The definitions and other properties used in the proofs are given below: Definition: An n × n matrix A over R is said to be orthonormal iff AtA = I. Equivalently, A−^1 = At. Lemma: The following are equivalent.

(i) A is orthonormal. (ii) Ax.Ay = x.y for all vectors x and y. (iii) The columns of A are mutually orthogonal unit vectors.

Proof. The equivalence of (i) and (iii) is trivial. To prove that (i) implies (ii), assume that A is orthonormal then

Ax.Ay = (Ax)t^ (Ay) = xtAtAy = xtIy = xty = x.y To prove that (ii) implies (i), assume that Ax.Ay = x.y for all x and y, then we have ei.ej = ei.ej ⇒ etiej = Aei.Aej ⇒ etiIej = etiAtAej ⇒ etiIej − etiAtAej = 0 ⇒ eti (I − AtA) ej = 0 ⇒ I − AtA = 0 ⇒ AtA = I Therefore A is orthonormal. Definition: Let SOn be the set of all n × n orthonormal matrices A such that det A = 1. Theorem: A is a 2 dimensional rotation matrix if and only if A ∈ SO 2. Proof: =⇒ Let A be a 2-D rotation matrix, then

AtA =

[

cos θ − sin θ sin θ cos θ

] [

cos θ sin θ − sin θ cos θ

]

[

cos^2 θ + sin^2 θ cos θ sin θ − sin θ cos θ sin θ cos θ − cos θ sin θ sin^2 θ + cos^2 θ

]

[

]

= I

Thus A is orthonormal. Now, det A =

cos θ sin θ − sin θ cos θ

∣ = cos

(^2) θ + sin (^2) θ = 1

Hence, A ∈ SO 2. ⇐= Let A ∈ SO 2 and write A = [v 1 v 2 ]. Let the vector v 1 makes an angle θ with canonical basis vector e 1. Let R be the rotation matrix through angle θ, then we have Re 1 = v 1. From necessity part of the proof, R ∈ SO 2 and thus is invertible and R−^1 ∈ SO 2. Since SO 2 is closed with respect to matrix multiplication, we have R−^1 A ∈ SO 2. Therefore, R−^1 Ae 1 = R−^1 v 1 = e 1. Since R−^1 A is orthonormal, R−^1 Ae 2 = e 2 or −e 2. But det R−^1 A = 1 ⇒ R−^1 Ae 2 = e 2. Therefore, R−^1 A = I and hence, A = R. Definition: A rotation in R^3 is a rigid motion fixing the origin and fix some vector v and acting like a 2-D rotation in the plane orthogonal to v. Lemma: If A ∈ SOn and n is odd then 1 is an eigen value of A. Proof: Recall that Λ is an eigen value of A iff det (A − ΛI) = 0. Now,

det (A − I) = det At^ det (A − I) Since det At^ = 1 = det At^ (A − I) = det (AtA − At) = det (I − At) = det (I − A)t = det (I − A) = det (− (A − I)) = (−1)n^ det (A − I) = − det (A − I) Since n is odd ⇒ det (A − I) = − det (A − I) ⇒ det (A − I) = 0

Theorem: A is a 3D rotation matrix if and only if A ∈ SO 3. Proof: =⇒ Let A be a 3D rotation matrix. Since A is a rigid motion, we have, ∀x, y,

|Ax − Ay| = |x − y| ⇒ (Ax − Ay). (Ax − Ay) = (x − y). (x − y) In particular, for y=0, we have Ax.Ax = x.x. Now, (Ax − Ay). (Ax − Ay) = (x − y). (x − y) ⇒ Ax.Ax − 2 Ax.Ay + Ay.Ay = x.x − 2 x.y + y.y ⇒ Ax.Ay = x.y So A preserves dot product and hence is an orthonormal matrix. Determinant of an orthonormal matrix is either 1 or -1. But since, rotation is orientation preserving, we have det A = 1. Thus A ∈ SO 3. ⇐= Let A ∈ SO 3 , then by above Lemma, we have that A has 1 as an eigen value. Hence, there exists a unit vector v 1 such that Av 1 = v 1. Consider an orthonormal basis {v 1 , v 2 , v 3 } of R^3 and let P = [v 1 v 2 v 3 ] such that

|Dp − Dq| = |(Rp + T ) − (Rq + T )| = |Rp + T − Rq − T | = |Rp − Rq| = (Rp − Rq). (Rp − Rq) = R (p − q) .R (p − q) = (p − q). (p − q) Since R is orthonormal = |p − q|

Hence, D preserves distances. To show that D preserves angles, let p, q, and r be three points in R^3. Then the angle 6 pqr is defined as

(^6) pqr = cos−^1

( (^) (q − p). (r − q) |q − p| |r − q|

Now, the cosine of the angle after rigid transformation 6 DpDqDr is given as

cos 6 DpDqDr =

( (^) (Dq−Dp).(Dr−Dq) |Dq−Dp||Dr−Dq|

( (^) (Rq+T −Rp−T ).(Rr+T −Rq−T ) |q−p||r−q|

Since |Dp − Dq| = |p − q|

( (^) (Rq−Rp).(Rr−Rq) |q−p||r−q|

( (^) R(q−p).R(r−q) |q−p||r−q|

( (^) (q−p).(r−q) |q−p||r−q|

Since R is orthonormal = cos 6 pqr

Hence, D preserves the angles.