3d imaging midterm review. pinhole cameras abstract camera model - box with a small hole in it ...

65
3D IMAGING Midterm Review

Upload: lizbeth-cole

Post on 13-Dec-2015

223 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

3D IMAGING

Midterm Review

Page 2: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Pinhole cameras

Abstract camera model - box with a small hole in it

Pinhole cameras work in practice

Page 3: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

The 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) ( fxz

, fyz)

Prove at home

Page 4: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

The camera matrix

Homogenous coordinates for 3D point are (X,Y,Z,T) Homogenous coordinates for point in image are

(U,V,W)

U

V

W

1 0 0 0

0 1 0 0

0 0 1f 0

X

Y

Z

T

Page 5: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice
Page 6: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Properties of “thin” lens (i.e., ideal lens)

Light rays passing through the center are not deviated.

Light rays passing through a point far away from the center are deviated more.

focal point

f

Page 7: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Thin lens equation (cont’d)

fuv

1 1 1u v f+ =

image

Combining the equations(do at home):

Page 8: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Thin lens equation (cont’d)

The thin lens equation implies that only points at distance u from the lens are “in focus” (i.e., focal point lies on image plane).

Other points project to a “blur circle” or “circle of confusion”

in the image (i.e., blurring occurs).

“circle of confusion”

Page 9: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Depth of field

Changing the aperture size or focal length affects depth of field

f / 5.6

f / 32

Page 10: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Basic models of reflection

Specular: light bounces off at the incident angle E.g., mirror

Diffuse: light scatters in all directions E.g., brick, cloth, rough wood

incoming lightspecular reflection

ΘΘ

incoming light

diffuse reflection

