chapter2 image formation reading: szeliski, chapter 2

68
Chapter2 Image Formation Reading: Szeliski, Chapter 2

Upload: elizabeth-washington

Post on 25-Dec-2015

289 views

Category:

Documents


11 download

TRANSCRIPT

Page 1: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Chapter2 Image Formation

Reading: Szeliski, Chapter 2

Page 2: Chapter2 Image Formation Reading: Szeliski, Chapter 2

What are we tuned to?

The visual system is tuned to process structures typically found in the world.

Page 3: Chapter2 Image Formation Reading: Szeliski, Chapter 2

What is a natural image?

Page 4: Chapter2 Image Formation Reading: Szeliski, Chapter 2

The structure of ambient light

Page 5: Chapter2 Image Formation Reading: Szeliski, Chapter 2

What is a natural image?

Page 6: Chapter2 Image Formation Reading: Szeliski, Chapter 2

The visual system seems to be tuned to a set of images:

What is a natural image?

Page 7: Chapter2 Image Formation Reading: Szeliski, Chapter 2

The visual system seems to be tuned to a set of images:

Did you saw this image?

What is a natural image?

Page 8: Chapter2 Image Formation Reading: Szeliski, Chapter 2

The visual system seems to be tuned to a set of images:

Demo inspired from D. Field

Page 9: Chapter2 Image Formation Reading: Szeliski, Chapter 2

6 images

Not all these images are the result of sampling a real-world plenoptic function

http://www.rowland.harvard.edu/images/ModPurp.jpg

http://www.alexfito.com/

Page 10: Chapter2 Image Formation Reading: Szeliski, Chapter 2

• Proposition 1. The primary task of early vision is to deliver a small set of useful measurements about each observable location in the plenoptic function.

• Proposition 2. The elemental operations of early vision involve the measurement of local change along various directions within the plenoptic function.

• Goal: to transform the image into other representations (rather than pixel values) that makes scene information more explicit

Cavanagh, Perception 95

Page 11: Chapter2 Image Formation Reading: Szeliski, Chapter 2

What are “visual features”

Shape, color, texture, etc

Page 12: Chapter2 Image Formation Reading: Szeliski, Chapter 2

2.1 Photometric Image Formation

• Discrete color or intensity values• Where do these value come from?

– Geometry, projection– Camera optics, sensor properties – Lighting, surface properties

Page 13: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Images as Functions

Page 14: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Images as Functions• We can think of an image as a function, f, from R2 to R:

– f( x, y ) gives the intensity at position ( x, y )

– Realistically, we expect the image only to be defined over a rectangle, with a finite range:

• f: [a,b]x[c,d] [0,1]

• A color image is just three functions pasted together. We can write this as a “vector-valued” function:

( , )

( , ) ( , )

( , )

r x y

f x y g x y

b x y

Page 15: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Images as functions

Page 16: Chapter2 Image Formation Reading: Szeliski, Chapter 2

What is a digital image?

• We usually work with digital (discrete) images:– Sample the 2D space on a regular grid– Quantize each sample (round to nearest integer)

• If our samples are apart, we can write this as:• f[i ,j] = Quantize{ f(i , j ) }• The image can now be represented as a matrix of integer

values

Page 17: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Photometric Image Formation

Perspective projection Light scattering

Lens optics Bayer color filter array

Page 18: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Photometric Image Formation

Page 19: Chapter2 Image Formation Reading: Szeliski, Chapter 2

2.2 Lighting• Point light source

– Single location (small light bulb)– Infinity: the sun --directional light

• Area light source – A finite rectangular area emitting light equally in all

directions

• Environment map • Light direction to color mapping

Page 20: Chapter2 Image Formation Reading: Szeliski, Chapter 2

2.2.2 Reflectance and Shading

many models for reflectance and shadingBRDF: Bidirectional Reflectance Distribution Function

Page 21: Chapter2 Image Formation Reading: Szeliski, Chapter 2

BRDF

• BRDF is reciprocal

• For isotropic surface, no preferred directions for light transport

Page 22: Chapter2 Image Formation Reading: Szeliski, Chapter 2

BRDF

• Light existing a surface point:

Foreshortening factor

Page 23: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Diffuse Reflection

• Also called Lambertian or matte reflection– Light is scattered uniformly in all directions, i.e. – BRDF is constant:

Think about the inverse problem

Page 24: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Specular Reflection• Depends on the direction of outgoing light• Mirror surface:

– Specular reflection direction

rv

cos( ) ( )s r iv s

Page 25: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Specular Reflection• Amount of light

– Phone model – Micro-facet model

– Larger , , more specular surface with hightlights ; Smaller, softer gloss

Page 26: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Phone Shading Model

• Diffuse • Specular • Ambient:

– Does not depend on surface orientation– Color and both ambient illumination and

the object

Page 27: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Phone Shading Model

( ; ) ( ) ( )

( ) ( )( )

( ) ( )( ) e

r r a a

d i i ii

ks i r i

i

L v k L

k L v n

k L v s

The recent advent of programmable pixel shaders makes the use of more complex models feasible.

Page 28: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Example

Page 29: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Realistic Rendering

The recent advent of programmable pixel shaders makes the use of more complex models feasible.

Ioannis Gkioulekas, et al, Siggraph’13

Page 30: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Optics

• Lens, sensor• Ideal pinhole camera • More complex: focus, exposure, vignetting,

aberation,…,

Page 31: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Thin lens model Thin lens: low, equal curvature on both sides

Optical axis

Page 32: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Thin lens model

object

Focus plane

Page 33: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Thin lens model

object

Circle of confusion

Pinhole camera

Page 34: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Pinhole Camera Model

object

Page 35: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Pinhole Camera Model

object

Page 36: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Pinhole Camera Model

object

