Lecture 8 Introduction 2D ProjectiveGeometry
Lecture 8 Introduction 2D ProjectiveGeometry
Reference
Image
Image by Sergey Semenov (http://www.sergesemenov.com/) - Winner of Epson International Photographic Pano Award 2013
Dr. Faisal Bukhari, DDS, PU
http://www.dailymail.co.uk/sciencetech/article-2260276/New-York-youve-seen-Incredible-interactive-panorama-lets-zoom.html
Applications of 2D
Panoramas Image Registration
Multiple Images Stitched Together
Image by Sergey Semenov (http://www.sergesemenov.com/) - Winner of Epson International Photographic Pano Award 2013
Dr. Faisal Bukhari, DDS, PU
http://www.dailymail.co.uk/sciencetech/article-2260276/New-York-youve-seen-Incredible-interactive-panorama-lets-zoom.html
Applications of 2D
Image Registration
Spherical 360o Imaging
𝑎1 𝑎2 𝑥 𝑎1 𝑥 + 𝑎2 𝑦 𝑥′
𝑎3 𝑎4 𝑦 = 𝑎 𝑥+𝑎 𝑦 = ′
2×2 2×1 3 4 2×1 𝑦 2×1
0.5 0
0 0.5
(a,0) (a,a)
(a,0) (a,a)
Original Transformed
0.5 0 0 0 0.5 0 0 0
= =
0 0.5 0 0 0 0.5 𝑎 0.5𝑎
𝑠𝑥 0
0 𝑠𝑦
1 1 1 1 1 1 1 2
= =
0 1 0 0 0 1 1 1
(0,0) (0,1)
(0,0) (0,1)
(1,0) (1,1)
(1,0) (1,1)
Original
Transformed
1 𝑒 𝑥 𝑥 + 𝑒𝑦
𝑦 = 𝑦
0 1
1 1 1 1+1×1 2
= =
0 1 1 1 1
1 0 𝑥 𝑥
=
𝑒 1 𝑦 𝑒𝑥 + 𝑦
(x1 y1)
R
x2 x1 cos y1 sin
(x1 y1)
y2 x1 sin y1 cos
R
y1 R sin
x2 cos sin x1
x y sin
cos y1
2
x1 R cos
R
R is rotation by counterclockwise about origin
Dr. Faisal Bukhari, DDS, PU
Alternative Method for Derivation
Example Let T: ℝ𝟐 → ℝ𝟐 be the transformation that
rotates each point in ℝ𝟐 about the origin through an
angle 𝝋 with counterclockwise rotation for a
positive angle.
𝑷𝒆𝒓𝒑𝒆𝒏𝒊𝒅𝒖𝒍𝒂𝒓
𝒔𝒊𝒏𝝋 =
𝑯𝒚𝒑𝒐𝒕𝒆𝒏𝒐𝒖𝒔
x = r 𝒄𝒐𝒔𝝋 -----------(1)
y = r 𝒔𝒊𝒏𝝋 ------------(2)
Squaring (1) and (2) and then
adding, we get
r = 𝒙𝟐 +𝒚𝟐
𝒙′ = r 𝒄𝒐𝒔(𝝋 + 𝜽) -------(3)
∵ 𝒄𝒐𝒔(𝝋 + 𝜽) = cos𝝋cos 𝜽 − sin𝝋𝐬𝐢𝐧 𝜽
Substitute the value of cos(𝜑 + 𝜃) in (3), we get
𝒙′ = r cos𝝋cos 𝜽 - r sin𝝋𝒔𝒊𝒏 𝜽 -----(4)
𝒚′ = r 𝒔𝒊𝒏 𝝋 + 𝜽 -------(5)
Dr. Faisal Bukhari, DDS, PU
∵ 𝒔𝒊𝒏 𝑨 + 𝑩 = sinAcos B − cos𝐀𝐬𝐢𝐧 B
Substitute the value of sin(𝜑 + 𝜃) in (5), we get
𝒚′ = r s𝐢𝐧𝝋cos 𝜽 + r c𝐨𝒔𝝋𝐬𝐢𝐧 𝜽 ------(6)
Substitute the values of x and y from (1) and (2) in
(4), we get
𝒙′ = xcos𝜽 - y𝐬𝐢𝐧 𝜽 ---------------------(7)
Substitute the values of x and y from (1) and (2) in
(6), we get
𝒚′ = ycos 𝜽 + x𝐬𝐢𝐧 𝜽
𝒚′ = x𝐬𝐢𝐧 𝜽 + ycos𝜽 -------------------(8)
Using (7) and (8), we get
𝒙′ 𝒄𝒐𝒔𝜽 −𝒔𝒊𝒏𝜽 𝒙
′ =
𝒚 𝒔𝒊𝒏𝜽 𝒄𝒐𝒔𝜽 𝒚
Dr. Faisal Bukhari, DDS, PU
Rotation
𝒄𝒐𝒔𝜽 −𝒔𝒊𝒏𝜽
oR(𝜽) =
𝒔𝒊𝒏𝜽 𝒄𝒐𝒔𝜽
Transpose of R(𝜽) is
𝒄𝒐𝒔𝜽 𝒔𝒊𝒏𝜽
R(𝜽)−1 =
−𝒔𝒊𝒏𝜽 𝒄𝒐𝒔𝜽
1 𝒄𝒐𝒔𝜽 𝒔𝒊𝒏𝜽
=
1 −𝒔𝒊𝒏𝜽 𝒄𝒐𝒔𝜽
𝒄𝒐𝒔𝜽 𝒔𝒊𝒏𝜽
R(𝜽)−1 =
−𝒔𝒊𝒏𝜽 𝒄𝒐𝒔𝜽
Dr. Faisal Bukhari, DDS, PU
Identifying Rotation and Reflection
Matrices
−1 0
= (-1)(-1) – 0 =1
0 −1
It is a rotation matrix
1 0
= -1
0 −1
It is a reflection matrix.
−1 0
= -1
0 1
It is a reflection matrix.
𝑎 𝑏 𝑥 𝑎𝑥 + 𝑏𝑦
𝑦 =
𝑐 𝑑 𝑐𝑥 + 𝑑𝑦
𝑎 𝑏 𝑐 𝑥 𝑎𝑥 + 𝑏𝑦 + 𝑐
𝑑 𝑒 𝑓 𝑦 = 𝑑𝑥 + 𝑒𝑦 + 𝑓
0 0 1 1 1
𝐈𝟐×𝟐 𝐭
o𝒙′ = 𝒙
𝟎𝑻 1
Dr. Faisal Bukhari, DDS, PU
Basic 2D Transformations
cosθ −sinθ 0 Sx 0 0
sinθ cosθ 0 0 Sy 0
0 0 1 0 0 1
1 0 tx 1 ex 0 1 0 0
0 1 ty 0 1 0 ey 1 0
0 0 1 0 0 1 0 0 1
Scaled Rotated
Original
Rotated Scaled
Original
Dr. Faisal Bukhari, DDS, PU
Order of Transformations
Example 2: Scaling of x coordinates by 0.5
Sx 0 0 0.5 0 0
0 Sy 0= 0 1 0
0 0 1 0 0 1
Scaled Rotated
Original
Rotated Scaled
Original
Dr. Faisal Bukhari, DDS, PU