Page 11: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Bidirectional Reflectance Distribution Function (BDRF)

);,,,( eeii

surface normal

( , )

( , )e e e

i i i

L

E

• Model of local reflection that tells how bright a surface appears when viewed from one direction when light falls on it from another

Page 12: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

The Retina

Cross-section of eye

Ganglion cell layer

Bipolar cell layer

Receptor layer

Pigmentedepithelium

Ganglion axons

Cross section of retina

Page 13: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

© Stephen E. Palmer, 2002

Cones cone-shaped less sensitive operate in high light color vision

Two types of light-sensitive receptors

cone

rod

Rods rod-shaped highly sensitive operate at night gray-scale vision

Page 14: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Color Vision.

400 450 500 550 600 650

RE

LAT

IVE

AB

SO

RB

AN

CE

(%

)

WAVELENGTH (nm.)

100

50

440

S

530 560 nm.

M L

Page 15: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

The raster image (pixel matrix)

0.92 0.93 0.94 0.97 0.62 0.37 0.85 0.97 0.93 0.92 0.990.95 0.89 0.82 0.89 0.56 0.31 0.75 0.92 0.81 0.95 0.910.89 0.72 0.51 0.55 0.51 0.42 0.57 0.41 0.49 0.91 0.920.96 0.95 0.88 0.94 0.56 0.46 0.91 0.87 0.90 0.97 0.950.71 0.81 0.81 0.87 0.57 0.37 0.80 0.88 0.89 0.79 0.850.49 0.62 0.60 0.58 0.50 0.60 0.58 0.50 0.61 0.45 0.330.86 0.84 0.74 0.58 0.51 0.39 0.73 0.92 0.91 0.49 0.740.96 0.67 0.54 0.85 0.48 0.37 0.88 0.90 0.94 0.82 0.930.69 0.49 0.56 0.66 0.43 0.42 0.77 0.73 0.71 0.90 0.990.79 0.73 0.90 0.67 0.33 0.61 0.69 0.79 0.73 0.93 0.970.91 0.94 0.89 0.49 0.41 0.78 0.78 0.77 0.89 0.99 0.93

Page 16: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Color Images: Multi-chip

wavelengthdependent

Page 17: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Color Images: Bayer Grid

Estimate RGBat ‘G’ cells from neighboring values

Slide by Steve Seitz

Page 18: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

HSV Color Space

Page 19: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Moravec corner detectorChange of intensity for the shift [u,v]:

2,

( , ) ( , ) ( , ) ( , )x y

E u v w x y I x u y v I x y

IntensityShifted intensity

Window function

Four shifts: (u,v) = (1,0), (1,1), (0,1), (-1, 1)Look for local maxima in min{E}

Page 20: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Harris Corner Detector

Page 21: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0

0 0 0 90 90 90 90 90 0 0

0 0 0 90 90 90 90 90 0 0

0 0 0 90 90 90 90 90 0 0

0 0 0 90 0 90 90 90 0 0

0 0 0 90 90 90 90 90 0 0

0 0 0 0 0 0 0 0 0 0

0 0 90 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0

0

0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0

0 0 0 90 90 90 90 90 0 0

0 0 0 90 90 90 90 90 0 0

0 0 0 90 90 90 90 90 0 0

0 0 0 90 0 90 90 90 0 0

0 0 0 90 90 90 90 90 0 0

0 0 0 0 0 0 0 0 0 0

0 0 90 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0

],[],[],[,

lnkmflkgnmhlk

[.,.]h[.,.]f

Image filtering

111

111

111

],[g

Page 22: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Practice with linear filters

Original

111

111

111

000

020

000

-

Sharpening filter- Accentuates differences with

local average

Source: D. Lowe

Page 23: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Other filters

-101

-202

-101

Vertical Edge(absolute value)

Sobel

Page 24: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Spatially-weighted average

0.003 0.013 0.022 0.013 0.0030.013 0.059 0.097 0.059 0.0130.022 0.097 0.159 0.097 0.0220.013 0.059 0.097 0.059 0.0130.003 0.013 0.022 0.013 0.003

5 x 5, = 1

Important filter: Gaussian

Page 25: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Smoothing with Gaussian filter

Page 26: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Smoothing with box filter

Page 27: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

A sum of sines

Our building block:

Add enough of them to get any signal f(x) you want!

xAsin(

Page 28: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Fourier analysis in images

Intensity Image

Fourier Image

cos( )A ux vy

Page 29: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Gaussian

Page 30: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Box Filter

Page 31: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Source: S. Marschner

1D example (sinewave):

Aliasing problem

Page 32: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Aliasing in video

Page 33: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Aliasing in graphics

Page 34: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Subsampling without pre-filtering

1/4 (2x zoom) 1/8 (4x zoom)1/2

Page 35: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Subsampling with Gaussian pre-filtering

G 1/4 G 1/8Gaussian 1/2

Page 36: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Template matching

Goal: find in image

Main challenge: What is a good similarity or distance measure between two patches? Correlation Zero-mean correlation Sum Square Difference Normalized Cross

Correlation

Page 37: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Normalized Cross Correlation

mean image patchmean template

5.0

,

2,

,

2

,,

)],[()],[(

)],[)(],[(

],[

lknm

lk

nmlk

flnkmfglkg

flnkmfglkg

nmh

Page 38: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Matching with filters (Normalized Cross Correlation)

Input Normalized X-Correlation Thresholded Image

True detections

Page 39: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Reducing salt-and-pepper noise by Gaussian smoothing

3x3 5x5 7x7

Page 40: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Alternative idea: Median filtering• A median filter operates over a

window by selecting the median intensity in the window

• Is median filtering linear?

Page 41: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Median filterSalt-and-pepper noise Median filtered

Page 42: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Effects of noise• Consider a single row or column of the image

– Plotting intensity as a function of position gives a signal

Where is the edge?

Page 43: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Solution: smooth first

• To find edges, look for peaks in )( gfdx

d

f

g

f * g

)( gfdx

d

Source: S. Seitz

Page 44: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

• Differentiation is convolution, and convolution is associative:

• :

gdx

dfgf

dx

d )(

Derivative theorem of convolution

gdx

df

f

gdx

d

Page 45: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Derivative of Gaussian filter

Page 46: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Final Canny Edges

Page 47: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Alper Yilmaz, CAP5415, Fall 2004

47

Estimating Camera Parameters

11, yx 111 ,, ZYX

222 ,, ZYX

333 ,, ZYX

NNN ZYX ,,

22 , yx

33 , yx

NN yx ,

Page 48: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Ames Room

Page 49: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Julesz: had huge impact because it showed that recognition not needed for stereo.

Page 50: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Epipolar Constraint

Page 51: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Basic Stereo Derivations

Disparity: 21 xxd

d

fBZ

Page 52: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

We can always achieve this geometry with image rectification

Image Reprojection reproject image planes onto

common plane parallel to line between optical centers

(Seitz)

Page 53: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Using these constraints we can use matching for stereo

For each epipolar lineFor each pixel in the left image

• compare with every pixel on same epipolar line in right image

• pick pixel with minimum match cost• This will never work, so:

Improvement: match windows

Page 54: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Stereo matching as energy minimizationI1 I2 D

• Energy functions of this form can be minimized using graph cuts

Y. Boykov, O. Veksler, and R. Zabih, Fast Approximate Energy Minimization via Graph Cuts, PAMI 2001

W1(i ) W2(i+D(i )) D(i )

)(),;( smooth21data DEIIDEE 2

,neighborssmooth )()(

ji

jDiDE 221data ))(()( i

iDiWiWE

Page 55: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Active stereo with structured light

L. Zhang, B. Curless, and S. M. Seitz. Rapid Shape Acquisition Using Color Structured Light and Multi-pass Dynamic Programming. 3DPVT 2002

Page 56: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Random Dot

Page 57: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Time to Collision

f

L

v

L

Do

l(t)

t=0t

D(t)

And time to collision:

Can be directly measured from image

Can be found, without knowing L or Do or v !!

Page 58: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

2D Motion Field

Page 59: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

2D Optical Flow

Apparent motion of image brightness pattern

Page 60: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

2D Motion Field and 2D Optical Flow Motion field: projection of 3D motion vectors on image plane

• Optical flow field: apparent motion of brightness patterns

• We equate motion field with optical flow field

0 0

00

Object point has velocity , induces in imagei

ii

P

d d

dt dt

v v

r rv v

Page 61: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Brightness Constancy Equation

Taking derivative wrt time:

Page 62: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Normal Motion/Aperture Problem

Page 63: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Barber Pole Illusion

Page 64: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Full 3D Rotation

cossin0

sincos0

001

cos0sin

010

sin0cos

100

0cossin

0sincos

R

• Any rotation can be expressed as combination of three rotations about three axes.

100

010

001TRR

• Rows (and columns) of R are orthonormal vectors.

• R has determinant 1 (not -1).

Page 65: 3D IMAGING Midterm Review. Pinhole cameras  Abstract camera model - box with a small hole in it  Pinhole cameras work in practice

Velocity Model in 2D

Perspective projection

321

213

132

VXYZ

VZXY

VYZX

Z

Yfy

Z

Xfx

yv

xu

212331

2

2213

32

1

)(

)(

yf

xyf

yZ

Vx

Z

Vfv

xf

xyf

yxZ

V

Z

Vfu