Institute of Visual Computing
Computer Vision Exercise Session 1 Institute of Visual Computing - - PowerPoint PPT Presentation
Computer Vision Exercise Session 1 Institute of Visual Computing - - PowerPoint PPT Presentation
Computer Vision Exercise Session 1 Institute of Visual Computing Organization Teaching assistant Bastien Jacquet CAB G81.2 bastien.jacquet@inf.ethz.ch Federico Camposeco CNB D102.2 fede@inf.ethz.ch Lecture webpage
Institute of Visual Computing
Organization
- Teaching assistant
- Bastien Jacquet
- CAB G81.2
- bastien.jacquet@inf.ethz.ch
- Federico Camposeco
- CNB D102.2
- fede@inf.ethz.ch
- Lecture webpage
- http://www.cvg.ethz.ch/teaching/compvis/index.php
Institute of Visual Computing
Organization
- Assignments will be part of the final grade
- Assignment every week (or every two weeks the second
part)
- 1 or 2 weeks time to solve the assignment
- Hand-in Thursday 13:00 (sharp!)
- Bonus points can be used to compensate for missing
points
- MATLAB Download (www.stud-ides.ethz.ch)
Institute of Visual Computing
Literature
- Computer Vision: Algorithms and Application
by Richard Szeliski, available online ( http://szeliski.org/Book/ )
- Multiple View Geometry
by Richard Hartley and Andrew Zisserman
- Course Notes
- http://cvg.ethz.ch/teaching/compvis/tutorial.pdf
Institute of Visual Computing
Camera Calibration
X
t R K x PX x |
3D points 2D points
- Intrinsic parameters
- K
- Radial distortion coefficients
Institute of Visual Computing
Camera Calibration
Y X Z
- Use your own camera
- Build your own calibration object
- Print checkerboard patterns
- Stich to two orthogonal planes
Institute of Visual Computing
Camera Calibration
- 4 Tasks:
- Data normalization
- Direct Linear Transform (DLT)
- Gold Standard algorithm
- Bouguet‘s Calibration Toolbox
- Use the same settings for all tasks!
- Good reference:
Multiple View Geometry in computer vision (Richard Hartley & Andrew Zisserman)
Institute of Visual Computing
Data normalization
- Shift the centroid of the points to the origin
- Scale the points so that average distance to the
- rigin is and , respectively.
- Determine
using normalized points.
- Determine
1 3 3 3 1 2 2
1 1
z D y D x D y D x D
c s c s c s c s c s U T
3
U P T P ˆ
1
2
P ˆ
Institute of Visual Computing
Direct Linear Transform (DLT)
4 , 3 3 , 3 2 , 1 1 , 1 3 2 1
1 1 P P P P y X y X y X y X X X x X x X x X x X X X X y X w X x X w
i iz i iy i ix i iz iy ix i iz i iy i ix i iz iy ix T i i T i i T T i i T T i i
P P P AP
Institute of Visual Computing
Direct Linear Transform (DLT)
- Singular Value Decomposition
A
12 2n
U
2n 2n
S
12 2n
V‘
12 12
=
Institute of Visual Computing
Direct Linear Transform (DLT)
- Singular Value Decomposition
A
12 2n
U
2n 2n
S
12 2n
V‘
12 12
= =
4 , 3 3 , 3 2 , 1 1 , 1
P P P P
4 , 3 3 , 3 2 , 3 1 , 3 4 , 2 3 , 2 2 , 2 1 , 2 4 , 1 3 , 1 2 , 1 1 , 1
P P P P P P P P P P P P
Institute of Visual Computing
Camera Matrix Decomposition (K and R)
- K is upper triangular
- R is orthonormal
- QR decomposition A = QR
- Q is orthogonal
- R is upper triangular
KRC KR t R K P | |
Institute of Visual Computing
Camera Matrix Decomposition (K and R)
- Run QR decomposition on the inverse of the left
3x3 part of P
- Invert both result matrices to get K and R
1 1 1
| |
K R M KR M KRC KR t R K P
Institute of Visual Computing
Camera Matrix Decomposition (C)
- The camera center is the point for which
- This is the right null vector of P ( SVD)
PC
Institute of Visual Computing
Gold Standard Algorithm
- Normalize data
- Run DLT to get initial values
- Compute optimal by minimizing the sum of
squared reprojection errors
- Denormalize
P ˆ P ˆ
2 ˆ
) ˆ ˆ ˆ d( min
N 1 i i i
X P , x
P
Institute of Visual Computing
Minimization in MATLAB
- Fminsearch(...)
- See code framework
- Lsqnonlin(...)
- nonlinear least-squares
- Vectorize your parameters
Institute of Visual Computing
Bouguet‘s Calibration Toolbox
- Download and install the toolbox:
(http://www.vision.caltech.edu/bouguetj/calib_doc/index.html)
- Go through the tutorial and learn how to
calibrate a camera with that toolbox
- Print your own calibration pattern (available on
the website)
- Use the toolbox for calibration and compare the
result with the results of your own calibration algorithm
Institute of Visual Computing
Hand-in
- Source code
- Matlab .mat file with hand-clicked 3D-2D
correspondences
- Image used for calibration
- Visualize hand-clicked points and reprojected 3D
points
- Discuss and compare values of calibration obtained
for all methods
- Discuss average reprojection error of all methods.
Institute of Visual Computing
Some hints
- Work with normalized homogeneous coordinates always.
Camera calibration K should respect this convention.
- Check that the obtained orientation R correspond to the
expected world value, otherwise K will have negative values in its diagonal.
- When reprojecting points use average of reprojection error
for comparison and remember to normalize reprojected coordinates to w = 1.
- Remember to use the same camera with the same settings
for all tasks!
Institute of Visual Computing
Hand-in
- Example reprojection of the the 3D points