Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded...

29
CSE486 Robert Collins Lecture 10: Pyramids and Scale Space

Transcript of Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded...

Page 1: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

Lecture 10:Pyramids and Scale Space

Page 2: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

Recall

• Cascaded Gaussians– Repeated convolution by a smaller Gaussian

to simulate effects of a larger one.

• G*(G*f) = (G*G)*f [associativity]

Page 3: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

Example: Cascaded Convolutions

[1 1] * [1 1] --> [1 2 1][1 1] * [1 2 1] --> [1 3 3 1][1 1] * [1 3 3 1] --> [1 4 6 4 1]..and so on…

1 11 2 1

1 3 3 11 4 6 4 1

1 5 10 10 5 1and so on…

Pascal’s Triangle

Page 4: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

Aside: Binomial Approximation

1 11 2 1

1 3 3 11 4 6 4 1

1 5 10 10 5 1and so on…

Pascal’s Triangle

BinomialCoefficients

Page 5: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

Aside: Binomial Approximation

Look at odd-length rows of Pascal’s triangle:

1 11 2 1

1 3 3 11 4 6 4 1

1 5 10 10 5 1and so on…

[1 2 1]/4 - approximatesGaussian with sigma=1/sqrt(2)

[1 4 6 4 1]/16 - approximatesGaussian with sigma=1

An easy way to generate integer-coefficientGaussian approximations.

Page 6: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

From Homework 2

Page 7: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

More about Cascaded Convolutions

Fun facts:The distribution of the sum of two random variablesX + Y is the convolution of their two distributions

Given N i.i.d. random variables, X1 … XN, the distributionof their sum approaches a Gaussian distribution (aka thecentral limit theorem)

Therefore:The repeated convolution of a (nonnegative)filter with itself takes on a Gaussian shape.

(for the mathematically inclined)

Page 8: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins Gaussian Smoothing at

Different Scales

original sigma = 1

Page 9: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

original sigma = 3

Gaussian Smoothing atDifferent Scales

Page 10: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins Gaussian Smoothing at

Different Scales

original sigma = 10

Page 11: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins Idea for Today:

Form a Multi-Resolution Representation

original

sigma = 10

sigma = 3

sigma = 1

Page 12: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

Pyramid Representations

Because a large amount of smoothing limitsthe frequency of features in the image, we donot need to keep all the pixels around!

Strategy: progressively reduce the number ofpixels as we smooth more and more.

Leads to a “pyramid” representation if wesubsample at each level.

Page 13: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

Gaussian Pyramid

• Synthesis: Smooth image with a Gaussian anddownsample. Repeat.

• Gaussian is used because it is self-reproducing(enables incremental smoothing).

• Top levels come “for free”. Processing costtypically dominated by two lowest levels(highest resolution).

Page 14: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

Gaussian Pyramid

High res

Lowres

Page 15: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins Emphasis: Smaller Images

have Lower Resolution

Page 16: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

Generating a Gaussian Pyramid

Basic Functions:Blur (convolve with Gaussian to smooth image)

DownSample (reduce image size by half)

Upsample (double image size)

Page 17: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

Generating a Gaussian Pyramid

Basic Functions:Blur (convolve with Gaussian to smooth image)

DownSample (reduce image size by half)

Upsample (double image size)

Page 18: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

Downsample

By the way: Subsampling is a bad idea unless you have previously blurred/smoothed the image! (because it leads to aliasing)

Page 19: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

To Elaborate: Thumbnails

original image262x195

downsampled (left)vs. smoothed then

downsampled (right)

131x97

65x48

32x24

Page 20: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

To Elaborate: Thumbnails

original image262x195

131x97

downsampled (left)vs. smoothed then

downsampled (right)

Page 21: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

To Elaborate: Thumbnails

original image262x195

downsampled (left)vs. smoothed then

downsampled (right)

65x48

Page 22: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

To Elaborate: Thumbnails

original image262x195

downsampled (left)vs. smoothed then

downsampled (right)

32x24

Page 23: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

Upsample

How to fill in the empty values?Interpolation:• initially set empty pixels to zero• convolve upsampled image with Gaussian filter! e.g. 5x5 kernel with sigma = 1.• Must also multiply by 4. Explain why.

Page 24: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

Specific ExampleFrom Crowley et.al., “Fast Computation of Characteristic Scale using a Half-Octave Pyramid.” Proc International Workshop on Cognitive Vision (CogVis), Zurich, Switzerland, 2002.

General idea: cascaded filtering using [1 4 6 4 1] kernel to generate a pyramid with two images per octave (power of 2 change in resolution). When we reach a full octave, downsample the image.

blur blur

blur blur

downsample

Page 25: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

Effective Sigma at Each Level

Crowley etal.

Page 26: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

Effective Sigma at Each Level

CAN YOUEXPLAIN HOWTHESE VALUESARISE?

Page 27: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins

Basic idea: different scales are appropriate for describing differentobjects in the image, and we may not know the correct scale/sizeahead of time.

Concept: Scale Space

Page 28: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins Example: Detecting “Blobs” at

Different Scales.

But first, we have to talkabout detecting blobsat one scale...

Page 29: Robert Collins CSE486rtc12/CSE486/lecture10.pdfCSE486 Robert Collins More about Cascaded Convolutions Fun facts: The distribution of the sum of two random variables X + Y is the convolution

CSE486Robert Collins