Pin Hole Cameras & Warp Functions Instructor - Simon Lucey - - PowerPoint PPT Presentation

pin hole cameras warp functions
SMART_READER_LITE
LIVE PREVIEW

Pin Hole Cameras & Warp Functions Instructor - Simon Lucey - - PowerPoint PPT Presentation

Pin Hole Cameras & Warp Functions Instructor - Simon Lucey 16-423 - Designing Computer Vision Apps Today Pinhole Camera. Homogenous Coordinates. Planar Warp Functions. Example of SLAM for AR Taken from: H. Liu et al.


slide-1
SLIDE 1

Pin Hole Cameras & Warp Functions

Instructor - Simon Lucey

16-423 - Designing Computer Vision Apps

slide-2
SLIDE 2

Today

  • Pinhole Camera.
  • Homogenous Coordinates.
  • Planar Warp Functions.
slide-3
SLIDE 3

Example of SLAM for AR

Taken from: H. Liu et al. “Robust Keyframe-based Monocular SLAM for Augmented Reality”, ISMAR 2016.

slide-4
SLIDE 4

Example of SLAM for AR

Taken from: H. Liu et al. “Robust Keyframe-based Monocular SLAM for Augmented Reality”, ISMAR 2016.

slide-5
SLIDE 5

Example of SLAM for AR

Taken from: H. Liu et al. “Robust Keyframe-based Monocular SLAM for Augmented Reality”, ISMAR 2016.

slide-6
SLIDE 6

Motivation

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-7
SLIDE 7

Pinhole Camera

Taken from: http://img.gawkerassets.com/img/18w7i1umpzoa9jpg/original.jpg

slide-8
SLIDE 8

Pinhole Camera

Real camera image is inverted Instead model impossible but more convenient virtual image

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-9
SLIDE 9

Pinhole Camera Terminology

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-10
SLIDE 10

Normalized Camera

By similar triangles:

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-11
SLIDE 11

Focal length parameters

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-12
SLIDE 12

Focal length parameters

Can model both

  • the effect of the distance to the focal plane
  • the density of the receptors

with a single focal length parameter φ In practice, the receptors may not be square: So use different focal length parameter for x and y dims

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-13
SLIDE 13

Offset parameters

  • Current model assumes that pixel (0,0) is where the

principal ray strikes the image plane (i.e. the center)

  • Model offset to center

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-14
SLIDE 14

Skew parameter

  • Finally, add skew parameter
  • Accounts for image plane being not exactly perpendicular

to the principal ray

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-15
SLIDE 15

Radial distortion

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-16
SLIDE 16

Camera & World Coordinates

u

  • w

“world coordinate frame”

slide-17
SLIDE 17

Camera & World Coordinates

u

  • w

“world coordinate frame”

u0 w0

“camera coordinate frame”

u0 w0

  • u

w

  • +

τx τz

  • =

ω1 ω2 ω3 ω4

slide-18
SLIDE 18

Camera & World Coordinates

u0 w0

  • u

w

  • +

τx τz

  • =

ω1 ω2 ω3 ω4

  • Rotation Matrix Translation Vector
slide-19
SLIDE 19

Position and orientation of camera

  • Position w=(u,v,w)T of point in the world is generally not

expressed in the frame of reference of the camera.

  • Transform using 3D transformation
  • r

Point in frame of reference of camera

Point in frame of reference of world

slide-20
SLIDE 20

Constraints on

  • As is a rotation matrix it is constrained by the following,
  • We refer to these matrices as belonging to the Special

Orthogonal Group - SO(3).

  • How many degrees of freedom do you think has ?

Ω ΩT Ω = I det(Ω) = 1 Ω

slide-21
SLIDE 21

Something to try

  • In MATLAB type,

>> R1 = orth(randn(3,3)); >> R1(:,end) = det(R1)*R1(:,end); >> R2 = orth(randn(3,3)); >> R2(:,end) = det(R2)*R2(:,end);

  • If you form a new matrix as a linear combination of R1 & R2,

>> R3 = 0.5*R1 + 0.5*R2;

  • Does R3 lie in SO(3) ?
slide-22
SLIDE 22

Reminder: Convex Set

18

slide-23
SLIDE 23

Reminder: Convex Set

18

slide-24
SLIDE 24

Reminder: Convex Set

18

slide-25
SLIDE 25

Reminder: Non-Convex Set

19

slide-26
SLIDE 26

Reminder: Non-Convex Set

19

slide-27
SLIDE 27

Reminder: Non-Convex Set

19

slide-28
SLIDE 28

Complete pinhole camera model

  • Intrinsic parameters (stored as intrinsic matrix)
  • Extrinsic parameters

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-29
SLIDE 29

Complete pinhole camera model

  • For short:
  • Question: is a linear function?

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-30
SLIDE 30

Perspective Transform

slide-31
SLIDE 31

Learning extrinsic parameters

ˆ Ω, ˆ τ = min

Ω,τ N

X

n=1

η{xn − pinhole[wn, Λ, Ω, τ]}

e.g. η{x} = ||x||2

2

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-32
SLIDE 32

Learning intrinsic parameters

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

e.g. η{x} = ||x||2

2

ˆ Λ = min

Λ [min Ω,τ N

X

n=1

η{xn − pinhole[wn, Λ, Ω, τ]}]

slide-33
SLIDE 33

Camera Calibration

  • Use 3D target with known 3D points.

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-34
SLIDE 34

For you to try…..

  • There exists camera calibration tools in MATLAB,
  • see Bouget’s Calibration Toolbox in MATLAB.
  • Or if you prefer,
  • you can use OpenCV’s tutorial.
  • What are the intrinsics of your device?
  • How sensitive are vision algorithms to the correct intrinsics?
slide-35
SLIDE 35

Today

  • Pinhole Camera.
  • Homogenous Coordinates.
  • Planar Warp Functions.
slide-36
SLIDE 36

Homogeneous Coordinates

  • Convert 2D coordinate to 3D
  • To convert back

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-37
SLIDE 37

Geometric interpretation

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-38
SLIDE 38

Pinhole camera

  • Camera model:
  • In homogeneous coordinates:

(linear!)

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-39
SLIDE 39

Pinhole camera

  • Writing out these three equations
  • Eliminate λ to retrieve original equations

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-40
SLIDE 40

Adding in extrinsics

Or for short: Or even shorter:

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-41
SLIDE 41

Today

  • Pinhole Camera.
  • Homogenous Coordinates.
  • Planar Warp Functions.
slide-42
SLIDE 42

Planar Warp Functions

  • Consider viewing a planar scene
  • There is now a 1 to 1 mapping between points on the plane

and points in the image

  • We will investigate models for this 1 to 1 mapping

–Euclidean –Similarity –Affine –Homography

slide-43
SLIDE 43

Piecewise planarity

Many scenes are not planar, but are nonetheless piecewise planar Can we match all of the planes to one another?

slide-44
SLIDE 44

Euclidean warp

  • Consider viewing a fronto-parallel plane at a fixed

distance D.

  • In homogeneous coordinates, the imaging equations are:

3D rotation matrix becomes 2D (in plane) Plane at known distance D Point is on plane (w=0)

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-45
SLIDE 45

Euclidean warp

  • Simplifying
  • Rearranging the last equation

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-46
SLIDE 46

Euclidean warp

Homogeneous: Cartesian: For short:

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

slide-47
SLIDE 47

Euclidean warp

Homogeneous: Cartesian: For short:

Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

How many unknowns?

slide-48
SLIDE 48

More to read…

  • Prince et al.
  • Chapter 14, Section 1 & 3.
  • Chapter 15, Section 1.