projective geometry - università ca' foscari venezia
TRANSCRIPT
![Page 1: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/1.jpg)
Projective Geometry
![Page 2: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/2.jpg)
Image formation
Let’s design a camera– Idea 1: put a piece of film in front of an object– Do we get a reasonable image?
Slide source: Seitz
![Page 3: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/3.jpg)
Pinhole camera
Idea 2: add a barrier to block off most of the rays– This reduces blurring– The opening known as the aperture
Slide source: Seitz
![Page 4: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/4.jpg)
Pinhole camera
Figure from Forsyth
f
f = focal lengthc = center of the camera
c
![Page 5: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/5.jpg)
Projection can be tricky…Slide source: Seitz
![Page 6: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/6.jpg)
Projection can be tricky…Slide source: Seitz
Making of 3D sidewalk art: http://www.youtube.com/watch?v=3SNYtd0Ayt0
![Page 7: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/7.jpg)
Projective Geometry
What is lost?• Length
Which is closer?
Who is taller?
![Page 8: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/8.jpg)
Length is not preserved
Figure by David Forsyth
B’
C’
A’
![Page 9: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/9.jpg)
Projective Geometry
What is lost?• Length• Angles
Perpendicular?
Parallel?
![Page 10: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/10.jpg)
Projective Geometry
What is preserved?• Straight lines are still straight
![Page 11: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/11.jpg)
Vanishing points and linesParallel lines in the world intersect in the image at a “vanishing point”
![Page 12: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/12.jpg)
Vanishing points and lines
oVanishing Point oVanishing Point
Vanishing Line
• The projections of parallel 3D lines intersect at a vanishing point• The projection of parallel 3D planes intersect at a vanishing line• If a set of parallel 3D lines are also parallel to a particular plane, their
vanishing point will lie on the vanishing line of the plane• Not all lines that intersect are parallel• Vanishing point <-> 3D direction of a line• Vanishing line <-> 3D orientation of a surface
![Page 13: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/13.jpg)
Vanishing points and lines
Vanishing point
Vanishing line
Vanishing point
Vertical vanishing point
(at infinity)
Slide from Efros, Photo from Criminisi
![Page 14: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/14.jpg)
Vanishing points and lines
Photo from online Tate collection
![Page 15: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/15.jpg)
Note on estimating vanishing points
Use multiple lines for better accuracy… but lines will not intersect at exactly the same point in practice
One solution: take mean of intersecting pairs… bad idea!
Instead, minimize angular differences
![Page 16: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/16.jpg)
Vanishing objects
![Page 17: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/17.jpg)
Projection: world coordinates ↔ image coordinates
Camera Center (tx, ty, tz)
.
.
. f Z Y.Optical Center (u0, v0)
v
u
P=(u,v)T
P=(X,Y,Z)T
![Page 18: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/18.jpg)
Homogeneous coordinates
Conversion
Converting to homogeneous coordinates
homogeneous image coordinates
homogeneous scene coordinates
Converting from homogeneous coordinates
![Page 19: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/19.jpg)
Homogeneous coordinates
Invariant to scaling
Point in Cartesian is ray in Homogeneous
Homogeneous Coordinates
Cartesian Coordinates
![Page 20: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/20.jpg)
Basic geometry in homogeneous coordinates
• Line equation: ax + by + c = 0
• Append 1 to pixel coordinate to get homogeneous coordinate
• Line given by cross product of two points
• Intersection of two lines given by cross product of the lines
jiij ppline
jiij linelineq
![Page 21: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/21.jpg)
Another problem solved by homogeneous coordinates
Cartesian: (Inf, Inf)Homogeneous: (1, 1, 0)
Intersection of parallel linesCartesian: (Inf, Inf) Homogeneous: (1, 2, 0)
![Page 22: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/22.jpg)
Slide Credit: Saverese
Projection matrix
x: Image Coordinates: (u,v,1)K: Intrinsic Matrix (3x3)R: Rotation (3x3) t: Translation (3x1)X: World Coordinates: (X,Y,Z,1)
Ow
iw
kw
jwR,T
XtRKx
![Page 23: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/23.jpg)
K
Projection matrix
Intrinsic Assumptions• Unit aspect ratio• Optical center at (0,0)• No skew
Extrinsic Assumptions• No rotation• Camera at (0,0,0)
X0IKx
![Page 24: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/24.jpg)
Remove assumption: known optical center
Intrinsic Assumptions• Unit aspect ratio• No skew
Extrinsic Assumptions• No rotation• Camera at (0,0,0)
K
X0IKx
![Page 25: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/25.jpg)
Remove assumption: square pixels
Intrinsic Assumptions• No skew
Extrinsic Assumptions• No rotation• Camera at (0,0,0)
K
X0IKx
![Page 26: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/26.jpg)
Remove assumption: non-skewed pixels
Intrinsic Assumptions Extrinsic Assumptions• No rotation• Camera at (0,0,0)
Note: different books use different notation for parameters
K
X0IKx
![Page 27: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/27.jpg)
Oriented and Translated Camera
Ow
iw
kw
jw
t
R
![Page 28: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/28.jpg)
3D Rotation of Points
Rotation around the coordinate axes, counter-clockwise:
p
p’
y
z
Slide Credit: Saverese
100
0cossin
0sincos
)(
cos0sin
010
sin0cos
)(
cossin0
sincos0
001
)(
z
y
x
R
R
R
![Page 29: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/29.jpg)
Allow camera rotation
XtRKx
![Page 30: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/30.jpg)
Degrees of freedom
5 6
XtRKx
![Page 31: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/31.jpg)
Vanishing Point = Projection from Infinity
R
R
R
z
y
x
z
y
x
z
y
x
KpKRptRKp
0
R
R
R
z
y
x
vf
uf
v
u
w
100
0
0
10
0 0uz
fxu
R
R
0vz
fyv
R
R
![Page 32: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/32.jpg)
Orthographic Projection
• Special case of perspective projection– Distance from the COP to the image plane is infinite
– Also called “parallel projection”– What’s the projection matrix?
Image World
Slide by Steve Seitz
11000
0010
0001
1z
y
x
v
u
w
![Page 33: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/33.jpg)
Scaled Orthographic Projection
• Special case of perspective projection– Object dimensions are small compared to distance to
camera
– Also called “weak perspective”– What’s the projection matrix?
Image World
Slide by Steve Seitz
1000
000
000
1z
y
x
s
f
f
v
u
w
![Page 34: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/34.jpg)
Example
Near field: object appearance changes as objects translate
Far field: object appearance doesn’t change as objects translate
![Page 35: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/35.jpg)
Beyond Pinholes: Radial Distortion• Common in wide-angle lenses or for
special applications (e.g., security)• Creates non-linear terms in projection• Usually handled by through solving for
non-linear terms and then correcting image
Image from Martin Habbecke
Corrected Barrel Distortion
![Page 36: Projective Geometry - Università Ca' Foscari Venezia](https://reader031.vdocuments.net/reader031/viewer/2022012518/61926bd1a40f4d349e54970e/html5/thumbnails/36.jpg)
Things to remember
• Vanishing points and vanishing lines
• Pinhole camera model and camera projection matrix
• Homogeneous coordinates
Vanishing point
Vanishing
line
Vanishing point
Vertical vanishing point
(at infinity)
XtRKx