0% found this document useful (0 votes)
26 views56 pages

Lecture 3 Introduction 2D ProjectiveGeometry

The document outlines the course structure and content for a Computer Vision class taught by Dr. Syed Faisal Bukhari at the University of the Punjab. It includes references to textbooks, grading criteria, notable conferences and journals in the field, and key concepts such as field of view, lens types, and the pinhole camera model. Additionally, it covers mathematical representations of lines and transformations in 2D projective geometry.

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)
26 views56 pages

Lecture 3 Introduction 2D ProjectiveGeometry

The document outlines the course structure and content for a Computer Vision class taught by Dr. Syed Faisal Bukhari at the University of the Punjab. It includes references to textbooks, grading criteria, notable conferences and journals in the field, and key concepts such as field of view, lens types, and the pinhole camera model. Additionally, it covers mathematical representations of lines and transformations in 2D projective geometry.

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/ 56

Computer Vision

Dr. Syed Faisal Bukhari


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

Multiple View Geometry in Computer Vision,


Hartley, R., and Zisserman

Richard Szeliski, Computer Vision: Algorithms and


Applications, 2nd edition, 2022

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
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
https://www.photographytalk.com/beginner-photography-tips/7204-
focal-length-and-field-of-view-explained-in-4-steps
https://ipvm.com/reports/testing-wide-vs-telephoto-
fov#:~:text=Testing%20Wide%20vs%20Narrow%20FoV&text=The%20firs
t%2C%20the%20'wide',of%20the%20distant%20parking%20lot.
http://rimstar.org/science_electronics_projects/pinhole_camera.htm
https://www.lorextechnology.com/self-serve/guide-to-field-of-view-
lens-types/R-sc2900041

Dr. Faisal Bukhari, DDS, PU


Grading breakup
I. Midterm = 35 points
II. Final term = 40 points
III. Quizzes = 𝟔𝟔 𝐩𝐩𝐩𝐩𝐩𝐩𝐩𝐩𝐩𝐩𝐩𝐩 (A total of 6 quizzes)
IV. Group project = 15 points
a. Pitch your project idea = 2 points
b. Research paper presentation relevant to your
project = 3 points
c. Project prototype and its presentation = 5 points
d. Research paper in IEEE conference template = 5
points
V. OpenCV based on Python presentation = 2.5
points
VI. Matlab presentation = 2.5 points
Dr. Faisal Bukhari, DDS, PU
Some top tier conferences of
computer vision
I. Proceedings of the IEEE International Conference
on Computer Vision and Pattern Recognition
(CVPR).
II. Proceedings of the European Conference on
Computer Vision (ECCV).
III. Proceedings of the Asian Conference on
Computer Vision (ACCV).
IV. Proceedings of the International Conference on
Robotics and Automation (ICRA).
V. Proceedings of the IEEE/RSJ International
Conference on Intelligent Robots and Systems
(IROS).
Dr. Faisal Bukhari, DDS, PU
Some well known Journals
I. International Journal of Computer Vision (IJCV).
II. IEEE Transactions on Pattern Analysis and
Machine Intelligence (PAMI).
III. Image and Vision Computing.
IV. Pattern Recognition.
V. Computer Vision and Image Understanding.
VI. IEEE Transactions on Robotics.
VII. Journal of Mathematical Imaging and Vision

Dr. Faisal Bukhari, DDS, PU


Why do we like to use vectors or
column vectors in particular?
oA linear transformation between vector spaces is
represented using matrices, allowing us to express the
transformation between one vector space and another as
matrix multiplication.
Example:
⃗ A𝑥𝑥⃗
𝑥𝑥’=
oHere A is a matrix, and 𝑥𝑥⃗ is a 2D vector. If we are considering
a 2D transformation, then 𝑥𝑥’ ⃗ will also be a 2D vector.

oWe can have transformations between different vector


spaces with varying dimensions.

Dr. Faisal Bukhari, DDS, PU


