background: camera models, transforms, radiometry

23
1 CSE 291 J00, Winter 03 Kriegman 2003 Background: Camera models, Background: Camera models, Transforms, Radiometry Transforms, Radiometry Topics in Image-Based Modeling and Rendering CSE291 J00 Lecture 2 CSE 291 J00, Winter 03 Kriegman 2003 Outline Outline Camera Models Pinhole perspective Affine/Orthographic models Homogeneous coordinates Coordinate transforms • Lenses • Radiometry – Irradiance – Radiance – BRDF

Upload: others

Post on 30-May-2022

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Background: Camera models, Transforms, Radiometry

1

CSE 291 J00, Winter 03 Kriegman 2003

Background: Camera models, Background: Camera models, Transforms, RadiometryTransforms, Radiometry

Topics in Image-Based Modeling and RenderingCSE291 J00

Lecture 2

CSE 291 J00, Winter 03 Kriegman 2003

OutlineOutline• Camera Models• Pinhole perspective• Affine/Orthographic models• Homogeneous coordinates• Coordinate transforms• Lenses• Radiometry

– Irradiance– Radiance– BRDF

Page 2: Background: Camera models, Transforms, Radiometry

2

CSE 291 J00, Winter 03 Kriegman 2003

Effect of Lighting: MonetEffect of Lighting: Monet

CSE 291 J00, Winter 03 Kriegman 2003

Change of Viewpoint: MonetChange of Viewpoint: Monet

Haystack at Chailly at sunrise(1865)

Page 3: Background: Camera models, Transforms, Radiometry

3

CSE 291 J00, Winter 03 Kriegman 2003

Pinhole camerasPinhole cameras

• Abstract camera model -box with a small hole in it

• Pinhole cameras work in practice

CSE 291 J00, Winter 03 Kriegman 2003

The equation of projectionThe equation of projection

Cartesian coordinates:

• We have, by similar triangles, that (x, y, z) -> (f x/z, f y/z, -f)

• Ignore the third coordinate, and get(x, y,z) → ( f

xz

, fyz)

Page 4: Background: Camera models, Transforms, Radiometry

4

CSE 291 J00, Winter 03 Kriegman 2003

Homogenous coordinatesHomogenous coordinates

• Add an extra coordinate and use an equivalence relation

• for 2D– equivalence relation

k*(X,Y,Z) is the same as (X,Y,Z)

• for 3D– equivalence relation

k*(X,Y,Z,T) is the same as (X,Y,Z,T)

• Basic notion– Possible to represent

points “at infinity”• Where parallel lines

intersect• Where parallel planes

intersect– Possible to write the

action of a perspective camera as a matrix

CSE 291 J00, Winter 03 Kriegman 2003

Euclidean Euclidean --> Homogenous> Homogenous--> Euclidean > Euclidean

In 2-D• Euclidean -> Homogenous: (x, y) -> k (x,y,1)• Homogenous -> Euclidean: (x, y, z) -> (x/z, y/z)

In 3-D• Euclidean -> Homogenous: (x, y, z) -> k (x,y,z,1)• Homogenous -> Euclidean: (x, y, z, w) -> (x/w, y/w, z/w)

Page 5: Background: Camera models, Transforms, Radiometry

5

CSE 291 J00, Winter 03 Kriegman 2003

The camera matrixThe camera matrix

Turn previous expression into Homogenous Coordinates– HC’s for 3D point are

(X,Y,Z,T)– HC’s for point in image

are (U,V,W)

U

VW

=

1 0 0 0

0 1 0 00 0 1

f 0

X

YZT

CSE 291 J00, Winter 03 Kriegman 2003

AffineAffine Camera ModelCamera Model

