Computer Vision Exercise Session 1 Institute of Visual Computing - - PowerPoint PPT Presentation

computer vision
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Institute of Visual Computing

Computer Vision

Exercise Session 1

slide-2
SLIDE 2

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
slide-3
SLIDE 3

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)
slide-4
SLIDE 4

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
slide-5
SLIDE 5

Institute of Visual Computing

Camera Calibration

 X

t R K x PX x |  

3D points 2D points

  • Intrinsic parameters
  • K
  • Radial distortion coefficients
slide-6
SLIDE 6

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
slide-7
SLIDE 7

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)

slide-8
SLIDE 8

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 ˆ

slide-9
SLIDE 9

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

slide-10
SLIDE 10

Institute of Visual Computing

Direct Linear Transform (DLT)

  • Singular Value Decomposition

A

12 2n

U

2n 2n

S

12 2n

V‘

12 12

=

slide-11
SLIDE 11

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

slide-12
SLIDE 12

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    | |

slide-13
SLIDE 13

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

slide-14
SLIDE 14

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

slide-15
SLIDE 15

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

slide-16
SLIDE 16

Institute of Visual Computing

Minimization in MATLAB

  • Fminsearch(...)
  • See code framework
  • Lsqnonlin(...)
  • nonlinear least-squares
  • Vectorize your parameters
slide-17
SLIDE 17

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

slide-18
SLIDE 18

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.
slide-19
SLIDE 19

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!

slide-20
SLIDE 20

Institute of Visual Computing

Hand-in

  • Example reprojection of the the 3D points