introduction to image processing and computer vision...

99
Introduction to Image Processing and Computer Vision -- Panoramas and Blending -- Winter 2013/14 Ivo Ihrke

Upload: others

Post on 08-Oct-2019

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Introduction to Image Processing and Computer Vision

-- Panoramas and Blending --

Winter 2013/14

Ivo Ihrke

Page 2: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Panoramas

Page 3: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Mosaics and Panoramas

- Outline

- Perspective Panoramas

- Hardware-Based

- Software-Based (Multiple Photographs)

- Image registration

- Image blending

Page 4: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Why Mosaic?

Are you getting the whole picture?

– Compact Camera FOV = 50 x 35°

Slide from Brown & Lowe

Page 5: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Why Mosaic?

Are you getting the whole picture?

– Compact Camera FOV = 50 x 35°

– Human FOV = 200 x 135°

Slide from Brown & Lowe

Page 6: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Why Mosaic?

Are you getting the whole picture?

– Compact Camera FOV = 50 x 35°

– Human FOV = 200 x 135°

– Panoramic Mosaic = 360 x 180°

Slide from Brown & Lowe

Page 7: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Single vs. Multiple Viewpoint

Single-viewpoint

– Necessary for creating pure perspective images.

– Many vision algorithms assume pinhole cameras.

– Images that aren’t perspective images look distorted.

Page 8: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

In the old days of film photography

• Single-viewpoint

• Single exposure

• Standard 35mm film

Page 9: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Omnidirectional Catadioptric Cameras

O-360 EyeSee360

catadioptric = mirror + lens system

Page 10: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

images: CAVE lab

Images of an Omnidirectional Camera

Page 11: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Catadioptric System – Full Texture

K

[Kuthirummal 2006]

Page 12: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Cata-Fisheye Camera

[Krishnan and Nayhar 2008]

Page 13: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Catadioptric System – Stereo

objectcenter

object’

Page 14: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Multi-camera, Single-viewpoint ?

PointGrey LadybugImmersive Media “Dodeca2000”

Page 15: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Lens image circle “scanning”

Medium format lens

(6 cm x 6 cm

image circle)

Manual Scan plate

APS-C

(2.4 cm x 1.6 cm)

camera

Page 16: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Perspective Panoramas

Registration

Page 17: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Page 18: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Single Center of Projection

– Take a sequence of images from the same position

─ Rotate the camera about its optical center

– Compute transformation between second image and first

– Transform the second image to overlap with the first

– Blend the two together to create a mosaic

– If there are more images, repeat

…why don’t we need the 3D geometry?

Page 19: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013mosaic PP

Image Reprojection

– The images are reprojected onto a common plane

– The mosaic is formed on this plane

– Mosaic is a synthetic wide-angle camera

Page 20: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

A pencil of rays contains all views

real

camerasynthetic

camera

Can generate any synthetic camera view

as long as it has the same center of projection!

scene

Page 21: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

No-parallax point

Same center of projection can be ensured by rotating

camera-lens setup around the entrance pupil (and NOT the nodal point!).

Page 22: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Image reprojection

How to relate two images from the samecamera center?

Images contain the same informationalong the same ray.

Use 2D image warp

Page 23: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Taxonomy of Projective Transformations

Page 24: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Perspective Transformation

3D to 2D projection

– Point in world coordinates P(xe ,ye ,ze)

– Distance center of projection – image plane D(=f)

– Image coordinates (xs ,ys)

Page 25: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Homogeneous Coordinates: Point Representation

(x’,y’)

x=(x,y,w)

w=1

y' =y

wx' =

x

w

Page 26: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Homogeneous Coordinates: Point Representation

Page 27: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Hom. Coord.: Line Representation

ax+by+c=0

l=(a,b,c)

Page 28: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Hom. Coordinates: Point on Line

0 lx

l=(a,b,c)

x=(x,y,w)

Page 29: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Hom. Coordinates: Intersection of Lines

xll '

ll’

x

Page 30: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Hom. Coordinates: Line through 2 Points

l=(a,b,c)

x=(x,y,w)

x’=(x’,y’,w’)

lxx '

Page 31: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Embedding of R2 into P2

– For the time being

– Representation of transformations by 3x3 matrices

– Mathematical trick

─ convenient representation to express rotations and translationsas matrix multiplications

─ Easy to find line through points, point-line/line-line intersections

– Easy representation of projective transformation (homography)

Homogeneous Coordinates for 2D

