Photometric Processing

40
Photometric Processing 1

Transcript of Photometric Processing

Page 1: Photometric Processing

Photometric Processing

1

Page 2: Photometric Processing

Histogram• Probability distribution of the different grays in an image

2

Page 3: Photometric Processing

Contrast Enhancement• Limited gray levels are used• Hence, low contrast• Enhance contrast

3

Page 4: Photometric Processing

Histogram Stretching

• Monotonically increasing function between 0 and 1• c(0) = 0• c(1) = 1

4

Page 5: Photometric Processing

Results

5

Page 6: Photometric Processing

Results

6Burn out effects

Page 7: Photometric Processing

Adaptive Histogram Stretching• Choose a neighborhood• Apply histogram equalization to the pixels in that window• Replace the center pixel with the histogram equalized value• Do this for all pixels• Compute intensive• Leads to noise

7

Page 8: Photometric Processing

Results

8

Original Global

Adaptive (15x15) Adaptive (30x30)

Adaptive (75x75) Adaptive (150x150)

Page 9: Photometric Processing

Histogram Matching

9

Histogram 1 Histogram 2

x

y

x’

Page 10: Photometric Processing

Appearance Transfer

10

Page 11: Photometric Processing

Image Compositing

Mosaic Blending 11

Page 12: Photometric Processing

Image Compositing

12

Page 13: Photometric Processing

Compositing Procedure1. Extract Sprites (e.g using Intelligent Scissors in Photoshop)

Composite by David Dewey

2. Blend them into the composite (in the right order)

13

Page 14: Photometric Processing

Replacing pixels rarely works

Problems: boundries & transparency (shadows)

Binary mask

14

Page 15: Photometric Processing

Two Problems:

Semi-transparent objects

Pixels too large 15

Page 16: Photometric Processing

Alpha Channel• Add one more channel:

– Image(R,G,B,alpha)• Encodes transparency (or pixel coverage):

– Alpha = 1: opaque object (complete coverage)– Alpha = 0: transparent object (no coverage)– 0<Alpha<1: semi-transparent (partial coverage)

• Example: alpha = 0.3

16

Page 17: Photometric Processing

Alpha Blending

alphamask

Icomp = Ifg + (1-)Ibg

shadow

17

Page 18: Photometric Processing

Alpha Hacking…

No physical interpretation, but it smoothes the seams 18

Page 19: Photometric Processing

Feathering

01

01

+

=Encoding as transparency

Iblend = Ileft + (1-)Iright

19

Page 20: Photometric Processing

Affect of Window Size

0

1 left

right0

1

25

Page 21: Photometric Processing

Affect of Window Size

0

1

0

1

26

Page 22: Photometric Processing

Good Window Size

0

1

“Optimal” Window: smooth but not ghosted

27

Page 23: Photometric Processing

Type of Blending function

Linear(Only function continuity)

Spline or Cosine(Gradient continuity also)

28

Page 24: Photometric Processing

What is the Optimal Window?• To avoid seams window = size of largest prominent feature

• To avoid ghosting window <= 2*size of smallest prominent feature

Natural to cast this in the Fourier domain• largest frequency <= 2*size of smallest frequency• image frequency content should occupy one “octave” (power of two)

FFT

29

Page 25: Photometric Processing

Frequency Spread is Wide

• Idea (Burt and Adelson) Compute Band pass images for L and R Decomposes Fourier image into octaves (bands)

Feather corresponding octaves Li with Ri

Splines matched with the image frequency content Multi-resolution splines If resolution is changed, the width can be the same

Sum feathered octave images

FFT

30

Page 26: Photometric Processing

Octaves in the Spatial Domain

• Bandpass Images

Lowpass Images

31

Page 27: Photometric Processing

Pyramid Blending

0

1

0

1

0

1

Left pyramid Right pyramidblend32

Page 28: Photometric Processing

Pyramid Blending

33

Page 29: Photometric Processing

laplacianlevel

4

laplacianlevel

2

laplacianlevel

0

left pyramid right pyramid blended pyramid 34

Page 30: Photometric Processing

Laplacian Pyramid: Blending• General Approach:

1. Build Laplacian pyramids LA and LB from images A and B

2. Build a Gaussian pyramid GR from selected region R3. Form a combined pyramid LS from LA and LB using

nodes of GR as weights: LS(i,j) = GR(i,j,)*LA(I,j) + (1-GR(i,j))*LB(I,j)

4. Collapse the LS pyramid to get the final blended image

35

Page 31: Photometric Processing

Don’t Blend, CUT!

42

Page 32: Photometric Processing

Davis 1998• Segment into regionsSingle source per regionAvoid artifacts along the boundaryDijkstra’s shortest path method

43

Page 33: Photometric Processing

Eros and Freeman 2001

44

Page 34: Photometric Processing

Minimum Error Boundary

45

Page 35: Photometric Processing

Photometric Stereo

46

Page 36: Photometric Processing

Example figures• five input images taken by changing only the light position

47

Page 37: Photometric Processing

Recovered reflectance

48

Page 38: Photometric Processing

Recovered normal field

49

Page 39: Photometric Processing

Surface recovered by integration

50

Page 40: Photometric Processing

Photometric stereo example

data from: http://www1.cs.columbia.edu/~belhumeur/pub/images/yalefacesB/readme51