How you know the size of 𝒙𝒙’?
⃗ 2×1 = 𝐴𝐴2×2 𝑥𝑥⃗2×1
⃗ A𝑥𝑥⃗ e.g., 𝑥𝑥’
𝑥𝑥’=
oIf A is 2 × 2, then we are transforming from 2D space to
another 2D space.
A: ℝ𝟐𝟐 ↦ ℝ𝟐𝟐

oThe number of columns of A must be equal to the number


of rows of 𝑥𝑥.

oThe number of rows in A must be equal to number of rows


in 𝑥𝑥’.

oWe will later discuss the types of transformations that can


be modeled by a 2× 𝟐𝟐 matrix as linear multiplications
between this matrix and a two-dimensional vector.
Dr. Faisal Bukhari, DDS, PU
2D projective geometry
The 2D projective plane: lines in ℝ𝟐𝟐
oA line in the plane is typically represented by an equation
such as
ax + by + c = 0.

oThe parameters a, b, and c determine different lines.

oThis means we can represent a line in ℝ𝟐𝟐 as the vector


(a, b, c)T .

Dr. Faisal Bukhari, DDS, PU


Lines in the plane
oSlope-y intercept form or slope intercept form:
y = mx + c
oWe interpret this equation as follows: x represents the x-
coordinate of a point, and y represents the y-coordinate.
Therefore, we have a 2D point, which defines a relationship
between x and y
oA line in a plane represents a linear relationship between x
and y
y = mx + c

Slope y-intercept
m is called the slope of a line and c is called the y-intercept.

Dr. Faisal Bukhari, DDS, PU


Slope of a line
For example
y = 3x + 2
𝟑𝟑
Here m = and c = 2
𝟏𝟏
How do we interpret the slope? It is the rise over the run. The
rise represents how far you move in the y-direction, while the
run represents how far you move in the x-direction.
y2 −y1 rise 3
m= = =
x2 −x1 run 1
c = 2 means that the line intercepts the y-axis at 2.

Dr. Faisal Bukhari, DDS, PU


Slope-Intercept Form: A Graphical
Illustration

Dr. Faisal Bukhari, DDS, PU


Slope-y intercept form

Dr. Faisal Bukhari, DDS, PU


What’s wrong with the slope-
intercept form of a line?
Vertical lines cannot be represented in slope-intercept
form because they have an infinite slope.

This means we have a rise of some amount divided by a run


of zero, resulting in an infinite slope.
For example
x=2
rise 2
m= = =∞
run 0

Dr. Faisal Bukhari, DDS, PU


Vertical lines cannot be represented in slope-
intercept form y = mx + c because they have an
undefined (infinite) slope

Dr. Faisal Bukhari, DDS, PU


Dr. Faisal Bukhari, DDS, PU
General equation of a line
ax + by + c = 0
where a, b, and c are arbitrary scalars. Now, we can
represent a vertical line using the general equation
of a line.
For example:
x=2
⇒ 1.x + 0.y - 2 = 0
a = 1, b = 0 and c = -2

So, ax + by + c = 0 can model any line in the plane.

Dr. Faisal Bukhari, DDS, PU


Parametric vector from of a line [1]
We can write parameters a, b, and c of a general equation of a
line
𝑎𝑎 in the vector form as
𝑏𝑏 or (𝐚𝐚, 𝐛𝐛, 𝐜𝐜)𝑻𝑻
𝑐𝑐
For example:
mx – y + b = 0
If we divide above equation by m, then we still have the same
line.
x – (1/m) y + b/m = 0
a = 1, b = -1/m, and c = b/m
Where a, b, and c are valid scalars.
𝒂𝒂 𝟏𝟏
𝒃𝒃 = −𝟏𝟏/𝒎𝒎
𝒄𝒄 𝒃𝒃/𝒎𝒎
Dr. Faisal Bukhari, DDS, PU
Parametric vector from of a line [2]
y = 2x + 3

We can represent the slope-intercept form using the


parametric vector form
2x – y + 3 = 0
a = 2, b = -1, and c = 3

𝒂𝒂 𝟐𝟐
𝒃𝒃 = −𝟏𝟏 or (𝐚𝐚, 𝐛𝐛, 𝐜𝐜)𝑻𝑻 = (𝟐𝟐, −𝟏𝟏, 𝟑𝟑)𝑻𝑻
𝒄𝒄 𝟑𝟑

