0% found this document useful (0 votes)
9 views40 pages

Lecture 6-2D ProjectiveGeometry-A Model For The Projective Plane

The document outlines a course on Computer Vision led by Dr. Syed Faisal Bukhari, detailing key textbooks and reference materials. It covers fundamental concepts in projective geometry, including the definitions of points, lines, and planes in both 2D and 3D spaces, as well as their implications in computer vision. The notes emphasize the significance of ideal points and the line at infinity in projective geometry, providing a mathematical framework for understanding image projection and geometry in computer vision applications.

Uploaded by

Eisha Ghazal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views40 pages

Lecture 6-2D ProjectiveGeometry-A Model For The Projective Plane

The document outlines a course on Computer Vision led by Dr. Syed Faisal Bukhari, detailing key textbooks and reference materials. It covers fundamental concepts in projective geometry, including the definitions of points, lines, and planes in both 2D and 3D spaces, as well as their implications in computer vision. The notes emphasize the significance of ideal points and the line at infinity in projective geometry, providing a mathematical framework for understanding image projection and geometry in computer vision applications.

Uploaded by

Eisha Ghazal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Computer Vision

Dr. Syed Faisal Bukhari


Associate Professor
Department of Data Science
Faculty of Computing and Information Technology
University of the Punjab
Textbook

Multiple View Geometry in Computer Vision,


Hartley, R., and Zisserman

Richard Szeliski, Computer Vision: Algorithms and


Applications, 1st edition, 2010

Dr. Faisal Bukhari, DDS, PU


Reference books
Readings for these lecture notes:
Hartley, R., and Zisserman, A. Multiple View
Geometry in Computer Vision, Cambridge
University Press, 2004, Chapters 1-3.

Forsyth, D., and Ponce, J. Computer Vision: A


Modern Approach, Prentice-Hall, 2003, Chapter 2.

These notes contain material c Hartley and


Zisserman (2004) and Forsyth and Ponce (2003).

Dr. Faisal Bukhari, DDS, PU


References
These notes are based on

Dr. Matthew N. Dailey's course: AT70.20: Machine Vision


for Robotics and HCI

Dr. Sohaib Ahmad Khan CS436 / CS5310 Computer Vision


Fundamentals at LUMS

Dr. Faisal Bukhari, DDS, PU


2D projective geometry
A model for the projective plane

Fig 2.1 A model of the projective plane. Points and lines of


ℙ2 are represented by rays and planes, respectively, through
the origin in ℝ3 . Lines lying in the x1 x2 -plane represent ideal
points, and the x1 x2 -plane represents Ԧl∞ or 𝐥∞ .
Dr. Faisal Bukhari, DDS, PU
oA ray has one endpoint, and it continues forever in one
direction e.g.,

oA line segment line has two endpoints and continues


forever in zero directions e.g.,

oA line has zero endpoints and continue forever in two


directions e.g.,

oA plane is defined by three non collinear points.

oThree or more points are said to be collinear if they lie on a


single straight line

oCoplanar points are points that all lie on the same plane.
Dr. Faisal Bukhari, DDS, PU
Recall: Intersection of Parallel Lines
Consider two parallel lines
Ԧl1 : (a, b, c)T

Ԧl2 : (a, b, c ′ )T
oComputing intersection (as before)
Ԧl1 × Ԧl2 = (c ′ - c)(b, −a, 0)T

oThus, point of intersection is (𝑏, −𝑎, 0)𝑇

oConverting to inhomogeneous coordinates: (b/0, −a/0)T

Hence Parallel lines intersect at ideal points


Dr. Faisal Bukhari, DDS, PU
Recall: Ideal Points lie on a line
oRecall that all parallel lines intersect at an ideal point or
point at infinity, of the form (x, y, 0)Τ
oConsider two such ideal points
𝐱 𝟏 = (x1 , y1 , 0)T
𝐱 𝟐 = (x2 , y2 , 0)T
The line joining them is given by:
l = 𝐱𝟏 × 𝐱𝟐
iƸ jƸ k෠
= x1 y1 0
x 2 y2 0
Rule of Sarrus
iƸ jƸ k෠ iƸ jƸ
x1 y1 0 x1 y1
x 2 y2 0 x 2 y2
Dr. Faisal Bukhari, DDS, PU
Ideal Points lie on a line
iƸ jƸ k෠ iƸ jƸ
x1 y1 0 x1 y1
x2 y2 0 x2 y2