WY

WX

W

Y

X

y

x

y

xR

/

/ and ,P

1

22

Page 32: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Projective Transformations

Projecting one plane onto another using one projection center

Page 33: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Examples of Projective Transformations

• Projection between 2 images via a world plane

Concatenating two projective transforms gives another projective transform

• Projection between 2 images with the same camera center

Rotating camera or camera with varying focal length

• Shadow projection of a plane onto another plane

Page 34: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Taxonomy of Projective Transformations

Page 35: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Taxonomy of Projective Transformations

Page 36: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Distortions under Central Projection

• Similarity: circle remains circle, square remains square

line orientation is preserved

• Affine: circle becomes ellipse, square becomes rhombus

parallel lines remain parallel

• Projective: imaged object size depends on distance from camera

parallel lines converge

Page 37: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Removing Projective Distortion

Projective transformation in inhomogeneous form

4 general point correspondences (x,y ->x’,y’) on the planar facade

lead to eight linear equations of the type

Sufficient to solve for H up to multiplicative factor

Page 38: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

The Direct Linear Transform (DLT) Algorithm

Given: 4 2D point correspondences

Objective: estimate the projective transform matrix H

3

2

1

x

x

x

ix

'

'

'

'

3

2

1

x

x

x

ix

Page 39: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

The DLT Algorithm II

Re-phrasing H

Re-ording into h vector

gives

0

Estimating matrix H from point correspondences is equivalent to

i

i

i

w

y

x

ix

'

'

'

'

i

i

i

w

y

x

ix

i

i

i

w

y

x

hhh

hhh

hhh

333231

232221

131211

Page 40: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

The DLT Algorithm III

Only rows 1 and 2 are linearly independent omit row 3

Inhomogeneous solution: set one matrix entry equal to 1 (e.g. h33)

Solve by Gaussian elimination or least-squares techniques

i

i

i

w

y

x

ix

'

'

'

'

i

i

i

w

y

x

ix

Page 41: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Estimating Homographies

Page 42: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Homography or not ?

• Coincidences between 3D points

at different depths are preserved

• Pure camera rotation

about camera center

2D Homography

• Different depths are imaged to

different image positions

• Camera rotates and translates

Motion Parallax, no Homography

Page 43: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Panoramic Mosaicing

Rotation about camera center: homography

• choose one image as reference

• compute homography to map neighboring

image to reference image plane

• projectively warp image,

add to reference plane

• repeat for all images

bow tie shape

Page 44: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Alternative Panoramas

Project images onto different

surfaces:

Images www.panoguide.com

Cylindrical

Spherical

Cubic (think of cube map)

Page 45: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Example – My former office

Register left and right image to the middle one using two homographies

Page 46: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Example – My former office

all images registered to the central one (2 homographies)

Page 47: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Example – My former office

seams

ghost

Page 48: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Image Blending

Page 49: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

« Moyenne » entre deux images

Pas la moyenne de l’image des objets…

…mais une image de la moyenne des objets

et une moyenne évoluant au cours du temps.

Comment savoir ce qu’est la bonne moyenne ?

On n’en sait rien !

Mais les artistes peuvent nous aider

49

Linear Blending

Page 50: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Interpolation de l’image complète

It = (1-t) * I1 + t * I2

Mais que se passe-t-il si les images ne sont pas alignées ?

50

Fondu « cross-dissolve »

Page 51: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Aligner puis faire le fondu

Page 52: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Image Blending

slides from Alexei Efros

Page 53: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Feathering

01

01

+

Blending

=

Page 54: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Effect of Window Size

0

1 left

right

0

1

Page 55: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Effect of Window Size

0

1

0

1

Page 56: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Good Window Size

0

1

“Optimal” Window: smooth but not ghosted

Page 57: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

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

– do blending in different frequency bands

Page 58: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Bandpass Computations

Page 59: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Bandpass Computations

filtered images

Fourier space filter shape

low-pass 1st octave 2nd octave 3rd octave

Octave = doubling frequency

Page 60: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Lowpass

Page 61: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

First Octave

Page 62: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Second Octave

Page 63: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Third Octave

Page 64: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Zoom-In 3rd Octave - Jpeg-Artifacts

Page 65: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Reconstruction

filtered images

Fourier space filter shape

low-pass 1st octave 2nd octave 3rd octave

+ + + =

+ + + =

full freq. range

originallow-pass 1st octave 2nd octave 3rd octave