Dr. Faisal Bukhari, DDS, PU


What is Field of View (FOV)?
The field of view of a security camera, also called
the viewing angle, is the area that the camera can see.

On a specification sheet, you will see the field of view


measured in degrees.

Think of the field of view as the angle between the two


horizontal edges of the camera image.

Dr. Faisal Bukhari, DDS, PU


What is Field of View (FOV)?

The 60° field of view captures some The 90° field of view captures all of
of the objects but in greater detailDr. Faisal Bukhari,
theDDS,objects
PU but in lesser detail
What is Field of View (FOV)?
As you can see in the example images in the previous slides,
the camera with 90° field of view captures all 3 objects in
the scene, though each object takes up a small part of the
camera image.

The camera with 60° field of view captures some of the


objects but in greater detail.

Remember, a wider field of view isn't always better!

Dr. Faisal Bukhari, DDS, PU


Wide-angle Lens

Dr. Faisal Bukhari, DDS, PU


Wide-angle lenses
Smaller lenses are known as wide-angle lenses, which
produce a greater field of view than cameras with a larger
lens. They capture a large area, though objects will appear
smaller within the camera image. Wide-angle lenses are
designed for monitoring large areas, such as:

Foyers Warehouses Back or Front Yards Parking Lots


Dr. Faisal Bukhari, DDS, PU
Narrow-angle Lens

Dr. Faisal Bukhari, DDS, PU


Narrow-angle Lens
Larger lenses, or narrow-angle lenses, have a smaller field
of view. They capture a limited area, but objects will appear
larger and more detailed within the camera image. Narrow-
angle lenses are designed for monitoring a specific target,
such as:

Cash Registers Doorways and Hallways Objects of Value


Entrances
Dr. Faisal Bukhari, DDS, PU
How is lens size related to field of view?
The size of the camera lens, or focal length, is the main
factor that determines the field of view.

The example images shown in the next slides compare


multiple focal lengths and the resulting fields of view:

Dr. Faisal Bukhari, DDS, PU


How is lens size related to field of view?

Dr. Faisal Bukhari, DDS, PU


Lens Field of View
oJust as our eyes serve as windows to the outer world, lenses
are the eyes of a camera, allowing it to capture what we
see.

oSimilarly, just as each person has different eyes with varying


capabilities, lenses also differ in their characteristics.
This means that what one person perceives might not
appear the same to another—the same principle applies to
camera lenses.

oSome lenses have a short focal length, providing a wide


angle of view, while others have a long focal length,
resulting in a narrow angle of view.
Dr. Faisal Bukhari, DDS, PU
Key Points on Field of View
1. Focal Length vs. Field of View:
oFocal length determines how long a lens is.
oField of view (FoV) defines how much of the scene a lens
captures.

2. Understanding Field of View:


o FoV tells us how much of a scene is visible through a lens.
o More useful than focal length alone.

Dr. Faisal Bukhari, DDS, PU


Key Points on Field of View
3. Factors Affecting Field of View:
FoV changes based on:
oFocal length of the lens (shorter = wider, longer = narrower).
oSize of the camera sensor (larger sensor = wider FoV).

4. Challenges in Measuring Field of View:


oFoV varies with sensor size.
oManufacturers often specify lenses by focal length rather
than FoV.

Dr. Faisal Bukhari, DDS, PU


Dr. Faisal Bukhari, DDS, PU
Pinhole model
The classical model of camera is called a pinhole model.

Resulting image
Pinhole

Imaging surface

Box

Dr. Faisal Bukhari, DDS, PU


Pinhole model

Dr. Faisal Bukhari, DDS, PU


Pinhole model
oIn the pinhole model of a camera, what happens?

oWe have an infinite set of small points emitting light into a


box.

oPoints in a scene reflect light.

oSome of these light rays pass through the pinhole in the box

oThe image of the scene is then reconstructed on the back of


the box.

Dr. Faisal Bukhari, DDS, PU


How to build a pinhole camera?
oSimply take a box, poke a small hole in it, and point it in any
direction. If you could open the box and look inside, you
would see an image of the scene projected onto the back of
the box.