= i(y
Ƹ 1 )(0) + j(0)(x
Ƹ ෠ ෠
2 ) + k(x1 )(y2 ) -k(x2 )(y1 ) - i(y
Ƹ 2 )(0) - j(0)(x
Ƹ 1)
= x1 y2 k෠ - x2 y1 k෠
= 0 iƸ + 0 jƸ + (x1 y2 - x2 y1 ) k෠ ∴ after scaling by 1/(x1 y2 - x2 y1 )
≡ 0 iƸ + 0 jƸ + k෠
= (0, 0, 1)T

Thus, all points at infinity lie on a single line, the line at


infinity
𝐥∞ = (𝟎, 𝟎, 𝟏)𝐓
Dr. Faisal Bukhari, DDS, PU
Line at Infinity
Any line l = (𝐚, 𝐛, c)𝐓 intersects 𝐥∞ = (𝟎, 𝟎, 𝟏)𝐓 at:
(𝐛, −𝐚, 𝟎)𝐓

Any line parallel to 𝐥𝟏 = (a, b, c)𝐓 , i.e. 𝐥𝟐 = (a, b, 𝐜 ′ )𝐓 will


intersects 𝐥∞ also at: (𝐛, −𝐚, 𝟎)𝐓

In inhomogeneous coordinates, (𝐛, −𝐚)𝐓 represents line


direction

Hence, as line direction varies, its intersection with 𝐥∞ varies.

Line at infinity is the set of directions for lines in a plane.


Dr. Faisal Bukhari, DDS, PU
Examples

Dr. Faisal Bukhari, DDS, PU


Dr. Faisal Bukhari, DDS, PU
Image credit: https://upload.wikimedia.org/wikipedia/commons/b/b4/CTA_loop_junction.jpg
Dr. Faisal Bukhari, DDS, PU
Dr. Faisal Bukhari, DDS, PU
Dr. Faisal Bukhari, DDS, PU
Dr. Faisal Bukhari, DDS, PU
Dr. Faisal Bukhari, DDS, PU
Dr. Faisal Bukhari, DDS, PU
Dr. Faisal Bukhari, DDS, PU
Dr. Faisal Bukhari, DDS, PU
What is a Plane in Geometry?
A plane in 3D space is defined by a linear equation of the
form:
𝒂𝒙 + 𝒃𝒚 + 𝒄𝒛 + 𝒅 = 𝟎

Or, rearranged:
𝒙𝟑 = constant
oThis form defines all the points in 3D space where one
coordinate is fixed and the others can vary freely.

Dr. Faisal Bukhari, DDS, PU


Why is 𝒙𝟑 = 1 a Plane?
In the 3D Cartesian coordinate system (or ℝ𝟑 ):
o𝑥1 , 𝑥2 , 𝑥3 (or 𝑋𝑌𝑍) represent the three spatial axes.

The equation 𝒙𝟑 = 1 means:


o All points where the third coordinate is exactly 1.
So, any point of the form (𝑥1 , 𝑥2 , 1)lies on this plane.

oEven though 𝒙𝟑 is fixed at 1, and 𝑥1 , 𝑥2 are free to vary.


oThat makes it a 2D surface (a plane) embedded in 3D space

Dr. Faisal Bukhari, DDS, PU


Visual Intuition of 𝒙𝟑 = 1 a Plane
oImagine a stack of paper sheets in 3D space:

oEach sheet is a plane.

oThe sheet at height 𝒙𝟑 = 1 is one such plane parallel to the


𝑥1 𝑥2 (or 𝑥𝑦) plane.

oThis is like saying “at height = 1, stretch out in x and y.”

Dr. Faisal Bukhari, DDS, PU


Dr. Faisal Bukhari, DDS, PU
Why is this Plane (𝒙𝟑 = 1) Useful in
Computer Vision?
In projective geometry:
oWe often work in homogeneous coordinates:
oA 3D point: (𝑥1 , 𝑥2 , 𝑥3 )
𝑥 𝑦
oA 2D point: (𝑥, 𝑦, 𝑤), w ≠0 which becomes ( , ) when
𝑤 𝑤
normalized.

oSetting 𝒙𝟑 = 1 makes math easier:


o It “flattens” 3D points onto a 2D image plane.

o It represents a reference plane where projection


happens.
Dr. Faisal Bukhari, DDS, PU
2D projective geometry
A model for the projective plane
oThe inhomogeneous point (𝒙𝟏 , 𝒙𝟐 ) is represent by any
𝒙𝟏 𝒙𝟑
vector 𝒙𝟐 𝒙𝟑 .
𝒙𝟑