Page 66: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Spatial Domain Interpretation /Implementation

original

Page 67: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

What does blurring take away?

smoothed (5x5 Gaussian)

Page 68: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

High-Pass Filter

smoothed minus original

Page 69: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Image Pyramids

mipmap or precursor of wavelets – Gaussian Pyramid

Page 70: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Create by Image Sub-sampling

Throw away every other row and

column to create a 1/2 size image

1/4

1/8

Page 71: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Improper Image Sub-sampling

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

Why does this look so bad?

1/2

Aliasing!

Page 72: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Proper Sub-Sampling

First, band-limit, then sub-sample !

Repeat

– Filter

– Subsample

Until minimum resolution reached

Whole pyramid is only 4/3 the size of the original image!

filter mask

Page 73: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Implementation by Gaussian pre-filtering

G 1/4

G 1/8

Gaussian 1/2

Filter size should double for each ½ size reduction.

Page 74: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Subsampling with Gaussian pre-filtering

G 1/4 G 1/8Gaussian 1/2Solution: filter the image, then subsample

Filter size should double for each ½ size reduction.

Page 75: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Compare with...

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

Page 76: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Band-pass filtering

Laplacian Pyramid (subband images) Created from Gaussian pyramid by subtraction

Gaussian Pyramid (low-pass images)

Page 77: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Laplacian Pyramid

How can we reconstruct (collapse) this pyramid into the original image?

Need this!Original image

Page 78: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Laplacian Pyramid

Need this!

Page 79: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Pyramid Blending

0

1

0

1

0

1

Left pyramid Right pyramidblend

Page 80: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Blending Apples and Oranges

original apple original orange

blend scale 1 blend scale 2 blend scale 3 pyramid blending

Page 81: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Blending Apples and Oranges

blend scale 1 pyramid blending

Page 82: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Blending Apples and Oranges

blend scale 2 pyramid blending

Page 83: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Blending Apples and Oranges

blend scale 3 pyramid blending

Page 84: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Different Frequency Bands

Page 85: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Simplification: Two-band Blending

Brown & Lowe, 2003

– Only use two bands: high freq. and low freq.

– Blends low freq. smoothly

– Blend high freq. with no smoothing: use binary mask

Page 86: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Low frequency (l > 2 pixels)

High frequency (l < 2 pixels)

2-band Blending

Page 87: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Linear Blending

Page 88: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

2-band Blending

Page 89: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Still Some Artifacts Left…

Ghosting—objects move in the scene.

Differing exposures between images.

– Pyramid blending does not solve this.

Page 90: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

De-Ghosting

In regions with differences don’tblend - crop.

[Uyttendaele et al. 2001]

Page 91: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Gradient Domain Blending

In Pyramid Blending, we decomposed our image into 2nd derivatives (Laplacian) and a low-res image

Let us now look at 1st derivatives (gradients):

No need for low-res image

– captures everything (up to a constant)

– easy to deal with low-frequency differences

Idea:

– Differentiate

– Blend

– Reintegrate

Page 92: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Poisson Image Editing

original mask

Poisson Inpainting result

Page 93: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Poisson Image Editing

original

copy and paste

original to paste

Poisson Image Editing result

Page 94: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Gradient Domain Blending (2D)

– Take partial derivatives dx and dy (the gradient field)

– Fiddle around with them (copy, smooth, blend, feather, etc)

– Reintegrate

─ But now integral(dx) might not equal integral(dy)

– Find the most agreeable solution

─ Equivalent to solving Poisson equation

Page 95: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Gradient Domain Blending (2D)

- But now integral(dx) might not equal integral(dy):

INCONSISTENCY

- There is no UNIQUE SOLUTON!

- Poisson-solver (most widely used) can produce artifacts.

This is how it looks like when we directly integrate an inconsistent gradient field (row-by-row in this case)

+10 ¹ +70

Page 96: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Comparisons [Levin et al 2004]

Page 97: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

End

Page 98: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

Acknowledgements

Many slides by Steve Seitz, Rick Szeliski

– http://szeliski.org/book

Histogram slides by Samir H. Abdul-Jauwad

Some histogram-matching results by Paul Bourke

More slides by Pierre Bénard, HendrikLensch

Page 99: Introduction to Image Processing and Computer Vision ...giana.mmci.uni-saarland.de/website-template/lectures/IntroIPandCV/2013/... · Ivo Ihrke / Winter 2013 Introduction to Image

Ivo Ihrke / Winter 2013

The End