lecture 2: 2d edge detection and moving beyond edges

111
Lecture 2: 2D edge detection and moving beyond edges Dr. Richard E. Turner ([email protected]) May 2, 2014

Upload: others

Post on 07-Jan-2022

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 2: 2D edge detection and moving beyond edges

Lecture 2: 2D edge detectionand moving beyond edges

Dr. Richard E. Turner ([email protected])

May 2, 2014

Page 2: Lecture 2: 2D edge detection and moving beyond edges

Recap of last lecture (big picture)

• goal: match query image to a stored library of reference images

• cannot use raw pixels:

– too many– too unstable (lighting, shadow, occlusion, scale change, perspective

change...)

• three step plan:

1. identify interest points (easy to identify structures): visual words2. extract local feature descriptors (characterises interest points): word

definitions3. match images based by comparing sets of feature descriptors

Page 3: Lecture 2: 2D edge detection and moving beyond edges

Recap of last lecture (edge detection)

Page 4: Lecture 2: 2D edge detection and moving beyond edges

Recap of last lecture (edge detection)

image

Page 5: Lecture 2: 2D edge detection and moving beyond edges

Recap of last lecture (edge detection)

image Gaussianblur

Page 6: Lecture 2: 2D edge detection and moving beyond edges

Recap of last lecture (edge detection)

image Gaussianblur

differentiate

Page 7: Lecture 2: 2D edge detection and moving beyond edges

Recap of last lecture (edge detection)

image Gaussianblur

differentiate locateextrema

Page 8: Lecture 2: 2D edge detection and moving beyond edges

Recap of last lecture (edge detection)

image Gaussianblur

differentiate locateextrema

threshold

Page 9: Lecture 2: 2D edge detection and moving beyond edges

Recap of last lecture (edge detection)

image Gaussianblur

differentiate locateextrema

threshold

convolutionlowpass filter

o frequency

Page 10: Lecture 2: 2D edge detection and moving beyond edges

Recap of last lecture (edge detection)

image Gaussianblur

differentiate locateextrema

threshold

convolutionlowpass filter

convolutionhighpass filter

o o frequency

Page 11: Lecture 2: 2D edge detection and moving beyond edges

Recap of last lecture (edge detection)

image Gaussianblur

differentiate locateextrema

threshold

convolutionlowpass filter

convolutionhighpass filter

o o

X frequency

=

Page 12: Lecture 2: 2D edge detection and moving beyond edges

Recap of last lecture (edge detection)

image Gaussianblur

differentiate locateextrema

threshold

convolutionlowpass filter

convolutionhighpass filter

bandpass filter

o o

X frequency

=

Page 13: Lecture 2: 2D edge detection and moving beyond edges

Recap of last lecture (edge detection)

image Gaussianblur

differentiate locateextrema

threshold

convolutionlowpass filter

convolutionhighpass filter

bandpass filter

linear operations are commutative and associative

o o

X frequency

=

Page 14: Lecture 2: 2D edge detection and moving beyond edges

Recap of last lecture (edge detection)

image Gaussianblur

differentiate locateextrema

threshold

convolutionlowpass filter

convolutionhighpass filter

bandpass filter

linear operations are commutative and associative

o o

image Gaussianblur

differentiate

X frequency

=

Page 15: Lecture 2: 2D edge detection and moving beyond edges

Recap of last lecture (edge detection)

image Gaussianblur

differentiate locateextrema

threshold

convolutionlowpass filter

convolutionhighpass filter

bandpass filter

linear operations are commutative and associative

o o

image differentiate

X frequency

=

Gaussianblur

Page 16: Lecture 2: 2D edge detection and moving beyond edges

Recap of last lecture (edge detection)

image Gaussianblur

differentiate locateextrema

threshold

convolutionlowpass filter

convolutionhighpass filter

bandpass filter

linear operations are commutative and associative

o o

image blur with derivative of Gaussian

X frequency

=

Page 17: Lecture 2: 2D edge detection and moving beyond edges

Recap of last lecture (edge detection)

image Gaussianblur

differentiate locateextrema

threshold

convolutionlowpass filter

convolutionhighpass filter

bandpass filter

linear operations are commutative and associative

o o

image blur with derivative of Gaussian

X frequency

=

Page 18: Lecture 2: 2D edge detection and moving beyond edges