• Take Perspective projection equation, and perform Taylor Series Expansion about (some point (x0,y0,z0).

• Drop terms of higher order than linear.• Resulting expression is affine camera model

Page 6: Background: Camera models, Transforms, Radiometry

6

CSE 291 J00, Winter 03 Kriegman 2003

Orthographic projectionOrthographic projectionTake Taylor series about (0, 0, z0) – a point on optical axis

CSE 291 J00, Winter 03 Kriegman 2003

The projection matrix for The projection matrix for orthographic projectionorthographic projection

U

VW

=

1 0 0 0

0 1 0 00 0 0 1

X

YZT

Page 7: Background: Camera models, Transforms, Radiometry

7

CSE 291 J00, Winter 03 Kriegman 2003

Euclidean Coordinate Systems

=⇔++=⇔

===

zyx

zyxOPOPzOPyOPx

Pkjikji

...

CSE 291 J00, Winter 03 Kriegman 2003

Coordinate Changes: Pure Translations

OBP = OBOA + OAP , BP = AP + BOA

Page 8: Background: Camera models, Transforms, Radiometry

8

CSE 291 J00, Winter 03 Kriegman 2003

Rotation Matrix

=

BABABA

BABABA

BABABABA R

kkkjkijkjjjiikijii

.........

[ ]AB

AB

AB kji=

=TB

A

TB

A

TB

A

kj

i

CSE 291 J00, Winter 03 Kriegman 2003

A rotation matrix is characterized by the following properties:

• Its inverse is equal to its transpose, and

• its determinant is equal to 1.

Or equivalently:

• Its rows (or columns) form a right-handedorthonormal coordinate system.

Page 9: Background: Camera models, Transforms, Radiometry

9

CSE 291 J00, Winter 03 Kriegman 2003

Coordinate Changes: Pure Rotations

[ ] [ ]

PRP

zyx

zyx

OP

ABA

B

B

B

B

BBBA

A

A

AAA

=⇒

=

= kjikji

CSE 291 J00, Winter 03 Kriegman 2003

Coordinate Changes: Rigid Transformations

ABAB

AB OPRP +=

Page 10: Background: Camera models, Transforms, Radiometry

10

CSE 291 J00, Winter 03 Kriegman 2003

Block Matrix Multiplication

=

=

2221

1211

2221

1211

BBBB

BAAAA

A

What is AB ?

++++

=2222122121221121

2212121121121111

BABABABA

BABABABAAB

Homogeneous Representation of Rigid Transformations

=

+=

=

11111P

TOPRPORP A

BA

ABAB

AA

TA

BBA

B

0

CSE 291 J00, Winter 03 Kriegman 2003

Camera parametersCamera parameters

• Issue– camera may not be at the origin, looking down the z-axis

• extrinsic parameters– one unit in camera coordinates may not be the same as one

unit in world coordinates• intrinsic parameters - focal length, principal point,

aspect ratio, angle between axes, etc.

UV

W

=

Transformationrepresenting

intrinsic parameters

1 0 0 00 1 0 0

0 0 1 0

Transformationrepresenting

extrinsic parameters

X

YZ

T

3 x 3 4 x 4

Page 11: Background: Camera models, Transforms, Radiometry

11

CSE 291 J00, Winter 03 Kriegman 2003

The reason for lensesThe reason for lenses

CSE 291 J00, Winter 03 Kriegman 2003

Pinhole too big -many directions areaveraged, blurring theimage

Pinhole too small-diffraction effects blurthe image

Generally, pinhole cameras are dark, becausea very small set of raysfrom a particular pointhits the screen.

Page 12: Background: Camera models, Transforms, Radiometry

12

CSE 291 J00, Winter 03 Kriegman 2003

Thin LensThin Lens

O

• Rotationally symmetric about optical axis.• Spherical interfaces.

Optical axis

CSE 291 J00, Winter 03 Kriegman 2003

Thin Lens: CenterThin Lens: Center

O

• All rays that enter lens along line pointing at O emerge in same direction.

F

Page 13: Background: Camera models, Transforms, Radiometry

13

CSE 291 J00, Winter 03 Kriegman 2003

Thin Lens: Focus Thin Lens: Focus

O

Parallel lines pass through the focus, F

F

CSE 291 J00, Winter 03 Kriegman 2003

Thin Lens: Image of Point Thin Lens: Image of Point

O

All rays passing through lens and starting at Pconverge upon P’

F

P

P’

Page 14: Background: Camera models, Transforms, Radiometry

14

CSE 291 J00, Winter 03 Kriegman 2003

Thin Lens: Image of Point Thin Lens: Image of Point

OF

P

P’Z’

f

Z

fzz11

'1 =−

CSE 291 J00, Winter 03 Kriegman 2003

Thin Lens: Image Plane Thin Lens: Image Plane

OF

P

P’

Image Plane

Q’

Q

A price: Whereas the image of P is in focus,the image of Q isn’t.

Page 15: Background: Camera models, Transforms, Radiometry

15

CSE 291 J00, Winter 03 Kriegman 2003

Thin Lens: Aperture Thin Lens: Aperture

O

P

P’

Image Plane • Smaller Aperture-> Less Blur

• Pinhole -> No Blur

CSE 291 J00, Winter 03 Kriegman 2003

Field of View Field of View

OField of View

Image Plane

Page 16: Background: Camera models, Transforms, Radiometry

16

CSE 291 J00, Winter 03 Kriegman 2003

Earliest Surviving PhotographEarliest Surviving Photograph

• First photograph on record, “la table service” byNicephore Niepce in 1822.

• Note: First photograph by Niepce was in 1816.

CSE 291 J00, Winter 03 Kriegman 2003

RadiometryRadiometry

• Solid Angle• Irradiance• Radiance• BRDF• Lambertian/Phong BRDF

Page 17: Background: Camera models, Transforms, Radiometry

17

CSE 291 J00, Winter 03 Kriegman 2003

Solid AngleSolid Angle

• By analogy with angle (in radians), the solid angle subtended by a region at a point is the area projected on a unit sphere centered at that point

• The solid angle subtended by a patch area dA is given by

dω =dAcosϑ

r2

CSE 291 J00, Winter 03 Kriegman 2003

Radiance Radiance • Power is energy per unit time

• Radiance: Power traveling at some point in a specified direction, per unit area perpendicular to the direction of travel, per unit solid angle

• Symbol: L(x,? )

• Units: watts per square meter per steradian (wm-2sr-1)

x

?

Page 18: Background: Camera models, Transforms, Radiometry

18

CSE 291 J00, Winter 03 Kriegman 2003

IrradianceIrradiance• How much light is arriving at a

surface?

• Sensible unit is Irradiance• Incident power per unit area not

foreshortened• This is a function of incoming angle. • A surface experiencing radiance

L(x,θ,φ) coming in from solid angle dω experiences irradiance:

• Crucial property: Total power arriving at the surface is given by adding irradiance over all incoming angles Total power is

( ) ωφφθ dxL cos,,

( )∫Ω

φθθφφθ ddxL sincos,,

NφL(x,θ,φ)

x x

CSE 291 J00, Winter 03 Kriegman 2003

Camera’s sensorCamera’s sensor

• Measured pixel intensity is a function of irradiance integrated over – pixel’s area– over a range of wavelengths– For some time

• Ideally, it’s proportional to the radiance.

∫ ∫ ∫ ∫ =t x y

dtdydxdqyxstyxEIλ

λλλ )(),(),,,(

Page 19: Background: Camera models, Transforms, Radiometry

19

CSE 291 J00, Winter 03 Kriegman 2003

Light at surfacesLight at surfaces

Many effects when light strikes a surface -- could be:

• transmitted– Skin, glass

• reflected– mirror

• scattered– milk

• travel along the surface and leave at some other point

• absorbed– sweaty skin

Assume that• surfaces don’t fluoresce

– e.g. scorpions, detergents • surfaces don’t emit light (i.e.

are cool)• all the light leaving a point is

due to that arriving at that point

Assume that• surfaces don’t fluoresce

– e.g. scorpions, detergents • surfaces don’t emit light (i.e.

are cool)• all the light leaving a point is

due to that arriving at that point

CSE 291 J00, Winter 03 Kriegman 2003

BRDFBRDFWith assumptions in previous slide• Bi-directional Reflectance Distribution

Function ρ(θin, φin ; θout, φout)

•• Ratio of incident irradiance to Ratio of incident irradiance to emitted radianceemitted radiance

• Function of– Incoming light direction:

θin , φin– Outgoing light direction:

θout , φout

n(θin,φin)

(θout,φout)

( ) ( )( ) ωφφθ

φθφθφθρ

dxLxL

xininini

outoutooutoutinin cos,;

,;,;,; =

Page 20: Background: Camera models, Transforms, Radiometry

20

CSE 291 J00, Winter 03 Kriegman 2003

CSE 291 J00, Winter 03 Kriegman 2003

Surface Reflectance ModelsSurface Reflectance Models

• Lambertian

• Phong• Physics-based

– Specular [Blinn 1977], [Cook-Torrance 1982], [Ward 1992]

– Diffuse [Hanrahan, Kreuger 1993]

– Generalized Lambertian [Oren, Nayar 1995]

– Thoroughly Pitted Surfaces [Koenderink et al 1999]

• Phenomenological[Koenderink, Van Doorn 1996]

Common Models Arbitrary Reflectance

• Non-parametric model• Anisotropic• Non-uniform over surface• BRDF Measurement [Dana et

al, 1999], [Marschner ]

Page 21: Background: Camera models, Transforms, Radiometry

21

CSE 291 J00, Winter 03 Kriegman 2003

LambertianLambertian (Diffuse) Surface(Diffuse) Surface

• BRDF is a constant called the albedo

• Emitted radiance is NOT a function of outgoing direction – i.e. constant in all directions.

• For lighting coming in single direction, emitted radiance is proportional to cosine of the angle between normal and light direction

Lr = N . ωι

CSE 291 J00, Winter 03 Kriegman 2003

LambertianLambertian reflectionreflection

• Lambertian• Matte• Diffuse

Light is radiated equally in all directions

Page 22: Background: Camera models, Transforms, Radiometry

22

CSE 291 J00, Winter 03 Kriegman 2003

SpecularSpecular Reflection: Smooth SurfaceReflection: Smooth Surface

N

CSE 291 J00, Winter 03 Kriegman 2003

Rough Rough SpecularSpecular SurfaceSurface

Phong Lobe

Page 23: Background: Camera models, Transforms, Radiometry

23

CSE 291 J00, Winter 03 Kriegman 2003