Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Stanford CS223B Computer Vision, Winter 2007 Lecture 4 Camera Calibration Professors.

Similar presentations


Presentation on theme: "Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Stanford CS223B Computer Vision, Winter 2007 Lecture 4 Camera Calibration Professors."— Presentation transcript:

1 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Stanford CS223B Computer Vision, Winter 2007 Lecture 4 Camera Calibration Professors Sebastian Thrun and Jana Kosecka CAs: Vaibhav Vaish and David Stavens

2 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Today’s Goals Calibration: Problem definition Solution by nonlinear Least Squares Solution via Singular Value Decomposition Homogeneous Coordinates Distortion Calibration Software

3 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Camera Calibration Feature Extraction Perspective Equations

4 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Perspective Projection, Remember? fZ X O x

5 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Intrinsic Camera Parameters Determine the intrinsic parameters of a camera (with lens) What are Intrinsic Parameters? (can you name 7?)

6 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Intrinsic Parameters fZ X O

7 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Intrinsic Camera Parameters Intrinsic Parameters: –Focal Length f –Pixel size s x, s y –Image center o x, o y –(Nonlinear radial distortion coefficients k 1, k 2 …) Calibration = Determine the intrinsic parameters of a camera

8 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Why Intrinsic Parameters Matter

9 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Questions Can we determine the intrinsic parameters by exposing the camera to many known objects? If so, –How often do we have to see the object? –How many features on the object do we need?

10 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Example Calibration Pattern Calibration Pattern: Object with features of known size/geometry

11 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Harris Corner Detector (see Assignment 2)

12 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Why Tilt the Board?

13 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Experiment 1: Parallel Board

14 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 30cm10cm20cm Projective Perspective of Parallel Board

15 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Experiment 2: Tilted Board

16 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 30cm10cm20cm 500cm50cm100cm Projective Perspective of Tilted Board

17 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Intrinsics and Extrinsics Intrinsics: –Focal Length f –Pixel size s x, s y –Image center o x, o y Extrinsics: –Location and orientation of k-th calib. pattern:

18 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Perspective Camera Model Step 1: Transform into camera coordinates Step 2: Transform into image coordinates

19 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Perspective Camera Model Step 1: Transform into camera coordinates Step 2: Transform into image coordinates

20 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 The Full Perspective Camera Model

21 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 The Calibration Problem Given –Calibration pattern with N corners –K views of this calibration pattern Recover the intrinsic parameters –We’ll also recover the extrinsics, but we won’t care about them

22 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Calibration Questions Can we determine the intrinsic parameters by exposing the camera to many known objects? If so, –How often do we have to see the object? –How many features on the object do we need? –Do we need to see object at angle? Yes.

23 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Today’s Goals Calibration: Problem definition Solution by nonlinear Least Squares Solution via Singular Value Decomposition Homogeneous Coordinates Distortion Calibration Software

24 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Calibration constraints Step 1: Transform into camera coordinates Step 2: Transform into image coordinates

25 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Camera Calibration

26 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Calibration by nonlinear Least Squares Least Mean Square Gradient descent:

27 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 The Calibration Problem Quiz Given –Calibration pattern with N corners –K views of this calibration pattern How large would N and K have to be? Can we recover all intrinsic parameters?

28 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Intrinsic Parameters, Degeneracy fZ X O

29 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Summary Parameters, Revisited Extrinsic –Rotation –Translation Intrinsic –Focal length –Pixel size –Image center coordinates Focal length, in pixel units Aspect ratio

30 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 The Calibration Problem Quiz Given –Calibration pattern with N corners –K views of this calibration pattern How large would N and K have to be? Can we recover all intrinsic parameters? N1313446 K1133346

31 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Constraints N points K images  2NK constraints 4 intrinsics (distortion: +2) 6K extrinsics  need 2NK ≥ 6K+4  (N-3)K ≥ 2 Hint: may not be co-linear

32 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 The Calibration Problem Quiz N1313446 K1133346 No Yes need (N-3)K ≥ 2 Hint: may not be co-linear

33 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Problem with Least Squares Many parameters (=slow) Many local minima! (=slower)

34 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Today’s Goals Calibration: Problem definition Solution by nonlinear Least Squares Solution via Singular Value Decomposition Homogeneous Coordinates Distortion Calibration Software

35 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Perspective Camera Model Step 1: Transform into camera coordinates Step 2: Transform into image coordinates

36 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Calibration Model (extrinsic) (Homogeneous Coordinates) (nonlinear perspective projection)

37 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Affine Problem Relaxation 

38 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Affine Problem Relaxation 

39 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Calibration via SVD [see Trucco/Verri]

40 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Calibration via SVD N>=7 points, not coplanar

41 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Calibration via SVD

42 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Calibration via SVD A has rank 7 (without proof)

43 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Calibration via SVD Remaining Problem: See book

44 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Summary, SVD Solution Replace rotation matrix by arbitrary matrix Transform into linear set of equations Solve via SVD Enforce rotation matrix (see book) Solve for remaining parameters (see book)

45 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Comparison Nonlinear least squares Gaussian image noise Many local minima Iterative Can incorporate non- linear distortion Singular Value Decomp. Gaussian parameter noise (algebraic) No local minima “Closed” form No distortion

46 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Today’s Goals Calibration: Problem definition Solution by nonlinear Least Squares Solution via Singular Value Decomposition Homogeneous Coordinates Distortion Calibration Software

47 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Homogeneous Coordinates Idea: In homogeneous coordinates most operations become linear! Extract Image Coordinates by Z- normalization

48 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Today’s Goals Calibration: Problem definition Solution by nonlinear Least Squares Solution via Singular Value Decomposition Homogeneous Coordinates Distortion Calibration Software

49 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Advanced Calibration: Nonlinear Distortions Barrel and Pincushion Tangential

50 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Barrel and Pincushion Distortion telewideangle

51 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Models of Radial Distortion distance from center

52 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Tangential Distortion cheap glue cheap CMOS chip cheap lens image cheap camera

53 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Image Rectification (to be continued)

54 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Distorted Camera Calibration Set k 1  k 2 , solve for undistorted case Find optimal k 1  k 2 via nonlinear least squares Iterate  Tends to generate good calibrations

55 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Today’s Goals Calibration: Problem definition Solution by nonlinear Least Squares Solution via Singular Value Decomposition Homogeneous Coordinates Distortion Calibration Software

56 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Calibration Software: Matlab

57 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Calibration Software: OpenCV

58 Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Summary Calibration: Problem definition Solution by nonlinear Least Squares Solution via Singular Value Decomposition Homogeneous Coordinates Distortion Calibration Software


Download ppt "Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Stanford CS223B Computer Vision, Winter 2007 Lecture 4 Camera Calibration Professors."

Similar presentations


Ads by Google