Page 37: Chapter2 Image Formation Reading: Szeliski, Chapter 2

2.3 3D to 2D Projection

• 3D perspective: the most commonly used projection in computer vision and computer graphics

3D view of world perspective

book: pp32-60

Page 38: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Pinhole Camera Model

object

xfu

zyf

vz

Page 39: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Pinhole Camera Model

object

Page 40: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Pinhole Camera Model

• Using homogeneous (projective) coordinate –

0 0 0/

0 0 0/

0 0 1 01 1

0 0 0 1 1

f xu fx z

f yw v z fy z

z

wx = Kp

xfu

zyf

vz

Page 41: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Camera Intrinsics• Imperfect camera• image sensor

• s: possible skew between sensor axes• a: aspect ratio • : optical center• F : focal length

0

0 0 1

x

y

f s c

af c

K

. ., ( , ) ( / 2, / 2)x ye g c c W H

( , )x yc cFive intrinsic parameters

Page 42: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Camera Intrinsics

• Focal length• Actual focal length, e.g. 18~55mm, • Conventional sensor width: 35 mm• Digital Image: integer values, [0,W) x [0,H)

Focal length Sensor width

Field of view

Page 43: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Extrinsic Parameters

• World Coordinate system to Camera Coordinate system

[c wp R | t]pExtrinsic parameters

j

i

kj

i

k

O

C

1wC R t

Page 44: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Extrinsic Parameters

wx = Kpwith

[ ww x K R | t]p

[M K R | t]Camera Matrix

Page 45: Chapter2 Image Formation Reading: Szeliski, Chapter 2

2.3 Digital Camera

• Process chart

Page 46: Chapter2 Image Formation Reading: Szeliski, Chapter 2

2.3 Digital Camera

• Process chart

Page 47: Chapter2 Image Formation Reading: Szeliski, Chapter 2

2.3.2 Color

• Light from different parts of the spectrum is somehow integrated into discrete RGB color values

[ ww x K R | t]p

Page 48: Chapter2 Image Formation Reading: Szeliski, Chapter 2

2.3.2 Color

• Primary and Secondary Colors• Additive colors (projector, monitor)• Subtractive colors (printing, printing)

Page 49: Chapter2 Image Formation Reading: Szeliski, Chapter 2

CIE color matching

• Commission Internationale d’Eclairage (CIE)• Color matching experiments

pure colors to the R=700.0nm, G=546.1nm, and B=435.8nm

Page 50: Chapter2 Image Formation Reading: Szeliski, Chapter 2

XYZ Color Space

Y=1 for pure R (1,0,0)

Page 51: Chapter2 Image Formation Reading: Szeliski, Chapter 2

XYZ Color Space

• Y=1 for (1,1,1)

Page 52: Chapter2 Image Formation Reading: Szeliski, Chapter 2

XYZ Color Space

• Chromaticity coordinates

• Yxy (luminance plus the two most distinctive chrominance components)

Page 53: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Chromaticity Diagram

Page 54: Chapter2 Image Formation Reading: Szeliski, Chapter 2

L*a*b* Color Space

• Human visual system is roughly logarithmic• Differences in luminance or chrominance are

more perceptually uniform• Non-linear mapping from XYZ to L*a*b* space

Page 55: Chapter2 Image Formation Reading: Szeliski, Chapter 2

L*a*b* Color Space

Page 56: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Color Cameras

• Spectral response function

• Make sure to generate the standard color values

HDTV, new monitors, new standard ITU-R BT.709

Page 57: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Color Filter Arrays

• Separate sensors for three primary colors

Bayer RGB pattern: (a) color filter array layout; (b) interpolated pixel values

Page 58: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Bayer Pattern, 1976

• Green filters are twice as many as red and blue filters

• Human visual system is much more sensitive to high frequency detail in luminance than chrominance

• Luminance is mostly determined by green value

Page 59: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Color Balance

• Move the white point of a given image closer to pure white (R=G=B)– Multiply RGB values by a different factor – Color twist, general 3x3 transform matrix– Exercise 2.9 (optional)

Page 60: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Gamma

• CRT Monitor: non-linear relationship between the voltage and the resulting brightness is determined by gamma

• Pre-map the sensed luminance Y through an inverse gamma

2.2

10.45

Page 61: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Gamma Compensation

Noise added during transmission or quantization will be reduced in the darker regions of the signal where it was more visible

Page 62: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Other Color Spaces

• XYZ, RGB for spectral content of color signals• Others for image coding and computer

graphics– YUV, YCrCb, HSV

Page 63: Chapter2 Image Formation Reading: Szeliski, Chapter 2

YUV Color Space

• YUV for video transmission– Luma

– Two lower frequency chroma channels

Page 64: Chapter2 Image Formation Reading: Szeliski, Chapter 2

YCrCb Color Space

• Closely related to YUV• Different scale factor to fit within the 8-bit

range for digital signals

• Useful for careful image de-blocking, et al.

Page 65: Chapter2 Image Formation Reading: Szeliski, Chapter 2

HSV Color Space

• Hue: direction around a color wheel

• Saturation: scaled distance from the diagonal

• Value: mean or maximum color value

More suitable for color picking

Page 66: Chapter2 Image Formation Reading: Szeliski, Chapter 2

Color Ratios

• Suitable for algorithms that only affect the value/luminance and not saturation or hue

• After processing, scale rgb back by the color ratio Ynew/Yold

Color FAQ, http://www.poynton.com/ColorFAQ.html

Page 67: Chapter2 Image Formation Reading: Szeliski, Chapter 2
Page 68: Chapter2 Image Formation Reading: Szeliski, Chapter 2

2.3.3 Compression

• Converting signal into YCbCr (or related variant)

• Compress the luminance signal with higher fidelity than the chrominance signal