oHowever, opening the box lets in too much light, which can
ruin the image. This is how a pinhole camera works.

oIn a pinhole camera, the image is inverted.

Dr. Faisal Bukhari, DDS, PU


How to build a pinhole camera?
(cont.)
oLight reflected from the top of a person's head passes
through the pinhole and appears lower on the back of the
box.

oSimilarly, light reflecting from the person's foot passes


through the pinhole and appears higher on the back of the
box.

oAs a result, the image of the scene appears upside down on


the back of the box.

Dr. Faisal Bukhari, DDS, PU


Camera model
oA modern camera consists of a lens and an imaging surface.
oWhen we examine a camera, we see a lens on the front, and
inside, there is an image surface where the scene is captured.
oIf there is a scene, the camera's role is to project the scene
onto the image surface to form an image
Scene
Lens

Imaging surface

Dr. Faisal Bukhari, DDS, PU


Resemblance Between a Pinhole
and a Modern Camera [1]
oThe pinhole camera serves as the fundamental model, and
modern cameras are designed to emulate its principles. But
why?

oSince this principle applies to real cameras, they share


similarities with the pinhole model.

oHowever, modern cameras use a lens to focus light onto a


specific point, improving image clarity and brightness.

Dr. Faisal Bukhari, DDS, PU


Resemblance Between a Pinhole and a
Modern Camera [2]
• How Light is Processed in a Camera

oThe lens collects light and focuses it on a focal point.

oThe light is then spread out and captured by a sensor array


or an imaging surface.

Dr. Faisal Bukhari, DDS, PU


Resemblance Between a Pinhole and a
Modern Camera [3]
• Camera Sensors

oThe imaging surface could be a CCD (Charge-Coupled


Device) or a CMOS (Complementary Metal-Oxide-
Semiconductor) sensor.

oA variety of semiconductor technologies are used to


construct these cameras.

Dr. Faisal Bukhari, DDS, PU


Resemblance in a pinhole and a modern
camera [4]
• How Light is Captured in a Camera

oThe lens collects light and focuses it on a focal point.

oThis light is then captured by the sensor array, which is


structured as a 2D grid of picture elements (pixels).

• Similarity to the Pinhole Model

oThe pinhole model closely resembles how modern cameras


function today.

Note: "Lens" is singular. "Lenses" is plural. "Lense" does not


exist as an accepted word in English
Dr. Faisal Bukhari, DDS, PU
Why do we use lens instead of pinhole?
[1]
oIf the pinhole is not an infinitesimally small point, some
scattering of light may occur as it passes through the hole.

oThe smaller the hole, the less light that passes through,
resulting in a dimmer image.

Dr. Faisal Bukhari, DDS, PU


Why do we use lens instead of
pinhole? [2]
• The main role of a lens in computer vision or optics is to:
• Collect more light
• Focus light more accurately on a particular point
• Produce sharper images with better contrast

• Thus, achieving high contrast is a key advantage of using a


lens over a pinhole.

Dr. Faisal Bukhari, DDS, PU


Why do we use lens instead of pinhole? [3]

In fact, from a machine vision point of view, we're going to


see that the pinhole model is mathematically attractive.
However, building a perfect pinhole camera is physically
impossible.

Dr. Faisal Bukhari, DDS, PU


Limitations of the Pinhole Model
and the Use of Lenses [1]
• Why do we use cameras with lenses?
oWe aim to use high-quality lenses to improve image
capture.
oWhen the field of view is narrow, the resulting image is
mathematically similar to what we get from a pinhole
camera.

• Challenges with a Wide Field of View:


oIf the field of view is very wide, it becomes difficult to
construct a proper pinhole image.
oDistortions may occur, which need corrections in real-
world imaging.

Dr. Faisal Bukhari, DDS, PU


Limitations of the Pinhole Model
and the Use of Lenses [2]
• Limitations of the Pinhole Model:

oThe pinhole model does not perfectly represent how


cameras function in the real world.

oHowever, it serves as a valuable mathematical tool for


understanding imaging principles

