lecture 3: 2d edge detection and moving beyond edges

110
Lecture 3: 2D edge detection and moving beyond edges Dr. Richard E. Turner ([email protected]) October 17, 2013

Upload: others

Post on 07-Jan-2022

4 views

Category:

Documents


0 download

TRANSCRIPT

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

Lecture 3: 2D edge detectionand moving beyond edges

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

October 17, 2013

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

Recap of last lecture

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

Recap of last lecture

image

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

Recap of last lecture

image Gaussianblur

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

Recap of last lecture

image Gaussianblur

differentiate

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

Recap of last lecture

image Gaussianblur

differentiate locateextrema

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

Recap of last lecture

image Gaussianblur

differentiate locateextrema

threshold

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

Recap of last lecture

image Gaussianblur

differentiate locateextrema

threshold

convolutionlowpass filter

o frequency

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

Recap of last lecture

image Gaussianblur

differentiate locateextrema

threshold

convolutionlowpass filter

convolutionhighpass filter

o o frequency

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

Recap of last lecture

image Gaussianblur

differentiate locateextrema

threshold

convolutionlowpass filter

convolutionhighpass filter

o o

X frequency

=

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

Recap of last lecture

image Gaussianblur

differentiate locateextrema

threshold

convolutionlowpass filter

convolutionhighpass filter

bandpass filter

o o

X frequency

=

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

Recap of last lecture

image Gaussianblur

differentiate locateextrema

threshold

convolutionlowpass filter

convolutionhighpass filter

bandpass filter

linear operations are commutative and associative

o o

X frequency

=

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

Recap of last lecture

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 14: Lecture 3: 2D edge detection and moving beyond edges

Recap of last lecture

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 15: Lecture 3: 2D edge detection and moving beyond edges

Recap of last lecture

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 16: Lecture 3: 2D edge detection and moving beyond edges

Recap of last lecture

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 3: 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 18: Lecture 3: 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 19: Lecture 3: 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

K = truncated approximation

peak height

peak height1000

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

Page 20: Lecture 3: 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

K = truncated approximation

peak height

peak height1000

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

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

Convolution

imag

efil

ter aa b c

d e fg h i

filtered image

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

Convolution

imag

efil

ter aa b c

d e fg h i

filtered image

Page 23: Lecture 3: 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 24: Lecture 3: 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 3: 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 26: Lecture 3: 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 27: Lecture 3: 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 28: Lecture 3: 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 29: Lecture 3: 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 3: 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 3: 2D edge detection and moving beyond edges

What’s the computational cost?

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 32: Lecture 3: 2D edge detection and moving beyond edges

What’s the computational cost?

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 33: Lecture 3: 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 34: Lecture 3: 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 35: Lecture 3: 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 3: 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 3: 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 3: 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 39: Lecture 3: 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 3: 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 3: 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 3: 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 3: 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 3: 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 3: 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 3: 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 47: Lecture 3: 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 3: 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 3: 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 3: 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 3: 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 3: 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 3: 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 3: 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 55: Lecture 3: 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 56: Lecture 3: 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 57: Lecture 3: 2D edge detection and moving beyond edges

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Which way do you think the edge is moving?

a

b

c

de

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

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

Aperture problem

Page 86: Lecture 3: 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 87: Lecture 3: 2D edge detection and moving beyond edges

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?

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

What about corners?