Today

• Is there a correct level of blur for edge detection?

• Edge detection in 2D

– Canny edge detection– Marr Hildreth edge detection

• Moving beyond edges

– why edges aren’t sufficient for computer vision

Page 19: Lecture 2: 2D edge detection and moving beyond edges

Discrete approximation of the Gaussian filter

1 2 3 4 5 6 7 8 9 ... N

N = number of pixels in 1D image

discreteapprox

continuousGaussian

=⇒ Trade-off between comp. complexity and high-frequency artifacts

Page 20: Lecture 2: 2D edge detection and moving beyond edges

Truncation of the Gaussian filter

1 2 3 4 5 6 7 8 9 ...K

N = number of pixels in 1D image

discreteapprox

continuousGaussian

peak height

peak height1000

K = truncated approximation

=⇒ Trade-off between comp. complexity and high-frequency artifacts

Page 21: Lecture 2: 2D edge detection and moving beyond edges

Truncation of the Gaussian filter

1 2 3 4 5 6 7 8 9 ...K

N = number of pixels in 1D image

discreteapprox

continuousGaussian

peak height

peak height1000

K = truncated approximation

=⇒ Trade-off between computational complexity and high-frequency artifacts

Page 22: Lecture 2: 2D edge detection and moving beyond edges

Convolution

imag

efil

ter aa b c

d e fg h i

filtered image

Page 23: Lecture 2: 2D edge detection and moving beyond edges

Convolution

imag

efil

ter aa b c

d e fg h i

filtered image

Page 24: Lecture 2: 2D edge detection and moving beyond edges

Is this the right thing to do?

imag

efil

ter aa b c

d e fg h i a b c

d e fg h i

filtered image

Page 25: Lecture 2: 2D edge detection and moving beyond edges

Is this the right thing to do?

imag

efil

ter aa b c

d e fg h i a b c

d e fg h i

filtered image

Page 26: Lecture 2: 2D edge detection and moving beyond edges

Convolution

imag

efil

ter aa b c

d e fg h i i h g

f e lc b a

flip

filtered image

Page 27: Lecture 2: 2D edge detection and moving beyond edges

Convolution

imag

efil

ter aa b c

d e fg h i i h g

f e lc b a

flip

filtered image

convolution = correlation when the filter is symmetric e.g. isotropic Gaussian

Page 28: Lecture 2: 2D edge detection and moving beyond edges

Convolution

imag

efil

ter aa b c

d e fg h i i h g

f e lc b a

filtered image

Page 29: Lecture 2: 2D edge detection and moving beyond edges

Convolution

imag

efil

ter aa b c

d e fg h i

i h gf e lc b a

filtered image

Page 30: Lecture 2: 2D edge detection and moving beyond edges

Convolution

imag

efil

ter aa b c

d e fg h i

i h gf e lc b a

filtered image

Page 31: Lecture 2: 2D edge detection and moving beyond edges

Convolution

imag

efil

ter aa b c

d e fg h i

i h gf e lc b a

filtered image

Page 32: Lecture 2: 2D edge detection and moving beyond edges

What’s the computational cost of this naïve approach?

imag

efil

ter aa b c

d e fg h i i h g

f e lc b a

filtered image

K by K matrix N by M pixel image

Page 33: Lecture 2: 2D edge detection and moving beyond edges

What’s the computational cost of this naïve approach?

imag

efil

ter aa b c

d e fg h i i h g

f e lc b a

filtered image

K by K matrix N by M pixel image

NB. K = 2n+1 in your notes

computational cost = NMK2

Page 34: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

image

filter aa b c

d e fg h i

Page 35: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

image

filter aa b c

d e fg h i

a'b'c'

a' b' c'

aa b cb d ec e f

Page 36: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

image

filter aa b c

d e fg h i

a'b'c'

a' b' c'

aa b cb d ec e f

Page 37: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

image

filter aa b c

d e fg h i

a'b'c'

a' b' c'

aa b cb d ec e f

Page 38: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

image

filter aa b c

d e fg h i

a'b'c'

a' b' c'

aa b cb d ec e f

Page 39: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

image

filter aa b c

d e fg h i

c'b'a'

a'b'c'

a' b' c'

aa b cb d ec e f

Page 40: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

image

filter aa b c

d e fg h i

c'b'a'

a'b'c'