Dr. Faisal Bukhari, DDS, PU


2D projective geometry

We talk out about 2D projective geometry, which is


essentially the mathematics of this projections, i.e., the
projections of world scene onto a 2D surface.

The projective geometry is beneficial for the analysis of the


images, as we see in the following lectures.

Dr. Faisal Bukhari, DDS, PU


Recall: Parametric vector from of a line
[1]
We can write parameters a, b, and c of a general equation of
a line in the vector form as
𝑎𝑎
𝑏𝑏
𝑐𝑐
For example:
2x – 3y + 5 = 0
If we divide above equation by 2, then we still have the same
line.
x – (3/2) y + 5/2 = 0
a = 1, b = -3/2, and c = 5/2
These (a, b, and c) are perfectly legitimate scalars.
𝒂𝒂 𝟏𝟏
𝒃𝒃 = −𝟑𝟑/𝟐𝟐
𝒄𝒄 𝟓𝟓/𝟐𝟐
Dr. Faisal Bukhari, DDS, PU
Recall: Parametric vector from of a
line [2]
y = -8x + 5

We can represent a slope intercept form in a parametric


vector form
8x – y + 5 = 0

a = 8, b = -1, and c = 5

𝑎𝑎 8
𝑏𝑏 = −1
𝑐𝑐 5
Dr. Faisal Bukhari, DDS, PU
Homogeneous Representation of a
Line in 2D
How do we derive the vector form from the coefficient form?
1. ax + by + c = 0

𝑎𝑎 𝑥𝑥
2. 𝑏𝑏 . 𝑦𝑦 = 0 or (x, y, 1) (a, b, c)T = 0
𝑐𝑐 1

Recall: Dot product is the sum of the product of each element.

In projective geometry, we can express a line equation using the


𝑎𝑎
dot product of the coefficient vector 𝑏𝑏 with this very special
𝑥𝑥 𝑐𝑐
vector, 𝑦𝑦 representing a point in homogeneous coordinates
1 Dr. Faisal Bukhari, DDS, PU
Homogeneous Representation of a
Line in 2D
How do we derive the vector form from the coefficient form?
Mathematically, this can be written as:
(x, y, 1) (a, b, c)T = 0

or equivalently, using matrix notation:


𝑥𝑥
𝑎𝑎 𝑏𝑏 𝑐𝑐 1×3 𝑦𝑦 =0
1 3×1
⇒ ax + by + c = 0
This equation represents a homogeneous line equation, a key
concept in projective geometry and computer vision.
Note: These are two different ways of saying the same thing.
Dr. Faisal Bukhari, DDS, PU
Homogeneous Objects in Mathematics
If we take the coefficient form of the equation of a line (ax +
by + c = 0):

𝑎𝑎
𝑏𝑏
𝑐𝑐
and multiply it by any scalar k, we still have the same line:

𝑘𝑘𝑘𝑘
𝑘𝑘𝑘𝑘
𝑘𝑘𝑘𝑘

𝑘𝑘𝑘𝑘 𝑥𝑥
𝑘𝑘𝑘𝑘 . 𝑦𝑦 = 0 remains unchanged, demonstrating that it is a
𝑘𝑘𝑘𝑘 1
homogeneous object. Dr. Faisal Bukhari, DDS, PU
Definition of Homogeneous Objects:
oHomogeneous objects are mathematical entities that are
determined only up to scale. This means that scaling them
by a nonzero factor does not change their fundamental
nature.

oIn this case, the vector (𝐚𝐚, 𝐛𝐛, 𝐜𝐜)𝑻𝑻 represents the same line as
k(𝐚𝐚, 𝐛𝐛, 𝐜𝐜)𝑻𝑻 for any nonzero constant k.

Dr. Faisal Bukhari, DDS, PU


What are Homogeneous Coordinates?
oIn projective geometry, we extend 2D coordinates to 3D for
easier transformations.

o A point (x, y) in Cartesian coordinates is represented as (x,


y, 1) in homogeneous coordinates.

oThis allows for uniform representation of transformations


like scaling and translation.

Dr. Faisal Bukhari, DDS, PU

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy