dan witzner hansen. previously??? projections pinhole cameras perspective projection camera...

83
CAMERAS AND PROJECTIONS Dan Witzner Hansen

Post on 19-Dec-2015

222 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

CAMERAS AND PROJECTIONS

Dan Witzner Hansen

Page 2: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

OUTLINE

Previously??? Projections Pinhole cameras Perspective projection

Camera matrix Camera calibration matrix Ortographic projection

Page 3: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

PROJECTION AND PERSPECTIVE EFFECTS

Page 4: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

CAMERA OBSCURA

"Reinerus Gemma-Frisius, observed an eclipse of the sun at Louvain on January 24, 1544, and later he used this illustration of the event in his book De Radio Astronomica et Geometrica, 1545. It is thought to be the first published illustration of a camera obscura..." Hammond, John H., The Camera Obscura, A Chronicle

http://www.acmi.net.au/AIC/CAMERA_OBSCURA.html

Page 5: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

PINHOLE CAMERA

Pinhole camera is a simple model to approximate imaging process, perspective projection.

Fig from Forsyth and Ponce

If we treat pinhole as a point, only one ray from any given point can enter the camera.

Virtual image pinhol

e

Page 6: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

CAMERA OBSCURA

Jetty at Margate England, 1898.

Adapted from R. Duraiswami

http://brightbytes.com/cosite/collection2.html

Around 1870sAn attraction in the late 19th century

Page 7: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

CAMERA OBSCURA AT HOME

Sketch from http://www.funsci.com/fun3_en/sky/sky.htmhttp://room-camera-obscura.blogspot.com/

Page 8: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

DIGITAL CAMERAS

Film sensor array Often an array of charged

coupled devices Each CCD is light sensitive

diode that converts photons (light energy) to electrons

cameraCCD array optics frame

grabbercomputer

Page 9: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

COLOR SENSING IN DIGITAL CAMERAS

Source: Steve Seitz

Estimate missing components from neighboring values(demosaicing)

Bayer grid

Page 10: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

PINHOLE SIZE / APERTURE

Smaller

Larger

How does the size of the aperture affect the image we’d get?

Page 11: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

ADDING A LENS

A lens focuses light onto the film There is a specific distance at which objects are “in

focus” other points project to a “circle of confusion” in the image

Changing the shape of the lens changes this distance

“circle of confusion”

Page 12: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

LENSES

A lens focuses parallel rays onto a single focal point focal point at a distance f beyond the plane of the lens

f is a function of the shape and index of refraction of the lens

Aperture of diameter D restricts the range of rays aperture may be on either side of the lens

Lenses are typically spherical (easier to produce)

focal point

F

optical center(Center Of Projection)

Page 13: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

THIN LENSES

Thin lens equation:

Any object point satisfying this equation is in focus What is the shape of the focus region? How can we change the focus region? Thin lens applet: http://www.phy.ntnu.edu.tw/java/Lens/lens_e.html (by Fu-Kwun

Hwang )

Page 14: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

FOCUS AND DEPTH OF FIELD

Image credit: cambridgeincolour.com

Page 15: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

FOCUS AND DEPTH OF FIELD

Depth of field: distance between image planes where blur is tolerable

Thin lens: scene points at distinct depths come in focus at different image planes.

(Real camera lens systems have greater depth of field.)

Shapiro and Stockman

“circles of confusion”

Page 16: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

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

f / 5.6

f / 32

Flower images from Wikipedia http://en.wikipedia.org/wiki/Depth_of_field

Page 17: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

DEPTH FROM FOCUS

[figs from H. Jin and P. Favaro, 2002]

Images from same point of view, different camera parameters

3d shape / depth estimates

Page 18: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

ISSUES WITH DIGITAL CAMERAS

Noise big difference between consumer vs. SLR-style cameras low light is where you most notice noise

Compression creates artifacts except in uncompressed formats (tiff, raw)

Color color fringing artifacts from Bayer patterns

Blooming charge overflowing into neighboring pixels

In-camera processing oversharpening can produce halos

Interlaced vs. progressive scan video even/odd rows from different exposures

Are more megapixels better? requires higher quality lens noise issues

Stabilization compensate for camera shake (mechanical vs. electronic)More info online, e.g.,

• http://electronics.howstuffworks.com/digital-camera.htm • http://www.dpreview.com/

Page 19: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

MODELING PROJECTIONS

Page 20: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

PERSPECTIVE EFFECTS

Page 21: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

PERSPECTIVE AND ART

Use of correct perspective projection indicated in 1st century B.C. frescoes