a' b' c'

aa b cb d ec e f

Page 41: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

image

filter aa b c

d e fg h i

c'b'a'

a'b'c'

a' b' c'

aa b cb d ec e f

Page 42: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

image

filter aa b c

d e fg h i

c'b'a'

a'b'c'

a' b' c'

aa b cb d ec e f

Page 43: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

image

filter aa b c

d e fg h i

c'b'a'

a'b'c'

a' b' c'

aa b cb d ec e f

Page 44: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

image

filter aa b c

d e fg h i

c'b'a'

a'b'c'

a' b' c'

aa b cb d ec e f

Page 45: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

image

filter aa b c

d e fg h i

c'b'a'

a'b'c'

a' b' c'

aa b cb d ec e f

Page 46: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

image

filter aa b c

d e fg h i

c'b'a'

a'b'c'

a' b' c'

aa b cb d ec e f

Page 47: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

imag

efil

ter aa b c

d e fg h i

c' b' a'

a'b'c'

a' b' c'

aa b cb d ec e f filtered

image

Page 48: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

imag

efil

ter aa b c

d e fg h i

c' b' a'

a'b'c'

a' b' c'

aa b cb d ec e f filtered

image

Page 49: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

imag

efil

ter aa b c

d e fg h i

c' b' a'

a'b'c'

a' b' c'

aa b cb d ec e f filtered

image

Page 50: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

imag

efil

ter aa b c

d e fg h i

c' b' a'

a'b'c'

a' b' c'

aa b cb d ec e f filtered

image

Page 51: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

imag

efil

ter aa b c

d e fg h i

c' b' a'

a'b'c'

a' b' c'

aa b cb d ec e f filtered

image

Page 52: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

imag

efil

ter aa b c

d e fg h i

c' b' a'

a'b'c'

a' b' c'

aa b cb d ec e f filtered

image

Page 53: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

imag

efil

ter aa b c

d e fg h i

c' b' a'

a'b'c'

a' b' c'

aa b cb d ec e f filtered

image

Page 54: Lecture 2: 2D edge detection and moving beyond edges

Can we speed this up when the filter is separable?

imag

efil

ter aa b c

d e fg h i

c' b' a'

a'b'c'

a' b' c'

aa b cb d ec e f filtered

image

Page 55: Lecture 2: 2D edge detection and moving beyond edges

What is the new computational cost?

imag

efil

ter aa b c

d e fg h i

c' b' a'

a'b'c'

a' b' c'

aa b cb d ec e f filtered

image

c'b'a'

N by M pixel image

K dimensionalvectors

Page 56: Lecture 2: 2D edge detection and moving beyond edges

What is the new computational cost?

imag

efil

ter aa b c

d e fg h i

c' b' a'

a'b'c'

a' b' c'

aa b cb d ec e f filtered

image

c'b'a'

new computational cost is = 2NMK

N by M pixel image

K dimensionalvectors

Page 57: Lecture 2: 2D edge detection and moving beyond edges

What is the new computational cost?

imag

efil

ter aa b c

d e fg h i

c' b' a'

a'b'c'

a' b' c'

aa b cb d ec e f filtered

image

c'b'a'

old computational cost was = NMK

new computational cost is = 2NMK2

N by M pixel image

K dimensionalvectors

Page 58: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 59: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 60: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 61: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 62: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 63: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 64: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 65: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 66: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 67: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 68: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 69: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 70: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 71: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 72: Lecture 2: 2D edge detection and moving beyond edges

Which way do you think the edge is moving?

a

b

c

de

Page 73: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 74: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 75: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 76: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 77: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 78: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 79: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 80: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 81: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 82: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 83: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 84: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 85: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 86: Lecture 2: 2D edge detection and moving beyond edges

Aperture problem

Page 87: Lecture 2: 2D edge detection and moving beyond edges

Problem with edge-features

=⇒ Edges can only tell us about the component of motionperpedicular to the edge

Page 88: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 89: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 90: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 91: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 92: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 93: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 94: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 95: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 96: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 97: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 98: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 99: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 100: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 101: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 102: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 103: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 104: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 105: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 106: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 107: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 108: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 109: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 110: Lecture 2: 2D edge detection and moving beyond edges

What about corners?

Page 111: Lecture 2: 2D edge detection and moving beyond edges

What about corners?