oLines in ℙ𝟐 are planes in ℝ𝟑 intersecting the origin.

𝒂
oThe line 𝒃 or (𝐚, 𝐛, 𝐜)𝑻 in ℝ𝟑 is a vector orthogonal to the
𝒄
plane formed by the point on 𝒍 and the origin.

Dr. Faisal Bukhari, DDS, PU


Recall that a plane has a equation
𝒂𝒙 + 𝒃𝒚 + 𝒄𝒛 + 𝒅 = 𝟎

oWhen the plane passes through the origin, the constant


term d = 0, so the equation simplifies to:
𝒂𝒙 + 𝒃𝒚 + 𝒄𝒛 = 𝟎

oIt means that any point (𝒙, 𝒚, 𝒛) that lies on the plane
satisfies the equation (i.e., 𝒂𝒙 + 𝒃𝒚 + 𝒄𝒛 = 𝟎)

oIn vector notation, this condition can be written as:


𝑎 𝑥
𝑏 . 𝑦 =0
𝑐 𝑧
Dr. Faisal Bukhari, DDS, PU
2D projective geometry
A model for the projective plane

Fig 2.1 A model of the projective plane. Points and lines of


ℙ2 are represented by rays and planes, respectively, through
the origin in ℝ3 . Lines lying in the x1 x2 -plane represent ideal
points, and the x1 x2 -plane represents Ԧl∞ or 𝐥∞ .
Dr. Faisal Bukhari, DDS, PU
2D projective geometry
A model for the projective plane
oA fruitful way of thinking of ℙ2 is as a set of rays in ℝ3 . The
set of all vectors k (x1 , x2 , x3 )T as k varies forms a ray
through the origin.

o Each such ray is a single point in ℙ2 .


oIn this model, the lines in ℙ2 are planes passing through the
origin in ℝ3 .
oOne verifies that two non identical rays lie on exactly one
plane and any two planes intersect in one ray.
oThis is the analogue of two distinct points uniquely defining
a line, and two lines always intersecting in a point.
oPoints and lines may be obtained by intersecting this set of
rays and planes by the plane x3 = 1.
Dr. Faisal Bukhari, DDS, PU
Understanding Projective
Geometry: ℙ² and ℝ³
oA line connecting any two distinct points in projective space
(ℙ𝟐 ) corresponds to a plane through the origin in ℝ𝟑 .
oTo get the inhomogeneous coordinates of a point or a line,
we find where its corresponding ray or plane intersects the
plane 𝑥3 = 1.
oRemember:
oℙ2 is not just a flat 2D plane.
o It represents the set of all rays passing through the
origin in ℝ𝟑 .
oHowever, the origin itself is excluded from ℙ2 , because it
does not define a direction (i.e., no ray).
oOne way to visualize it through Fig 2.1 in the next slide
Dr. Faisal Bukhari, DDS, PU
2D projective geometry
A model for the projective plane

Fig 2.1 A model of the projective plane. Points and lines of


ℙ2 are represented by rays and planes, respectively, through
the origin in ℝ3 . Lines lying in the x1 x2 -plane represent ideal
points, and the x1 x2 -plane represents Ԧl∞ or 𝐥∞ .
Dr. Faisal Bukhari, DDS, PU
2D projective geometry
A model for the projective plane
oIn ℝ3 , lines through the origin that lie in the x1x2 plane
represent ideal points in ℙ2 .

oAll other lines through the origin represent points in ℙ2 .

oPlanes through the origin in ℝ3 represent lines in ℙ2 .

oThe vector (a, b, c)𝑻 representing a line in the Euclidean


plane ( ℝ𝟑 ), when interpreted as a vector in ℝ3 , is
orthogonal to the ℝ3 plane representing the line in ℙ2 .

oWe will prove it coming lecture.

Dr. Faisal Bukhari, DDS, PU


2D projective geometry
A model for the projective plane
oWe consider a coordinate system with axes 𝑥1 , 𝑥2 , 𝑥3 (often
called x,y,z). The direction along the 𝑥3 (or z-axis) is
particularly important for our discussion.

Note: 2D points are the points in the plane 𝒙𝟑 = 1.

oIt means if any homogenous vector that does not have its
3rd component equal to zero then we can divide it by the
third component.

oIf we look it as a 3D point, then it is actually a point in the


plane (𝝅) (𝐬𝐞𝐞 𝐅𝐢𝐠 2.1).

Note: If we normalize a homogeneous representation of a