Skill resurfaces in Renaissance: artists develop systematic methods to determine perspective projection (around 1480-1515)

Durer, 1525Raphael

Page 22: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

MODELING PROJECTION

Page 23: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

PERSPECTIVE EFFECTS

Far away objects appear smaller

Forsyth and Ponce

Page 24: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

PERSPECTIVE EFFECTS

Parallel lines in the scene intersect in the image

Converge in image on horizon lineImage plane(virtual)

Scene

pinhole

Page 25: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

Pinhole camera model

TT ZfYZfXZYX )/,/(),,(

101

0

0

1

Z

Y

X

f

f

Z

fY

fX

Z

Y

X

Page 26: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

FIELD OF VIEW

Angular measure of portion of 3D space seen by the camera

Depends on focal length

Images from http://en.wikipedia.org/wiki/Angle_of_view

Page 27: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

Pinhole camera model

101

0

0

Z

Y

X

f

f

Z

fY

fX

101

01

01

1Z

Y

X

f

f

Z

fY

fX

PXx

0|I)1,,(diagP ff

Page 28: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

Principal point offset

Tyx

T pZfYpZfXZYX )/,/(),,(

principal pointTyx pp ),(

101

0

0

1

Z

Y

X

pf

pf

Z

ZpfY

ZpfX

Z

Y

X

y

x

x

x

camX0|IKx

1y

x

pf

pf

Kcalibration matrix:

Page 29: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

Camera rotation and translation

˜ X cam = R ˜ X - ˜ C ( )

X10

RCR

1

10

C~

RRXcam

Z

Y

X

x = K I | 0[ ] Xcam

x = KR I | − ˜ C [ ] X

t|RKP C~

Rt PXx

Page 30: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

1yx

xx

p

p

K

11y

x

x

x

pf

pf

m

m

K

CCD CAMERA

Page 31: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

When is skew non-zero?

1yx

xx

p

ps

K

1 g

arctan(1/s)

for CCD/CMOS, always s=0

Image from image, s≠0 possible(non coinciding principal axis)

HPresulting camera:

Page 32: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

Projection equation

• The projection matrix models the cumulative effect of all parameters• Useful to decompose into a series of operations

ΠXx

1****

****

****

Z

Y

X

s

sy

sx

110100

0010

0001

100

'0

'0

31

1333

31

1333

x

xx

x

xxcy

cx

yfs

xfs

00

0 TIRΠ

projectionintrinsics rotation translation

identity matrix

CAMERA PARAMETERSA camera is described by several parameters

• Translation T of the optical center from the origin of world coords• Rotation R of the image plane• focal length f, principle point (x’c, y’c), pixel size (sx, sy)

• blue parameters are called “extrinsics,” red are “intrinsics”

• The definitions of these parameters are not completely standardized– especially intrinsics—varies from one book to another

Page 33: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

PROJECTION PROPERTIES

Many-to-one: any points along same ray map to same point in image

Points points Lines lines (collinearity preserved) Distances and angles are not preserved Degenerate cases:

– Line through focal point projects to a point.– Plane through focal point projects to line– Plane perpendicular to image plane projects to

part of the image.

Page 34: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

CAMERAS?

More about camera calibration later in the course.

We will see more about what information can be gathered from the images using knowledge of planes and calibrated cameras

Page 35: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

(0,0,0)

THE PROJECTIVE PLANE Why do we need homogeneous coordinates?

represent points at infinity, homographies, perspective projection, multi-view relationships

What is the geometric intuition? a point in the image is a ray in projective space

(sx,sy,s)

• Each point (x,y) on the plane is represented by a ray (sx,sy,s)– all points on the ray are equivalent: (x, y, 1) (sx, sy, s)

image plane

(x,y,1)-y

x-z

Page 36: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

PROJECTIVE LINES What does a line in the image

correspond to in projective space?

• A line is a plane of rays through origin– all rays (x,y,z) satisfying: ax + by + cz = 0

z

y

x

cba0 :notationvectorin

• A line is also represented as a homogeneous 3-vector l

l p

Page 37: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

l

POINT AND LINE DUALITY A line l is a homogeneous 3-vector It is to every point (ray) p on the

line: l p=0

p1p2

What is the intersection of two lines l1 and l2 ?

• p is to l1 and l2 p = l1 l2

Points and lines are dual in projective space• given any formula, can switch the meanings of points and

lines to get another formula

l1

l2

p

What is the line l spanned by rays p1 and p2 ?

• l is to p1 and p2 l = p1 p2

• l is the plane normal

Page 38: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

IDEAL POINTS AND LINES

Ideal point (“point at infinity”) p (x, y, 0) – parallel to image plane It has infinite image coordinates

(sx,sy,0)-y

x-z image plane

Ideal line• l (a, b, 0) – parallel to image plane

(a,b,0)-y

x-z image plane

• Corresponds to a line in the image (finite coordinates)– goes through image origin (principle point)

Page 39: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

INTERPRETING THE CAMERA MATRIX COLUMN VECTORS

p1, p2 p3 are the vanishing points along the X,Y,Z axisP4 is the camera center in world coordinates

Page 40: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

INTERPRETING THE CAMERA MATRIX ROW VECTORS

P3 is the principal plane containing the camera center is parallel to imageplane. P1, P2 are axes planes formed by Y and X axes and cameracenter.

Page 41: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

motion parallax

epipolar line

MOVING THE CAMERA CENTER

Page 42: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

WEAK PERSPECTIVE

Approximation: treat magnification as constant

Assumes scene depth << average distance to camera

World points:

Image plane

Page 43: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

ORTHOGRAPHIC PROJECTION

Given camera at constant distance from scene

World points projected along rays parallel to optical access

Page 44: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

ORTHOGRAPHIC (“TELECENTRIC”) LENSES

http://www.lhup.edu/~dsimanek/3d/telecent.htm

Navitar telecentric zoom lens

Page 45: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

CORRECTING RADIAL DISTORTION

from Helmut Dersch

Page 46: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

DISTORTION

Radial distortion of the image Caused by imperfect lenses Deviations are most noticeable for rays

that pass through the edge of the lens

No distortion Pin cushion Barrel

Page 47: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

MODELING DISTORTION

To model lens distortion Use above projection operation instead of standard

projection matrix multiplication

Apply radial distortion

Apply focal length translate image center

Project to “normalized”

image coordinates

Page 48: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

OTHER CAMERA TYPES

Omnidirectional image

Time-of-flight

Plenoptic camera

Page 49: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

SUMMARY

Image formation affected by geometry, photometry, and optics.

Projection equations express how world points mapped to 2D image.

Homogenous coordinates allow linear system for projection equations.

Lenses make pinhole model practical. Parameters (focal length, aperture, lens

diameter,…) affect image obtained.

Page 50: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

WHAT DOES CAMERA CALIBRATION GIVE

Calculate distances to objects with known size.

Calculate angles • Rotations between two views of a plane (see later) •Perpendicular vectors

Calibration can be done automatically with multiple cameras

Page 51: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

INFORMATION FROM PLANES AND CAMERAS

An image line l defines a plane through the camera center with normal n=KTl measured in the camera’s Euclidean frame (e.g. orientation)

Given K and a homograpy, two possible normals and orientations are possible

Page 52: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

2T

21T

1

2T

1

ωvvωvv

ωvvcos

0ωvv 2T

1 0lωl 2*T

1

1-T-1T KKKKω

ANGLES AND ORTHOGONALITY RELATION

Image of Absolute Conic (IAC)

Page 53: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

HOMOGRAPHIES REVISITED

Page 54: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

A SPECIAL CASE, PLANES

Image plane(retina, film, canvas)

Observer

World plane

2D 2D

A plane to plane projective transformation

Homography matrix (3x3)

Page 55: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

APPLICATIONS OF HOMOGRAPHIES

Page 56: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

RECTIFYING SLANTED VIEWS

Corrected image (front-to-parallel)

Page 57: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

xKRK0]X|K[Rx'0]X|K[Ix

1-

-1KRKH

CAMERA ROTATION

Page 58: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

1ppp

10ppppPXx 4214321 Y

XYX

The most general transformation that can occur between a scene plane and an image plane under perspective imaging is a plane projective transformation

]|[KP tR ],,[ 21 trrKH

Example: Homography between world plane Z=0 and image

implies

ACTION OF PROJECTIVE CAMERA ON PLANES

Page 59: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

HOMOGRAPHY ESTIMATION

Number of measurements needed for estimating H

How do do we estimate H automatically We need to consider robustness to

outliers

Page 60: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

CROSS PRODUCT AS MATRIX MULTIPLICATION

Recall: If a = (xa, ya, za)T and b = (xb, yb, zb)T,

then: c = a x b = (ya zb - za yb, za xb - xa zb, xa yb - ya

xb)T

0

0

0

12

13

23

aa

aa

aa

a

Page 61: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

ESTIMATING H: DLT ALGORITHM

x0i = Hxi is an equation involving

homogeneous vectors, so Hxi and x0i

need only be in the same direction, not strictly equal

We can specify “same directionality” by using a cross product formulation:

See Hartley & Zisserman, Chapter 3.1-3.1.1

Page 62: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

HOMOGRAPHY ESTIMATION

How would solve this equation (remember that it the elements in H that needs to be estimated)?

Each pair (x,x’) gives us 2 pieces of information and therefore at least 4 point correspondenses are needed.

Duality and other :Lines and conics may also be used

Page 63: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

A h 02n × 9 9 2n

pp’

HOMOGRAPHIES

Page 64: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

DLT ALGORITHM

ObjectiveGiven n≥4 2D to 2D point correspondences {xi↔xi’}, determine the 2D homography matrix H such that xi’=Hxi

Algorithm

(i) For each correspondence xi ↔xi’ compute Ai. Usually only two first rows needed.

(ii) Assemble n 2x9 matrices Ai into a single 2nx9 matrix A

(iii) Obtain SVD of A. Solution for h is last column of V

(iv) Determine H from h (i.e. reshape from vector to matrix form)

Page 65: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

NORMALIZING TRANSFORMATIONS

DLT is not invariant,what is a good choice of coordinates?e.g. Translate centroid to origin Scale to a average distance to the origin Independently on both images

2

1

norm

100

2/0

2/0

T

hhw

whwOr

Page 66: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

NORMALIZED DLT ALGORITHM

ObjectiveGiven n≥4 2D to 2D point correspondences {xi↔xi’}, determine the 2D homography matrix H such that xi’=Hxi

Algorithm

(i) Normalize points

(ii) Apply DLT algorithm to

(iii) Denormalize solution

,x~x~ ii inormiinormi xTx~,xTx~

norm-1

norm TH~

TH

Page 67: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

CAMERA CALIBRATION

Page 68: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

CAMERA CALIBRATION

Page 69: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

HOW CAN CAMERA CALIBRATION BE DONE?

Any suggestions?

Page 70: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

ii PXx

xi[ ]×PX i

0Ap

BASIC EQUATIONS

5.5 corresponding points needed

Page 71: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

(= Zhang’s calibration method)

A SIMPLE CALIBRATION DEVICE

1. Compute H for each square (corners (0,0),(1,0),(0,1),(1,1)

2. Compute the imaged circular points H(1,±i,0)T

3. Fit a conic to 6 circular points

4. Compute K from w through cholesky factorization

Page 72: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

VANISHING LINES, POINTS AND CALIBRATED CAMERAS

Page 73: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

78

VANISHING POINTS

Properties Any two parallel lines have the same vanishing point v The ray from C through v is parallel to the lines An image may have more than one vanishing point

in fact every pixel is a potential vanishing point

image plane

cameracenter

C

line on ground plane

vanishing point v

line on ground plane

Page 74: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

VANISHING POINTS LINES

2121012120 ))()((2))()(( lllllllllll TT Vanishing line from 3 lines:

Page 75: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

80

VANISHING POINTSimage plane

line on ground plane

vanishing point v

Vanishing point• projection of a point at infinity

cameracenter

C

Page 76: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

81

q1

COMPUTING VANISHING POINTS (FROM LINES)

Intersect p1q1 with p2q2

v

p1

p2

q2

Least squares version• Better to use more than two lines and compute the “closest” point of

intersection• See notes by Bob Collins for one good way of doing this:

– http://www-2.cs.cmu.edu/~ph/869/www/notes/vanishing.txt

Page 77: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

82

0/1

/

/

/

1Z

Y

X

ZZ

YY

XX

ZZ

YY

XX

t D

D

D

t

t

DtP

DtP

DtP

tDP

tDP

tDP

PP

COMPUTING VANISHING POINTS

Properties P is a point at infinity, v is its projection They depend only on line direction Parallel lines P0 + tD, P1 + tD intersect at P

V

DPP t 0

ΠPv

P0

D

Page 78: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

83

FUN WITH VANISHING POINTS

Page 79: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

84

PERSPECTIVE CUES

Page 80: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

85

PERSPECTIVE CUES

Page 81: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

86

PERSPECTIVE CUES

Page 82: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

VANISHING POINTS AND ANGLES

Projection of a direction d:

Back project:

0

d0]|K[I0]X|K[Ix

xKd 1

21-T-T

211-T-T

1

2-1-TT

1

2T

21T

1

2T

1

)xK(Kx)xK(Kx

)xK(Kx

dddd

ddcos

Page 83: Dan Witzner Hansen.  Previously???  Projections  Pinhole cameras  Perspective projection  Camera matrix  Camera calibration matrix  Ortographic

NEXT WEEK – NO LECTURES

WORK ON MANDATORY ASSIGNMENT