edge and corner detection - - tu kaiserslautern · designing an edge detector • criteria for an...

80
Edge and corner detection Prof. Stricker Doz. Dr. G. Bleser Computer Vision: Object and People Tracking 1

Upload: duongkhue

Post on 17-Apr-2018

218 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Edge and corner detection

Prof. Stricker

Doz. Dr. G. Bleser

Computer Vision: Object and People Tracking

1

Page 2: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Example of the State of the Art (Video / Augmented Vision Group)

2

Page 3: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Artificial (computer) Vision: Tracking

Page 4: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Object Sensors

Models

Context

Image acquisition

Detection / Prediction

Tracking Measurement

Modalities Object Tracking

Vision Likelihood

Data association Data fusion

State update

Reminder: „tracking on one slide“

4

Page 5: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Goals

• Where is the information in an image?

• How is an object characterized?

• How can I find measurements in the image?

• The correct „Good Features“ are essential

for tracking!

5

Page 6: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Outline

• Edge detection

• Canny edge detector

• Point extraction

Some slides from Lazebnik

6

Page 7: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Edge detection

• Goal: Identify sudden changes (discontinuities) in an image

• Intuitively, most semantic and shape information from the image can be encoded in the edges

• More compact than pixels

• Ideal: artist’s line drawing (but artist is also using object-level knowledge)

Source: D. Lowe and Debis

7

Page 8: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Edge Detection

1. 8

Page 9: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

What Causes Intensity Changes?

Geometric events • surface orientation (boundary) discontinuities

• depth discontinuities

• color and texture discontinuities

Non-geometric events • illumination changes

• specularities

• shadows

• inter-reflections

depth discontinuity

color discontinuity

illumination discontinuity

surface normal discontinuity

9

Page 10: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Why is Edge Detection Useful?

Important features can be extracted from the edges of an

image (e.g., corners, lines, curves).

These features are used by higher-level computer vision

algorithms (e.g., recognition).

10

Page 11: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Effect of Illumination

11

Page 12: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Edge Descriptors

Edge direction: perpendicular to the

direction of maximum

intensity change (i.e.,

edge normal)

Edge strength: related to

the local image contrast

along the normal.

Edge position: the image

position at which the

edge is located.

12

Page 13: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Characterizing edges

• An edge is a place of rapid change in the image

intensity function

image intensity function

(along horizontal scanline) first derivative

edges correspond to extrema of derivative

13

Page 14: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

The gradient points in the direction of most rapid increase in intensity

Image gradient The gradient of an image:

The gradient direction is given by

• how does this relate to the direction of the edge?

The edge strength is given by the gradient magnitude

Source: Steve Seitz

14

Page 15: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Differentiation and convolution

We could approximate this as:

(which is obviously a convolution)

Recall, for 2D function, f(x,y):

f

x lim

0

f x , y

f x,y

f

xf xn1,y f xn , y

x

-1 1

Source: D. Forsyth, D. Lowe

15

Check!

Page 16: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Finite differences: example

Which one is the gradient in the x-direction (resp. y-direction)?

16

Page 17: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Effects of noise

Consider a single row or column of the image • Plotting intensity as a function of position gives a signal

Where is the edge? Source: S. Seitz

17

Page 18: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Effects of noise

• Finite difference filters respond strongly to noise • Image noise results in pixels that look very different from

their neighbors

• Generally, the larger the noise the stronger the response

• What is to be done?

Source: D. Forsyth

• Smoothing the image should help, by forcing pixels different to their neighbors (=noise pixels?) to look more like neighbors

18

Page 19: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Solution: smooth first

