Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
Computer Vision I -Geometry of Two Cameras
Carsten Rother
Computer Vision I: Image Formation Process
22/12/2014
Roadmap for next five lecture• Appearance based matching (sec. 4.1)
• How do we get an RGB image? (sec 2.2-2.3)• The Human eye• The Camera and Image formation model
• Projective Geometry - Basics (sec. 2.1.1-2.1.4)
• Geometry of a single camera (sec 2.1.5, 2.1.6)• Pinhole camera• Lens effects
• Geometry of two cameras (sec. 7.2)
• Robust Geometry estimation for two cameras (sec. 6.1.4)
• Multi-View 3D reconstruction (sec. 7.3-7.4)
22/12/2014 2Computer Vision I: Image Formation Process
Camera intrinsic parameters - Summary
• Intrinsic parameters
• Principal point coordinates (𝑝𝑥, 𝑝𝑦)
• Focal length 𝑓
• Pixel y-direction magnification factors 𝑚
• Skew (non-rectangular pixels) 𝑠
22/12/2014Computer Vision I: Image Formation Process 3
𝑥𝑦1
= 𝑓 𝑠 𝑝𝑥0 𝑚𝑓 𝑝𝑦0 0 1
𝑋𝑌𝑍
calibration matrix 𝑲
The Mapping: 𝒙 = 𝑲 𝑿 (here 𝑿 means inhomogeneous coordinates)~ ~
Image 3D world point
𝑓
Putting the camera into the world
22/12/2014Computer Vision I: Image Formation Process 4
Given a 3D homogenous point 𝑿𝒘in world coordinate system
1) Translate from world to camera coordinate system:𝑿𝒄′ = 𝑿𝒘 − 𝑪𝑿𝒄′ = (𝑰𝟑×𝟑 | − 𝑪) 𝑿𝒘 where 𝑰𝟑×𝟑 is 3x3 identity matrix
2) Rotate world coordinate system into camera coordinate system𝑿𝒄 = 𝑹 (𝑰𝟑×𝟑 | − 𝑪) 𝑿𝒘
3) Apply camera matrix𝒙 = 𝑲 𝑹 (𝑰𝟑×𝟑 | − 𝑪) 𝑿
World coordinate system
camera coordinate system
~
~
~~
~
~
~~
𝑿𝒘
𝟑 × 𝟒 matrix
Camera matrix
• Camera matrix 𝑷 is defined as:
𝒙 = 𝑲 𝑹 (𝑰𝟑×𝟑 | − 𝑪) 𝑿
• In short we write: 𝒙 = 𝑷 𝑿
• The camera center is the (right) nullspace of 𝑷
𝑷 𝑪 = 𝑲𝑹 (𝑪 − 𝑪) = 0
22/12/2014Computer Vision I: Image Formation Process 5
~
𝑷 𝟑 × 𝟒 camera matrix has 11 DoF
~~
Comment: The right nullspace is the vector 𝑿 that satisfies: 𝟎 = 𝑷 𝑿
Camera parameters - Summary
• Camera matrix P has 11 DoF
• Intrinsic parameters
• Principal point coordinates (𝑝𝑥, 𝑝𝑦)
• Focal length 𝑓
• Pixel y-direction magnification factors 𝑚
• Skew (non-rectangular pixels) 𝑠
• Extrinsic parameters
• Rotation 𝑹 (3DoF) and translation 𝐂 (3DoF) relative to world coordinate system
22/12/2014Computer Vision I: Image Formation Process 6
𝒙 = 𝑲 𝑹 (𝑰𝟑×𝟑 | − 𝑪) 𝑿~
~
𝑲 =𝑓 𝑠 𝑝𝑥0 𝑚𝑓 𝑝𝑦0 0 1
𝒙 = 𝑷 𝑿
Orthographic Projection
• Distance from center of projection to image plane is infinite(infinite focal length)
• Also called “parallel projection”
• Most simple from of projection
22/12/2014Computer Vision I: Image Formation Process 7
𝑥𝑦1
= 1 0 0 00 1 0 00 0 0 1
𝑋𝑌𝑍1
(very large focal length)
(normal focal length)
Affine cameras• Most general camera that does parallel projection is:
• Parallel lines map to parallel lines (since points at infinity stay)
• Affine cameras simplify 3D reconstruction task, hence good to get an approximate solution
• See more details in: HZ (Hartley, Zissermann) chapter 6.3
22/12/2014Computer Vision I: Image Formation Process 8
𝑥𝑦1
= 𝑎 𝑏 𝑐 𝑑𝑒 𝑓 𝑔 ℎ0 0 0 1
𝑋𝑌𝑍𝑤
𝑥𝑦0
= 𝑎 𝑏 𝑐 𝑑𝑒 𝑓 𝑔 ℎ0 0 0 1
𝑋𝑌𝑍0
Roadmap for next five lecture• Appearance based matching (sec. 4.1)
• How do we get an RGB image? (sec 2.2-2.3)• The Human eye• The Camera and Image formation model
• Projective Geometry - Basics (sec. 2.1.1-2.1.4)
• Geometry of a single camera (sec 2.1.5, 2.1.6)• Pinhole camera• Lens effects
• Geometry of two cameras (sec. 7.2)
• Robust Geometry estimation for two cameras (sec. 6.1.4)
• Multi-View 3D reconstruction (sec. 7.3-7.4)
22/12/2014 9Computer Vision I: Image Formation Process
Home-made pinhole camera
22/12/2014Computer Vision I: Image Formation Process 10
http://www.debevec.org/Pinhole/
Why so blurry?
Shrinking the aperture
22/12/2014Computer Vision I: Image Formation Process 11
Why not make the aperture as small as possible?• Less light gets through• Diffraction effects…
Shrinking the aperture
22/12/2014Computer Vision I: Image Formation Process 12
Diffraction effects. Noise due to long exposure
Adding a lens
• A lens focuses light onto the film
• Lets enough ligh through
• Rays passing through the center are not deviated
22/12/2014Computer Vision I: Image Formation Process 13
In Focus
22/12/2014Computer Vision I: Image Formation Process 14
• There is a specific distance at which objects are “in focus”
• other points project to a “circle of confusion” in the image
• By moving the distance between film and lens we control
what is in focus (this distance is related to the focal length)
Depth of Field
22/12/2014Computer Vision I: Image Formation Process 15
Focal point in real camera
• All parallel rays converge to one point on a plane located at the focal length f
22/12/2014Computer Vision I: Image Formation Process 16
Control the depth of field
Changing the aperture size affects depth of field
• A smaller aperture increases the range in which the object is approximately in focus (but longer exposure needed)
22/12/2014Computer Vision I: Image Formation Process 17
Field of View
22/12/2014Computer Vision I: Image Formation Process 18
Field of View / Focal Length
22/12/2014Computer Vision I: Image Formation Process 19
Close to affine camera (look at front light)
Same effect for faces
22/12/2014Computer Vision I: Image Formation Process 20
Small 𝑓 Large 𝑓
Lens Flaws: Chromatic Aberration
22/12/2014Computer Vision I: Image Formation Process 21
High quality lens (top)
low quality lens (bottom)blur + green edges
Purple fringing
Lens has different refractive indices for differentwavelengths: causes color fringing
Lens flaws: Vignetting
22/12/2014Computer Vision I: Image Formation Process 22
Lens distortion
• Caused by imperfect lenses
• Deviations are most noticeable for rays that pass through the edge of the lens
22/12/2014Computer Vision I: Image Formation Process 23
Roadmap for next five lecture• Appearance based matching (sec. 4.1)
• How do we get an RGB image? (sec 2.2-2.3)• The Human eye• The Camera and Image formation model
• Projective Geometry - Basics (sec. 2.1.1-2.1.4)
• Geometry of a single camera (sec 2.1.5, 2.1.6)• Pinhole camera• Lens effects
• Geometry of two cameras (sec. 7.2)
• Robust Geometry estimation for two cameras (sec. 6.1.4)
• Multi-View 3D reconstruction (sec. 7.3-7.4)
22/12/2014 24Computer Vision I: Image Formation Process
The up-coming Tasks• Two-view transformations we look at:
• Homography 𝐻: between two views• Camera matrix 𝑃 (mapping from 3D to 2D)• Fundamental matrix 𝐹 between two un-calibrated views• Essential matrix 𝐸 between two calibrated views
• Derive geometrically: 𝐻, 𝑃, 𝐹, 𝐸, i.e. what do they mean?
• Calibration: Take primitives (points, lines, planes, cones,…) to compute 𝐻, 𝑃, 𝐹, 𝐸 :
• What is the minimal number of points to compute them (very important for next lecture on robust methods)
• If we have many points with noise: what is the best way to computer them: algebraic error versus geometric error?
• Can we derive the intrinsic (𝐾) an extrinsic (𝑅, 𝐶) parameters from 𝐻, 𝑃, 𝐹, 𝐸?
• What can we do with 𝐻, 𝑃, 𝐹, 𝐸? (e.g. Panoramic Stitching)
22/12/2014Computer Vision I: Two-View Geometry 25
Singular Value Decomposition (SVD)
• Reminder: separable filters
22/12/2014Computer Vision I: Two-View Geometry 26
Apply SVD to the kernel matrix:
If all 𝜎𝑖 are 0 (apart from 𝜎0) then it is separable.
Note:ℎ𝑥 ∗ ℎ𝑦
ℎ𝑥ℎ𝑥ℎ𝑦
ℎ𝑦
[page 585ff in Hartley Zisserman]
p-1
Properties of SVD
22/12/2014Computer Vision I: Two-View Geometry 27
• In short: 𝐴 = 𝑈𝐷𝑉𝑇
• If 𝐴 = 𝑚 × 𝑛 with 𝑚 ≥ 𝑛 then 𝑈 = 𝑚 × 𝑛 , D = n × 𝑛, 𝑉 = 𝑛 × 𝑛
• If 𝐴 = 𝑚 × 𝑛 with 𝑚 < 𝑛 then add zero-valued rows to A to make it 𝑛 × 𝑛
• 𝑈 and 𝑉 form an orthogonal basis: 𝑈𝑇𝑈 = 𝑉𝑇𝑉 = 𝑈𝑈𝑇 = 𝑉𝑉𝑇 = 𝐼𝑛×𝑛
• It is: 𝑈𝑥 = 𝑉𝑇𝑥 = 𝑥 (an example U is a rotation matrix)
• Implementation: 𝐴 = 𝑚 × 𝑛 needs: 4𝑚2𝑛 + 8𝑚𝑛2 + 9𝑛3 [Golub-89]
• It is: 𝐴𝑇𝐴 = 𝑉𝐷𝑈𝑇𝑈𝐷𝑉𝑇 = 𝑉𝐷2𝑉𝑇
then the entries of 𝐷2are eigenvalues of 𝐴𝑇𝐴 and eigenvectors are columns of 𝑉
Singular values; sorted: 𝜎𝑖 ≥ 𝜎𝑖+1
SVD and Null space• Right null space: 𝐴 𝒙 = 𝟎 where 𝐴 = 𝑚 × 𝑛 with 𝑚 < 𝑛
this is given by the (n-m) last row vectors in 𝑉𝑇
22/12/2014Computer Vision I: Robust Two-View Geometry 28
• Example:
A =
1
2
1
2
−1
2−1
2
1
2
1
2
Then SVD is:
1
2
1
√2
−1
2−1
2
1
√2
1
2
0 0 0
=
1
√2
1
√20
−1
√2
1
√20
0 0 1
1 0 00 1 00 0 0
1
√20
−1
√2
0 1 0−1
√20
−1
√2
1
√20
−1
√20 1 00 0 0
𝒙 = 𝜆
−1
√2
0
−1
√2
= 𝜆
1
0
1
Nullspace
and 𝐴𝑥 = 0
• Left null space: 𝒙𝐴 = 𝟎 where 𝐴 = 𝑚 × 𝑛 with 𝑚 < 𝑛 this is given by the (n-m) last column vectors in 𝑈
Least Square Problem (homogenous linear system)
22/12/2014Computer Vision I: Two-View Geometry 29
• Find a solution to 𝐴𝒙 = 0 where 𝐴 = 𝑚 × 𝑛 with 𝑚 ≥ 𝑛
• Solution 𝒙 = 0 is not interesting
• If 𝒙 is solution then any 𝑘𝒙. So we look for 𝒙 = 1
• 𝐴𝒙 = 0 is never exactly zero (due to noise in measurements).
Hence, solve in least square sense:
𝒙∗ = 𝑎𝑟𝑔𝑚𝑖𝑛𝒙 𝐴𝒙 subject to 𝒙 = 𝟏
• 𝒙∗ is the last row of 𝑉𝑇, where 𝐴 = 𝑈𝐷𝑉𝑇
Proof
22/12/2014Computer Vision I: Two-View Geometry 30
Topic 1: Homography 𝐻
• Derive geometrically 𝐻
• Calibration: Take measurements (points) to compute 𝐻
• How do we do that with a minimal number of points?
• How do we do that with many points?
• Can we derive the intrinsic (𝐾) an extrinsic (𝑅, 𝐶) parameters from 𝐻?
• What can we do with 𝐻 ?
22/12/2014Computer Vision I: Two-View Geometry 31
Definition Homography
22/12/2014Computer Vision I: Two-View Geometry 32
• Definition: A projectivity (or homography) ℎ is an invertible mapping ℎ from 𝑃2 to 𝑃2 such that three points 𝑥1, 𝑥2, 𝑥3 lie on the same line if an only if ℎ(𝑥1), ℎ(𝑥2), ℎ(𝑥3) do.
• Theorem: A mapping ℎ from 𝑃2 to 𝑃2 is a homography if and only if there exists a non-singular 3 × 3 matrix H with ℎ(𝑥) = 𝐻𝑥
• In equations: x′ = 𝐻𝑥
• 𝐻 has 8 DoF
𝑥𝑦1
Transformation matrix 𝐻
ℎ11 ℎ12 ℎ13ℎ21 ℎ22 ℎ23ℎ31 ℎ32 ℎ33
𝑥′𝑦′1
=
Geometric Derivation: Homography
22/12/2014Computer Vision I: Two-View Geometry 33
𝑥𝑦1
Transformation matrix 𝐻
ℎ11 ℎ12 ℎ13ℎ21 ℎ22 ℎ23ℎ31 ℎ32 ℎ33
𝑥′𝑦′1
=
Cast shadowRotating camera
Mapping via a plane
Notation: x (homogenous 2D), x (inhomogenous 2D), 𝑿 (homogenous 3D), 𝑿(inhomogenous 3D)
Homography from a rotating camera
22/12/2014Computer Vision I: Image Formation Process 34
Put it toghter: 𝒙𝟏 = 𝑲𝟏𝑹𝑲𝟎−𝟏𝒙𝟎
Hence 𝑯 = 𝑲𝟏𝑹𝑲𝟎−𝟏 is a homography (general 3x3 matrix) with 8 DoF
~
𝑲 =𝑓 𝑠 𝑝𝑥0 𝑚𝑓 𝑝𝑦0 0 1
𝒙 = 𝑲 𝑹 (𝑰𝟑×𝟑 | − 𝑪) 𝑿
Camera 0: 𝒙𝟎 = 𝑲𝟎 𝑿 (in 3D ∶ 𝑲𝟎−𝟏𝒙𝟎 = 𝑿)
Camera 1: 𝒙𝟏 = 𝑲𝟏 𝑹 𝑿
~
~
~
~
~
Homography of a projection via a plane
22/12/2014Computer Vision I: Two-View Geometry 35
(See geometric derivation on page 49)
Definition: A projectivity (or homography) ℎ is an invertible mapping ℎ from 𝑃2 to 𝑃2 such that three points 𝑥1, 𝑥2, 𝑥3 lie on the same line if an only if ℎ(𝑥1), ℎ(𝑥2), ℎ(𝑥3) do so.
We know (see Theorem): All Homographies can be written as ℎ(𝑥) = 𝐻𝑥
We see visually that lines map to lines
So we can write: 𝑥2 = 𝐻𝑥1
How to compute/calibrate 𝐻
• We have 𝜆𝑥′ = 𝐻𝑥
• H has 8 DoF
• We get for each pair of matching points (𝑥′, 𝑥) the 3 equations:
1) ℎ11𝑥1 + ℎ12𝑥2 + ℎ13𝑥3 = 𝜆𝑥1′
2) ℎ21𝑥1 + ℎ22𝑥2 + ℎ23𝑥3 = 𝜆𝑥2′
• Eliminate 𝜆. This gives 2 linear independent equations be taking the ratios.
Here 1) divide by 2) gives:
22/12/2014Computer Vision I: Two-View Geometry 36
3) ℎ31𝑥1 + ℎ32𝑥2 + ℎ33𝑥3 = 𝜆𝑥3′
𝑥1𝑥2′ , 𝑥2𝑥2
′ , 𝑥3𝑥2′ , −𝑥1𝑥1
′ , −𝑥2𝑥1′ , −𝑥3𝑥1
′ ℎ11, ℎ12, ℎ13, ℎ21, ℎ22, ℎ23𝑇 = 0
How to compute/calibrate 𝐻
22/12/2014Computer Vision I: Two-View Geometry 37
ℎ11ℎ12ℎ13ℎ21ℎ22ℎ23ℎ31ℎ32ℎ33
= 0
• Put it together:
• We need a minimum of 4 points to get 𝐴ℎ = 0 with 𝐴 𝑖𝑠 8 × 9 matrix, and ℎ 𝑖𝑠 9 × 1 vector
• Solution for ℎ is the right null space of 𝐴
𝑥1𝑥2′ 𝑥2𝑥2
′ 𝑥3𝑥2′ −𝑥1𝑥1
′ −𝑥2𝑥1′ −𝑥3𝑥1
′ 0 0 0
0 0 0 𝑥1𝑥3′ 𝑥2𝑥3
′ 𝑥3𝑥3′ −𝑥1𝑥2
′ −𝑥2𝑥2′ −𝑥3𝑥2
′
.
.
.
Often we have many, slightly wrong point-matches
22/12/2014Computer Vision I: Two-View Geometry 38
image
Algorithm: 1) Take 𝑚 ≥ 4 point matches (𝑥, 𝑥’)2) Assemble A with Ah = 03) compute 𝒉∗ = 𝑎𝑟𝑔𝑚𝑖𝑛ℎ 𝐴𝒉 subject to 𝒉 = 𝟏,
use SVD to do this.
We know how to do: 𝒙∗ = 𝑎𝑟𝑔𝑚𝑖𝑛𝒙 𝐴𝒙 subject to 𝒙 = 𝟏
A more numerically stable solution
22/12/2014Computer Vision I: Two-View Geometry 39
• Coefficients of an equation system should be in the same order ofmagnitude so as not to lose significant digits
• In pixels: 𝑥𝑎𝑥𝑏 ’ ~ 1𝑒6
• Conditioning: scale and shift points to be in [-1..1] (or +/- √2 )
• A general rule, not only for homography computation
• How to do it:
A more numerically stable solution
22/12/2014Computer Vision I: Two-View Geometry 40
Algorithm: 1) Take 𝑚 ≥ 4 point matches (𝑥, 𝑥’)2) Compute 𝑇, and condition points: 𝑥𝑛 = 𝑇𝑥; 𝑥𝑛’ = 𝑇’𝑥’3) Assemble 𝐴 with 𝐴𝒉 = 04) compute 𝒉∗ = 𝑎𝑟𝑔𝑚𝑖𝑛ℎ 𝐴𝒉 subject to 𝒉 = 𝟏,
use SVD to do this. 4) Get 𝐻 of unconditioned points: 𝑇′−1𝐻𝑇 (Note: 𝑇′𝑥′ = 𝐻𝑇𝑥)
[See HZ page 109]
Motivation for next lecture
22/12/2014Computer Vision I: Two-View Geometry 41
Question 1: If a match is completly wrong then is a bad idea
Question 2: If a match is slighly wrong then might not be perfect.Better might be a geometric error:
𝑎𝑟𝑔𝑚𝑖𝑛ℎ 𝐴𝒉
𝑎𝑟𝑔𝑚𝑖𝑛ℎ 𝐴𝒉𝑎𝑟𝑔𝑚𝑖𝑛ℎ 𝑯𝑥 − 𝑥′
Can we get 𝐾’𝑠 and 𝑅 from 𝐻?
• Assume we have 𝐻 = 𝐾1𝑅𝐾0−1of a rotating camera,
can we get out 𝐾1, 𝑅, 𝐾0 ?
• 𝐻 has 8 DoF
• 𝐾1, 𝑅, 𝐾0 have together 13 DoF
• Not directly possible, only with assumptions on K. (No application needs such a decomposition)
• For other transfromations such decompositions are possible
22/12/2014Computer Vision I: Two-View Geometry 42
What can we do with 𝐻?
• Panoramic stitching with rotating camera (exercise later)
22/12/2014Computer Vision I: Two-View Geometry 43
Warp images into a canonical view: 𝑥′ = 𝐻𝑥
What can we do with 𝐻?
22/12/2014Computer Vision I: Two-View Geometry 44
What can we do with 𝐻?
• Plane-based augmented realty
22/12/2014Computer Vision I: Two-View Geometry 45
[Graz University]
The figure appears to stand on the board. For this the mapping between the board and the image plane is needed.
Homography 𝐻: Summary• Derive geometrically 𝐻
• Calibration: Take measurements (points) to compute 𝐻• Minimum of 4 points. Solution: right null space of 𝐴ℎ = 0• Many points. Use SVD to solve 𝒉∗ = 𝑎𝑟𝑔𝑚𝑖𝑛ℎ 𝐴𝒉
• Can we derive the intrinsic (𝐾) an extrinsic (𝑅, 𝐶) parameters from 𝐻?-> hard. Not discussed much
• What can we do with 𝐻 ?
-> augmented reality on planes, panoramic stitching
22/12/2014Computer Vision I: Two-View Geometry 46
Halfway
3 Minutes Break
Question?
22/12/2014Computer Vision I: Image Formation Process 47
Topic 2: Camera Matrix P
• Derive geometrically 𝑃
• Calibration: Take measurements (points) to compute 𝑃
• How do we do that with a minimal number of points?
• How do we do that with many points?
• Can we derive the intrinsic (𝐾) an extrinsic (𝑅, 𝐶) parameters from 𝑃?
• What can we do with 𝑃?
22/12/2014Computer Vision I: Two-View Geometry 48
Geometric Derivation: Camera Matrix (Reminder)
22/12/2014Computer Vision I: Image Formation Process 49
• Camera matrix P has 11 DoF
• Intrinsic parameters
• Principal point coordinates (𝑝𝑥, 𝑝𝑦)
• Focal length 𝑓
• Pixel magnification factors 𝑚
• Skew (non-rectangular pixels) 𝑠
• Extrinsic parameters
• Rotation 𝑹 (3DoF) and translation 𝐂 (3DoF) relative to world coordinate system
𝒙 = 𝑲 𝑹 (𝑰𝟑×𝟑 | − 𝑪) 𝑿~
~
𝑲 =𝑓 𝑠 𝑝𝑥0 𝑚𝑓 𝑝𝑦0 0 1
𝒙 = 𝑷 𝑿
How can we compute/calibrate 𝑃?
22/12/2014Computer Vision I: Two-View Geometry 50
𝒙 = 𝑲 𝑹 (𝑰𝟑×𝟑 | − 𝑪) 𝑿
𝒙 = 𝑷 𝑿
Important move in all directions: 𝑥, 𝑦, 𝑧
Calibration pattern
~
How can we compute/calibrate 𝑃?
• We have 𝜆𝑥′ = 𝑃𝑋
• 𝑃 has 11 DoF
• We get for each point pair (𝑥′, 𝑋) 3 equations, but only 2 linear independent once, by taking ration (to get rid of 𝜆)
• We need a minimum of 6 Points to get 12 equations
22/12/2014Computer Vision I: Two-View Geometry 51
Algorithm (DLT - Direct Linear Transform): 1) Take 𝑚 ≥ 6 points. 2) Condition points 𝑋, 𝑥′ using 𝑇, 𝑇′3) Assemble 𝐴 with 𝐴𝑝 = 0 (𝐴 𝑖𝑠 𝑚 × 12 and 𝑝 is vectorized 𝑃) 4) compute 𝑝∗ = 𝑎𝑟𝑔𝑚𝑖𝑛𝑝 𝐴𝑝 subject to 𝑝 = 1
use SVD to do this. 5) Get out unconditioned 𝑃 = 𝑇′−1𝑃𝑇 (note 𝑇’𝑥’ = 𝑃 𝑇𝑋)
[See extended version: HZ page 181]
Note: a version with minimal number of points (6) is same as with many points
• Assume 𝑃 is known, can we get out 𝐾, 𝑅, 𝐶?
• P has 11 DoF
• 𝐾, 𝑅, 𝐶 have together 5+3+3=11 DoF(so it is possible)
• How to do it:
1) The camera center 𝐶 is the right nullspace of P
𝑃𝐶 = 𝐾 𝑅 (𝐶 − 𝐶) = 0
2) 𝑃 = [𝐾𝑅| − 𝐾𝑅𝐶];
𝐴 = 𝐾𝑅can be done with unique 𝑅𝑄 decomposition, where 𝑅 is upper-triangular matrix and 𝑄 a rotation matrix (see HZ page 579)
How can we get K,R,C from P
22/12/2014Computer Vision I: Two-View Geometry 52
𝒙 = 𝑲 𝑹 (𝑰𝟑×𝟑 | − 𝑪) 𝑿~𝒙 = 𝑷 𝑿
~
~
~
~
~
~
~
What can we do with 𝑃?
• Many things can be done with an externally and internally calibrated camera
• Robot navigation, augmented reality, photogrammetry …
22/12/2014Computer Vision I: Two-View Geometry 53
camera
Manipulator
Camera Matrix 𝑃: Summary
• Derive geometrically 𝑃
• Calibration: Take measurements (points) to compute 𝑃
• 6 or more points. Use SVD to solve 𝒑∗ = 𝑎𝑟𝑔𝑚𝑖𝑛ℎ 𝐴𝒑
• Can we derive the intrinsic (𝐾) an extrinsic (𝑅, 𝐶) parameters from 𝐻?-> yes, use SVD and RQ decomposition
• What can we do with 𝑃 ?
-> very many things (robotic, photogrammetry, augmented reality, …)
22/12/2014Computer Vision I: Two-View Geometry 54
𝒙 = 𝑲 𝑹 (𝑰𝟑×𝟑 | − 𝑪) 𝑿~𝒙 = 𝑷 𝑿
Topic 3: Fundamental/Essential Matrix 𝐹/𝐸
• Derive geometrically 𝐹/𝐸
• Calibration: Take measurements (points) to compute 𝐹/𝐸
• How do we do that with a minimal number of points?
• How do we do that with many points?
• Can we derive the intrinsic (𝐾) an extrinsic (𝑅, 𝐶) parameters from 𝐹/𝐸?
• What can we do with 𝐹/𝐸?
22/12/2014Computer Vision I: Two-View Geometry 55
Reminder: Matching two Images
22/12/2014Computer Vision I: Image Formation Process 56
v
• Find interest points
• Find orientated patches around interest points to capture appearance
• Encode patch appearance in a descriptor
• Find matching patches according to appearance (similar descriptors)
• Verify matching patches according to geometry (later lecture)
We will discover in next slides:Seven 3D points defines how other 3D points match between 2 views!
3D Geometry
22/12/2014Computer Vision I: Two-View Geometry 57
Non-moving scene
𝑃’
Rigidly (6D) moving scene
Both cases are equivalent for the following derivations
Epipolar Geometry
22/12/2014Computer Vision I: Two-View Geometry 58
Epipolar Geometry
22/12/2014Computer Vision I: Two-View Geometry 59
Epipolar Geometry
22/12/2014Computer Vision I: Two-View Geometry 60
Epipolar Geometry
22/12/2014Computer Vision I: Two-View Geometry 61
• Epipole: Image location of the optical center of the other camera.
(Can be outside of the visible area)
Epipolar Geometry
22/12/2014Computer Vision I: Two-View Geometry 62
Epipolar plane: Plane through both camera centers and world point.
Epipolar Geometry
22/12/2014Computer Vision I: Two-View Geometry 63
• Epipolar line: Constrains the location where a particular point (here 𝑝1) from
one view can be found in the other.
Epipolar Geometry
22/12/2014Computer Vision I: Two-View Geometry 64
• Epipolar lines:• Intersect at the epipoles
• In general not parallel
Example: Converging Cameras
22/12/2014Computer Vision I: Two-View Geometry 65
Example: Motion Parallel to Camera
22/12/2014Computer Vision I: Two-View Geometry 66
• We will use this idea when it comes to stereo matching
Example: Forward Motion
22/12/2014Computer Vision I: Two-View Geometry 67
• Epipoles have same coordinate in both images
• Points move along lines radiating from epipole“focus of expansion”