point, then we will get a point in the Euclidean plane (𝝅).
Dr. Faisal Bukhari, DDS, PU
Special Case in Projective Geometry:
When the Third Component is Zero
oIf the third
𝑻
component of the vector (𝒄′ − c)(b, −a, 0)𝑻 =
(b, −a, 0) is zero, what does that imply?
oIt means 𝒙𝟑 = 0.

oWe still have a valid vector, because the first two


components 𝒙𝟏 𝒂𝒏𝒅 𝒙𝟐 may be non-zero.

oWhat This Means Geometrically:


oThe vector still passes through the origin, but it lies entirely
within the plane 𝒙𝟑 = 0, this is the 𝐱𝟏 𝐱𝟐 𝐩𝐥𝐚𝐧𝐞.

oNo matter how we scale this vector, it always remains in the


𝒙𝟑 = 0 plane, it never intersects the standard
inhomogeneous plane 𝒙𝟑 = 1.

Dr. Faisal Bukhari, DDS, PU


Special Case in Projective Geometry:
When the Third Component is Zero
oWhy These Rays Are Special:
oVectors (or rays) with 𝑥3 = 0 are not normalizable to the
standard plane 𝑥3 = 1.

oThat means:

oThey do not correspond to any finite inhomogeneous


point in ℝ3 . These points cannot be normalized to obtain
a corresponding point on the plane (𝝅).

oThese represent points at infinity in projective geometry


(ℙ𝟐 ).

Dr. Faisal Bukhari, DDS, PU


2D projective geometry
A model for the projective plane
oSignificance in a camera model:

oIn the pinhole camera model, the interpretation shown in


Fig 2.1 is essential because the plane π represents the
image sensor of the camera.

oOrigin (i.e., O) of Fig 2.1 is the center of the camera (or


optical center). The point where all projection rays
originate.

o ℝ3 going to be the 3D space where the camera is


embedded.

oUsing Fig 2.1, we aim to understand the structure and


behavior of the camera coordinate system — how it
captures the 3D world and projects it onto the image plane
Dr. Faisal Bukhari, DDS, PU
2D projective geometry
A model for the projective plane
What is a line in the plane? (Euclidean)
o Consider any line lying in the plane π (as shown in Fig
2.1).Now, take any two points on that line, and consider
the span of those points starting from the origin.
o What you get is a plane in ℝ³ — passing through both the
origin and the line on π.

o Key Insight:
o Any line in the plane x₃ = 1 corresponds to a plane
through the origin in ℝ³.
o This links lines in image space to planes in the 3D world,
a core idea in projective geometry and camera modeling.

Dr. Faisal Bukhari, DDS, PU


2D projective geometry
A model for the projective plane
Line in the plane? (Euclidean)
oHow we represent a plane in three-space? It is similar as we
represent a line in 2-space

oThe general equation of the plane is


𝒂𝒙 + 𝒃𝒚 + 𝒄𝒛 + 𝒅 = 0

oBut in our case, the distance from the origin is always equal
to zero i.e., 𝒂𝒙 + 𝒃𝒚 + 𝒄𝒛 = 0 for any plane through the
origin, so that three vectors (𝐚, 𝐛, 𝐜)𝐓 that represents the
plane is normal to the plane.

Dr. Faisal Bukhari, DDS, PU


Ԧ
The line at infinity 𝑙∞ = (𝟎, 𝟎, 𝟏)𝐓
“Any plane through the origin in the three-space is
represented geometrically by the normal vector to the
plane.”

o How can we interpret the equation of a line giving us the


vector which is orthogonal to the plane?

oThe line at infinity can be represented by the vector that is


normal to the line at infinity. The vector that is normal to
the line at infinity is

Ԧl∞ = (𝟎, 𝟎, 𝟏)𝐓

Dr. Faisal Bukhari, DDS, PU


The line at infinity 𝑙Ԧ∞ = (𝟎, 𝟎, 𝟏)𝐓
Ԧl∞ = (𝟎, 𝟎, 𝟏)𝐓
oSo, the vector that is normal to the line at infinity which is in
three-space is orthogonal to the plane representing the line
at infinity is exactly the vector x3 i. e. , (𝟎, 𝟎, 𝟏)𝐓 .

oIt is a vector in the direction of x3. So the plane that is


representing line at infinity is just 𝐱𝟏 𝐱𝟐 -plane and the
vector orthogonal to that plane is (𝟎, 𝟎, 𝟏)𝐓

oThe line at infinity is kind of a special line. The vector that


described it is orthogonal to the viewing plane (𝛑) or the
plane we are projecting to.
Dr. Faisal Bukhari, DDS, PU

You might also like