• To find edges, look for peaks in )( gfdx

d

f

g

f * g

)( gfdx

d

Source: S. Seitz 19

Page 20: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Derivative theorem of convolution

• Differentiation and convolution both linear operators: they “commute”

• This saves us one operation:

gdx

df

f

gdx

d

Source: S. Seitz

dx

dgfg

dx

dfgf

dx

d

20

Page 21: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Derivative of Gaussian filter

This filter is separable

* [1 -1] =

21

Page 22: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Derivative of Gaussian filter

x-direction y-direction

22

Page 23: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Tradeoff between smoothing and localization

Smoothed derivative removes noise, but blurs edge.

Also finds edges at different “scales”.

1 pixel 3 pixels 7 pixels

Source: D. Forsyth 23

Page 24: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Finite difference filters

Source: K. Grauman

• Other approximations of derivative filters exist:

24

Page 25: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Implementation issues

• The gradient magnitude is large along a thick “trail” or

“ridge”, so how do we identify the actual edge points?

• How do we link the edge points to form curves?

Source: D. Forsyth 25

Page 26: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Designing an edge detector

• Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize the

probability of false positives (detecting spurious edges caused by

noise), as well as that of false negatives (missing real edges)

• Good localization: the edges detected must be as close as

possible to the true edges

• Single response: the detector must return one point only for each

true edge point; that is, minimize the number of local maxima

around the true edge

Source: L. Fei-Fei

26

Page 27: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Canny edge detector

• This is probably the most widely used edge detector

in computer vision

• Theoretical model: step-edges corrupted by additive

Gaussian noise

• Canny has shown that the first derivative of the

Gaussian closely approximates the operator that

optimizes the product of signal-to-noise ratio and

localization

J. Canny, A Computational Approach To Edge Detection, IEEE Trans. Pattern Analysis and Machine Intelligence, 8:679-714, 1986.

Source: L. Fei-Fei

27

Page 28: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Canny edge detector

1. Filter image with derivative of Gaussian

2. Find magnitude and orientation of gradient

3. Non-maximum suppression: • Thin multi-pixel wide “ridges” down to single pixel width

4. Linking and thresholding (hysteresis): • Define two thresholds: low and high

• Use the high threshold to start edge curves and the low threshold to continue them

MATLAB: edge(image, ‘canny’)

Source: D. Lowe, L. Fei-Fei

28

Page 29: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Example

original image (Lena) 29

Page 30: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Example

norm of the gradient 30

Page 31: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Example

thresholding 31

Page 32: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Example

thinning (non-maximum suppression) 32

Page 33: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Non-maximum suppression

At q, we have a maximum if the value is larger than those at both p and at r. Interpolate to get these values.

Source: D. Forsyth

1. 33

Page 34: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Assume the marked point is an edge point. Then we construct the tangent to the edge curve (which is normal to the gradient at that point) and use this to predict the next points (here either r or s).

Edge linking

Source: D. Forsyth

1. 34

Page 35: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Hysteresis thresholding

Check that maximum value of gradient value is

sufficiently large

• drop-outs? use hysteresis

– use a high threshold to start edge curves and a low threshold to

continue them.

Source: S. Seitz

35

Page 36: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Hysteresis thresholding

original image

high threshold (strong edges)

low threshold (weak edges)

hysteresis threshold

Source: L. Fei-Fei

36

Page 37: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Effect of (Gaussian kernel spread/size)

Canny with Canny with original

The choice of depends on desired behavior • large detects large scale edges

• small detects fine features

Source: S. Seitz

37

Page 38: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Edge detection is just the beginning… Berkeley segmentation database:

http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/

image human segmentation gradient magnitude

38

Page 39: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Features

Some slides from S. Seitz 39

Page 40: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Image Matching

40

Page 41: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Image Matching

41

Page 42: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Invariant local features

Find features that are invariant to transformations

• geometric invariance: translation, rotation, scale

• photometric invariance: brightness, exposure, …

Feature Descriptors 42

Page 43: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Advantages of local features

Locality

• features are local, so robust to occlusion and clutter

Distinctiveness

• can differentiate a large database of objects

Quantity

• hundreds or thousands in a single image

Efficiency

• real-time performance achievable

Generality

• exploit different types of features in different situations

43

Page 44: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

More motivation…

Feature points are used for:

• Image alignment (e.g., mosaics)

• 3D reconstruction

• Motion tracking

• Object recognition

• Indexing and database retrieval

• Robot navigation

• … other

44

Page 45: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Interest point candidates

auto-correlation

45

Page 46: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Steps in Corner Detection

1. For each pixel, the corner operator is applied to obtain

a cornerness measure for this pixel.

2. Threshold cornerness map to eliminate weak corners.

3. Apply non-maximal suppression to eliminate points whose

cornerness measure is not larger than the cornerness values of

all points within a certain distance.

46

Page 47: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Steps in Corner Detection (cont’d)

47

Page 48: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Local measures of uniqueness

Suppose we only consider a small window of pixels

• What defines whether a feature is a good or bad candidate?

Slide adapted from Darya Frolova, Denis Simakov, Weizmann Institute.

48

Page 49: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Feature detection

Local measure of feature uniqueness • How does the window change when you shift it?

• Shifting the window in any direction causes a big change

“flat” region:

no change in all

directions

“edge”:

no change along

the edge direction

“corner”:

significant change

in all directions

Slide adapted from Darya Frolova, Denis Simakov, Weizmann Institute.

49

Page 50: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Consider shifting the window W by (u,v)

• how do the pixels in W change?

• compare each pixel before and after by

summing up the squared differences (SSD)

• this defines an SSD “error” of E(u,v):

Feature detection: the math

W

50

Page 51: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Taylor Series expansion of I:

If the motion (u,v) is small, then first order approx is good

Plugging this into the formula on the previous slide…

Small motion assumption

51

Page 52: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Consider shifting the window W by (u,v)

• how do the pixels in W change?

• compare each pixel before and after by

summing up the squared differences

• this defines an “error” of E(u,v):

Feature detection: the math

W

52

Page 53: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Feature detection: the math

This can be rewritten:

For the example above

• You can move the center of the green window to anywhere on the

blue unit circle

• Which directions will result in the largest and smallest E values?

• We will show that we can find these directions by looking at the

eigenvectors of H 53

Page 54: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Feature detection: the error function

A new corner measurement by investigating the

shape of the error function

represents a quadratic function;

Thus, we can analyze E’s shape by looking at the

property of H

uu HT

54

Page 55: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Feature detection: the error function

High-level idea: what shape of the error function will we

prefer for features?

02

46

810

12

0

5

10

0

20

40

60

80

100

02

46

810

12

0

5

10

0

20

40

60

80

100

02

46

810

12

0

5

10

0

20

40

60

80

100

flat edge corner 55

Page 56: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Quadratic forms

Quadratic form (homogeneous polynomial of

degree two) of n variables xi

Examples

=

56

Page 57: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Symmetric matrices

Quadratic forms can be represented by a real

symmetric matrix A where

57

Page 58: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Eigenvalues of symmetric matrices

Brad Osgood 58

Page 59: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Eigenvectors of symmetric matrices

where Q is an orthogonal matrix (the columns of which are eigenvectors of A),

and Λ is real and diagonal (having the eigenvalues of A on the diagonal).

59

Page 60: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Eigenvectors of symmetric matrices

zz

yΛyΛ

Λyy

xQΛxQ

xQΛQx

Axx

T

T

T

TTT

TT

T

21

21

11 q22 q

1 xxT

1zzT

60

Page 61: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Harris corner detector

Intensity change in shifting window: eigenvalue analysis

-, + – eigenvalues of H

Ellipse E(u,v) = const

v

uHvuvuE ,),(

(max)1/2

(min)1/2 direction of the

fastest change

direction of the

slowest change

We can visualize H as an ellipse with axis lengths and directions

determined by its eigenvalues and eigenvectors.

61

Page 62: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Visualize quadratic functions

T

10

01

10

01

10

01

10

01A

62

Page 63: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Visualize quadratic functions

T

10

01

10

04

10

01

10

04A

63

Page 64: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Visualize quadratic functions

T

50.087.0

87.050.0

40

01

50.087.0

87.050.0

75.130.1

30.125.3A

64

Page 65: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Visualize quadratic functions

T

50.087.0

87.050.0

100

01

50.087.0

87.050.0

25.390.3

90.375.7A

65

Page 66: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Feature detection: the math

This can be rewritten:

Eigenvalues and eigenvectors of H

• Define shifts with the smallest and largest change (E value)

• x+ = direction of largest increase in E.

• + = amount of increase in direction x+

• x- = direction of smallest increase in E.

• - = amount of increase in direction x+

x-

x+

66

Page 67: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Feature detection: the math

How are +, x+, -, and x+ relevant for feature detection?

• What’s our feature scoring function?

Want E(u,v) to be large for small shifts in all directions

• the minimum of E(u,v) should be large, over all unit vectors [u v]

• this minimum is given by the smaller eigenvalue (-) of H

67

Page 68: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Feature detection summary (Kanade-Tomasi)

Here’s what you do

• Compute the gradient at each point in the image

• Create the H matrix from the entries in the gradient

• Compute the eigenvalues

• Find points with large response (- > threshold)

• Choose those points where - is a local maximum as features

J. Shi and C. Tomasi (June 1994). "Good Features to Track". 9th IEEE Conference on Computer Vision and Pattern

Recognition. Springer.

68

Page 69: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Feature detection summary

Here’s what you do

• Compute the gradient at each point in the image

• Create the H matrix from the entries in the gradient

• Compute the eigenvalues.

• Find points with large response (- > threshold)

• Choose those points where - is a local maximum as features

69

Page 70: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

The Harris operator

- is a variant of the “Harris operator” for feature detection (- = 1 ; + = 2)

• The trace is the sum of the diagonals, i.e., trace(H) = h11 + h22

• Very similar to - but less expensive (no square root)*

• Called the “Harris Corner Detector” or “Harris Operator”

• Lots of other detectors, this is one of the most popular

* 70

Page 71: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

The Harris operator

Measure of corner response (Harris):

(k – empirical constant, k = 0.04-0.06)

2tracedet HkHR

21

21

trace

det

H

H

With:

71

Page 72: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

The Harris operator

Harris operator

72

Page 73: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Harris detector example

73

Page 74: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

f value (red high, blue low)

74

Page 75: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Threshold (f > value)

1. 75

Page 76: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Find local maxima of f

1. 76

Page 77: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Harris features (in red)

77

Page 78: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Harris detector: Steps

1. Compute Gaussian derivatives at each pixel

2. Compute second moment matrix H in a Gaussian

window around each pixel

3. Compute corner response function R

4. Threshold R

5. Find local maxima of response function (non-maximum

suppression)

C.Harris and M.Stephens. "A Combined Corner and Edge Detector.“ Proceedings of the 4th Alvey Vision Conference: pages 147—151, 1988.

2

2121

2 )()(trace)det( HHR

α: constant (0.04 to 0.06)

78

Page 79: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Thank you!

79

Page 80: Edge and corner detection - - TU Kaiserslautern · Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize

Quick review: eigenvalue/eigenvector

The eigenvectors of a matrix A are the vectors x that satisfy:

The scalar is the eigenvalue corresponding to x

• The eigenvalues are found by solving:

• In our case, A = H is a 2x2 matrix, so we have

• The solution:

Once you know , you find x by solving

80