Edge Detection Sanja Fidler Intro to Image Understanding 1 / 70 - - PowerPoint PPT Presentation

edge detection
SMART_READER_LITE
LIVE PREVIEW

Edge Detection Sanja Fidler Intro to Image Understanding 1 / 70 - - PowerPoint PPT Presentation

Edge Detection Sanja Fidler Intro to Image Understanding 1 / 70 Finding Waldo Lets revisit the problem of finding Waldo And lets take a simple example image template (filter) Sanja Fidler Intro to Image Understanding 2 / 70 Finding


slide-1
SLIDE 1

Edge Detection

Sanja Fidler Intro to Image Understanding 1 / 70

slide-2
SLIDE 2

Finding Waldo

Let’s revisit the problem of finding Waldo And let’s take a simple example image template (filter)

Sanja Fidler Intro to Image Understanding 2 / 70

slide-3
SLIDE 3

Finding Waldo

Let’s revisit the problem of finding Waldo And let’s take a simple example normalized cross-correlation Waldo detection (putting box around max response)

Sanja Fidler Intro to Image Understanding 3 / 70

slide-4
SLIDE 4

Finding Waldo

Now imagine Waldo goes shopping ... but our filter doesn’t know that image template (filter)

Sanja Fidler Intro to Image Understanding 4 / 70

slide-5
SLIDE 5

Finding Waldo

Now imagine Waldo goes shopping (and the dog too) ... but our filter doesn’t know that normalized cross-correlation Waldo detection (putting box around max response)

Sanja Fidler Intro to Image Understanding 5 / 70

slide-6
SLIDE 6

Finding Waldo (again)

What can we do to find Waldo again?

Sanja Fidler Intro to Image Understanding 6 / 70

slide-7
SLIDE 7

Finding Waldo (again)

What can we do to find Waldo again?

Edges!!!

image template (filter)

Sanja Fidler Intro to Image Understanding 6 / 70

slide-8
SLIDE 8

Finding Waldo (again)

What can we do to find Waldo again?

Edges!!!

normalized cross-correlation (using the edge maps) Waldo detection (putting box around max response)

Sanja Fidler Intro to Image Understanding 6 / 70

slide-9
SLIDE 9

Waldo and Edges

Sanja Fidler Intro to Image Understanding 7 / 70

slide-10
SLIDE 10

Edge detection

Map image from 2d array of pixels to a set of curves or line segments or contours. More compact than pixels. Edges are invariant to changes in illumination Important for recognition Figure: [Shotton et al. PAMI, 07] [Source: K. Grauman]

Sanja Fidler Intro to Image Understanding 8 / 70

slide-11
SLIDE 11

Origin of Edges

Edges are caused by a variety of factors depth discontinuity surface color discontinuity illumination discontinuity surface normal discontinuity [Source: N. Snavely]

Sanja Fidler Intro to Image Understanding 9 / 70

slide-12
SLIDE 12

What Causes an Edge?

[Source: K. Grauman]

Sanja Fidler Intro to Image Understanding 10 / 70

slide-13
SLIDE 13

Looking More Locally...

[Source: K. Grauman]

Sanja Fidler Intro to Image Understanding 11 / 70

slide-14
SLIDE 14

Images as Functions

Edges look like steep cliffs [Source: N. Snavely]

Sanja Fidler Intro to Image Understanding 12 / 70

slide-15
SLIDE 15

Characterizing Edges

An edge is a place of rapid change in the image intensity function. [Source: S. Lazebnik]

Sanja Fidler Intro to Image Understanding 13 / 70

slide-16
SLIDE 16

How to Implement Derivatives with Convolution

How can we differentiate a digital image f [x, y]? Option 1: reconstruct a continuous image f , then compute the partial derivative as ∂f (x, y) ∂x = lim

ǫ→0

f (x + ǫ, y) − f (x) ǫ Option 2: take discrete derivative (finite difference) ∂f (x, y) ∂x ≈ f [x + 1, y] − f [x] 1

Sanja Fidler Intro to Image Understanding 14 / 70

slide-17
SLIDE 17

How to Implement Derivatives with Convolution

How can we differentiate a digital image f [x, y]? Option 1: reconstruct a continuous image f , then compute the partial derivative as ∂f (x, y) ∂x = lim

ǫ→0

f (x + ǫ, y) − f (x) ǫ Option 2: take discrete derivative (finite difference) ∂f (x, y) ∂x ≈ f [x + 1, y] − f [x] 1 What would be the filter to implement this using convolution?

Sanja Fidler Intro to Image Understanding 14 / 70

slide-18
SLIDE 18

How to Implement Derivatives with Convolution

How can we differentiate a digital image f [x, y]? Option 1: reconstruct a continuous image f , then compute the partial derivative as ∂f (x, y) ∂x = lim

ǫ→0

f (x + ǫ, y) − f (x) ǫ Option 2: take discrete derivative (finite difference) ∂f (x, y) ∂x ≈ f [x + 1, y] − f [x] 1 What would be the filter to implement this using convolution?

1

  • 1
  • 1

1

!" !"

[Source: S. Seitz]

Sanja Fidler Intro to Image Understanding 14 / 70

slide-19
SLIDE 19

How to Implement Derivatives with Convolution

How can we differentiate a digital image f [x, y]? Option 1: reconstruct a continuous image f , then compute the partial derivative as ∂f (x, y) ∂x = lim

ǫ→0

f (x + ǫ, y) − f (x) ǫ Option 2: take discrete derivative (finite difference) ∂f (x, y) ∂x ≈ f [x + 1, y] − f [x] 1 What would be the filter to implement this using convolution?

1

  • 1
  • 1

1

!" !"

[Source: S. Seitz]

Sanja Fidler Intro to Image Understanding 14 / 70

slide-20
SLIDE 20

Examples: Partial Derivatives of an Image

How does the horizontal derivative using the filter [−1, 1] look like? Image

Sanja Fidler Intro to Image Understanding 15 / 70

slide-21
SLIDE 21

Examples: Partial Derivatives of an Image

How does the horizontal derivative using the filter [−1, 1] look like? Image

∂f (x,y) ∂x

with [−1, 1] and correlation

Sanja Fidler Intro to Image Understanding 15 / 70

slide-22
SLIDE 22

Examples: Partial Derivatives of an Image

How about the vertical derivative using filter [−1, 1]T? Image

Sanja Fidler Intro to Image Understanding 16 / 70

slide-23
SLIDE 23

Examples: Partial Derivatives of an Image

How about the vertical derivative using filter [−1, 1]T? Image

∂f (x,y) ∂y

with [−1, 1]T and correlation

Sanja Fidler Intro to Image Understanding 16 / 70

slide-24
SLIDE 24

Examples: Partial Derivatives of an Image

How does the horizontal derivative using the filter [−1, 1] look like? Image

Sanja Fidler Intro to Image Understanding 17 / 70

slide-25
SLIDE 25

Examples: Partial Derivatives of an Image

How does the horizontal derivative using the filter [−1, 1] look like? Image

∂f (x,y) ∂x

with [−1, 1] and correlation

Sanja Fidler Intro to Image Understanding 17 / 70

slide-26
SLIDE 26

Examples: Partial Derivatives of an Image

How about the vertical derivative using filter [−1, 1]T? Image

Sanja Fidler Intro to Image Understanding 18 / 70

slide-27
SLIDE 27

Examples: Partial Derivatives of an Image

How about the vertical derivative using filter [−1, 1]T? Image

∂f (x,y) ∂y

with [−1, 1]T and correlation

Sanja Fidler Intro to Image Understanding 18 / 70

slide-28
SLIDE 28

Examples: Partial Derivatives of an Image

Figure: Using correlation filters [Source: K. Grauman]

Sanja Fidler Intro to Image Understanding 19 / 70

slide-29
SLIDE 29

Finite Difference Filters

[Source: K. Grauman]

Sanja Fidler Intro to Image Understanding 20 / 70

slide-30
SLIDE 30

Image Gradient

The gradient of an image ∇f =

  • ∂f

∂x , ∂f ∂y

  • The gradient points in the direction of most rapid change in intensity

Sanja Fidler Intro to Image Understanding 21 / 70

slide-31
SLIDE 31

Image Gradient

The gradient of an image ∇f =

  • ∂f

∂x , ∂f ∂y

  • The gradient points in the direction of most rapid change in intensity

The gradient direction (orientation of edge normal) is given by: θ = tan−1 ∂f ∂y /∂f ∂x

  • Sanja Fidler

Intro to Image Understanding 21 / 70

slide-32
SLIDE 32

Image Gradient

The gradient of an image ∇f =

  • ∂f

∂x , ∂f ∂y

  • The gradient points in the direction of most rapid change in intensity

The gradient direction (orientation of edge normal) is given by: θ = tan−1 ∂f ∂y /∂f ∂x

  • The edge strength is given by the magnitude ||∇f || =
  • ( ∂f

∂x )2 + ( ∂f ∂y )2

[Source: S. Seitz]

Sanja Fidler Intro to Image Understanding 21 / 70

slide-33
SLIDE 33

Image Gradient

The gradient of an image ∇f =

  • ∂f

∂x , ∂f ∂y

  • The gradient points in the direction of most rapid change in intensity

The gradient direction (orientation of edge normal) is given by: θ = tan−1 ∂f ∂y /∂f ∂x

  • The edge strength is given by the magnitude ||∇f || =
  • ( ∂f

∂x )2 + ( ∂f ∂y )2

[Source: S. Seitz]

Sanja Fidler Intro to Image Understanding 21 / 70

slide-34
SLIDE 34

Example: Image Gradient

Sanja Fidler Intro to Image Understanding 22 / 70

slide-35
SLIDE 35

Example: Image Gradient

Sanja Fidler Intro to Image Understanding 23 / 70

slide-36
SLIDE 36

Example: Image Gradient

[Source: S. Lazebnik]

Sanja Fidler Intro to Image Understanding 24 / 70

slide-37
SLIDE 37

Effects of noise

What if our image is noisy? What can we do? Consider a single row or column of the image. Plotting intensity as a function of position gives a signal.

!"#$%&#'()*&#+,-.&

[Source: S. Seitz]

Sanja Fidler Intro to Image Understanding 25 / 70

slide-38
SLIDE 38

Effects of noise

Smooth first with h (e.g. Gaussian), and look for peaks in

∂ ∂x (h ∗ f ).

[Source: S. Seitz]

Sanja Fidler Intro to Image Understanding 26 / 70

slide-39
SLIDE 39

Derivative theorem of convolution

Differentiation property of convolution ∂ ∂x (h ∗ f ) = (∂h ∂x ) ∗ f = h ∗ (∂f ∂x ) It saves one operation [Source: S. Seitz]

Sanja Fidler Intro to Image Understanding 27 / 70

slide-40
SLIDE 40

2D Edge Detection Filters

Gaussian Derivative of Gaussian (x) hσ(x, y) =

1 2πσ2 exp− u2+v2

2σ2

∂ ∂x hσ(u, v)

[Source: N. Snavely]

Sanja Fidler Intro to Image Understanding 28 / 70

slide-41
SLIDE 41

Derivative of Gaussians

[Source: K. Grauman]

Sanja Fidler Intro to Image Understanding 29 / 70

slide-42
SLIDE 42

Example

Applying the Gaussian derivatives to image

Sanja Fidler Intro to Image Understanding 30 / 70

slide-43
SLIDE 43

Example

Applying the Gaussian derivatives to image

Properties:

Zero at a long distance from the edge Positive on both sides of the edge Highest value at some point in between, on the edge itself

Sanja Fidler Intro to Image Understanding 30 / 70

slide-44
SLIDE 44

Effect of σ on derivatives

The detected structures differ depending on the Gaussian’s scale parameter: Larger values: larger scale edges detected Smaller values: finer structures detected [Source: K. Grauman]

Sanja Fidler Intro to Image Understanding 31 / 70

slide-45
SLIDE 45

Laplacian of Gaussians

Edge by detecting zero-crossings of bottom graph [Source: S. Seitz]

Sanja Fidler Intro to Image Understanding 32 / 70

slide-46
SLIDE 46

2D Edge Filtering

with ∇2 the Laplacian operator ∇2f = ∂2f

∂x2 + ∂2f ∂y 2

[Source: S. Seitz]

Sanja Fidler Intro to Image Understanding 33 / 70

slide-47
SLIDE 47

Example

σ = 1 pixels σ = 3 pixels Applying the Laplacian operator to image

Sanja Fidler Intro to Image Understanding 34 / 70

slide-48
SLIDE 48

Example

σ = 1 pixels σ = 3 pixels Applying the Laplacian operator to image

Properties:

Zero at a long distance from the edge Positive on the darker side of edge Negative on the lighter side Zero at some point in between, on edge itself

Sanja Fidler Intro to Image Understanding 34 / 70

slide-49
SLIDE 49

Example

σ = 1 pixels σ = 3 pixels Applying the Laplacian operator to image

Properties:

Zero at a long distance from the edge Positive on the darker side of edge Negative on the lighter side Zero at some point in between, on edge itself

Sanja Fidler Intro to Image Understanding 34 / 70

slide-50
SLIDE 50

Locating Edges – Canny’s Edge Detector

Let’s take the most popular picture in computer vision: Lena (appeared in November 1972 issue of Playboy magazine) [Source: N. Snavely]

Sanja Fidler Intro to Image Understanding 35 / 70

slide-51
SLIDE 51

Locating Edges

Figure: Canny’s approach takes gradient magnitude [Source: N. Snavely]

Sanja Fidler Intro to Image Understanding 36 / 70

slide-52
SLIDE 52

Locating Edges

Figure: Thresholding [Source: N. Snavely]

Sanja Fidler Intro to Image Understanding 36 / 70

slide-53
SLIDE 53

Locating Edges

!"#$#%&'%("#%#)*#+%

Figure: Gradient magnitude [Source: N. Snavely]

Sanja Fidler Intro to Image Understanding 36 / 70

slide-54
SLIDE 54

Non-Maxima Suppression

Figure: Gradient magnitude Check if pixel is local maximum along gradient direction If yes, take it [Source: N. Snavely]

Sanja Fidler Intro to Image Understanding 37 / 70

slide-55
SLIDE 55

Finding Edges

Figure: Problem with thresholding [Source: K. Grauman]

Sanja Fidler Intro to Image Understanding 38 / 70

slide-56
SLIDE 56

Hysteresis thresholding

Use a high threshold to start edge curves, and a low threshold to continue them [Source: K. Grauman]

Sanja Fidler Intro to Image Understanding 39 / 70

slide-57
SLIDE 57

Hysteresis thresholding

[Source: L. Fei Fei]

Sanja Fidler Intro to Image Understanding 40 / 70

slide-58
SLIDE 58

Located Edges!

Figure: Thinning: Non-maxima suppression [Source: N. Snavely]

Sanja Fidler Intro to Image Understanding 41 / 70

slide-59
SLIDE 59

Canny Edge Detector

Matlab: edge(image,’canny’)

1

Filter image with derivative of Gaussian

2

Find magnitude and orientation of gradient

3

Non-maximum suppression

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 [Source: D. Lowe and L. Fei-Fei]

Sanja Fidler Intro to Image Understanding 42 / 70

slide-60
SLIDE 60

Canny Edge Detector

large σ detects large-scale edges small σ detects fine edges

Canny with Canny with

  • riginal

[Source: S. Seitz]

Sanja Fidler Intro to Image Understanding 43 / 70

slide-61
SLIDE 61

What Happens Here?

Remember this?

Sanja Fidler Intro to Image Understanding 44 / 70

slide-62
SLIDE 62

What Happens Here?

What happens with an image with the following intensity profile? Figure: Intensity of image in one horizontal slice Figure: Horizontal derivative [−1, 1]

Sanja Fidler Intro to Image Understanding 44 / 70

slide-63
SLIDE 63

What Happens Here?

Figure: Intensity of image in one horizontal slice Figure: Horizontal derivative [−1, 1]

Sanja Fidler Intro to Image Understanding 44 / 70

slide-64
SLIDE 64

What Happens Here?

Figure: The image Is there really an edge in this image?

Sanja Fidler Intro to Image Understanding 44 / 70

slide-65
SLIDE 65

What Happens Here?

Figure: Canny’s edge detection Is there really an edge in this image?

Sanja Fidler Intro to Image Understanding 44 / 70

slide-66
SLIDE 66

Canny edge detector

Still one of the most widely used edge detectors in computer vision

  • J. Canny, A Computational Approach To Edge Detection, IEEE Trans.

Pattern Analysis and Machine Intelligence, 8:679-714, 1986. Depends on several parameters: σ of the blur and the thresholds [Source: R. Urtasun]

Sanja Fidler Intro to Image Understanding 45 / 70

slide-67
SLIDE 67

Summary – Stuff You Should Know

Not so good: Horizontal image gradient: Subtract intensity of left neighbor from pixel’s intensity (filtering with [−1, 1]) Vertical image gradient: Subtract intensity of bottom neighbor from pixel’s intensity (filtering with [−1, 1]T) Much better (more robust to noise): Horizontal image gradient: Apply derivative of Gaussian with respect to x to image (filtering!) Vertical image gradient: Apply derivative of Gaussian with respect to y to image Magnitude of gradient: compute the horizontal and vertical image gradients, square them, sum them, and √ the sum Edges: Locations in image where magnitude of gradient is high Phenomena that causes edges: rapid change in surface’s normals, depth discontinuity, rapid changes in color, change in illumination

Sanja Fidler Intro to Image Understanding 46 / 70

slide-68
SLIDE 68

Summary – Stuff You Should Know

Properties of gradient’s magnitude: Zero far away from edge Positive on both sides of the edge Highest value directly on the edge Higher σ emphasizes larger structures Canny’s edge detector: Compute gradient’s direction and magnitude Non-maxima suppression Thresholding at two levels and linking

Matlab functions:

fspecial: gives a few gradients filters (prewitt, sobel, roberts) smoothGradient: function to compute gradients with derivatives of

  • Gaussians. Find it in Lecture’s 3 code (check class webpage)

edge: use edge(I,‘canny’) to detect edges with Canny’s method, and edge(I,‘log’) for Laplacian method

Sanja Fidler Intro to Image Understanding 47 / 70

slide-69
SLIDE 69

Edge Detection State of The Art

  • P. Dollar and C. Zitnick

Structured Forests for Fast Edge Detection ICCV 2013

Code: http://research.microsoft.com/en-us/downloads/ 389109f6-b4e8-404c-84bf-239f7cbf4e3d/default.aspx

(Time stamp: Sept 15, 2014)

Sanja Fidler Intro to Image Understanding 48 / 70

slide-70
SLIDE 70

Testing the Canny Edge Detector

Let’s take this image Our goal (a few lectures from now) is to detect objects (cows here)

Sanja Fidler Intro to Image Understanding 49 / 70

slide-71
SLIDE 71

Testing the Canny Edge Detector

image gradients + NMS Canny’s edges

Sanja Fidler Intro to Image Understanding 50 / 70

slide-72
SLIDE 72

Testing the Canny Edge Detector

image gradients + NMS Canny’s edges

Sanja Fidler Intro to Image Understanding 50 / 70

slide-73
SLIDE 73

Testing the Canny Edge Detector

image gradients + NMS Canny’s edges Lots of “distractor” and missing edges Can we do better?

Sanja Fidler Intro to Image Understanding 50 / 70

slide-74
SLIDE 74

Annotate...

Imagine someone goes and annotates which edges are correct ... and someone has:

Sanja Fidler Intro to Image Understanding 51 / 70

slide-75
SLIDE 75

Annotate...

Imagine someone goes and annotates which edges are correct ... and someone has:

The Berkeley Segmentation Dataset and Benchmark

by D. Martin and C. Fowlkes and D. Tal and J. Malik

Sanja Fidler Intro to Image Understanding 51 / 70

slide-76
SLIDE 76

... and do Machine Learning

How can we make use of such data to improve our edge detector?

Sanja Fidler Intro to Image Understanding 52 / 70

slide-77
SLIDE 77

... and do Machine Learning

How can we make use of such data to improve our edge detector? We can use Machine Learning techniques to:

Train classifiers!

Please learn what a classifier /classification is In particular, learn what a Support Vector Machine (SVM) is (some links to tutorials are on the class webpage) With each week it’s going to be more important to know about this You don’t need to learn all the details / math, but to understand the concept enough to know what’s going on

Sanja Fidler Intro to Image Understanding 53 / 70

slide-78
SLIDE 78

... and do Machine Learning

How can we make use of such data to improve our edge detector? We can use Machine Learning techniques to:

Train classifiers!

Please learn what a classifier /classification is In particular, learn what a Support Vector Machine (SVM) is (some links to tutorials are on the class webpage) With each week it’s going to be more important to know about this You don’t need to learn all the details / math, but to understand the concept enough to know what’s going on

Sanja Fidler Intro to Image Understanding 53 / 70

slide-79
SLIDE 79

Classification – a Disney edition (pictures only)

Each data point x lives in a n-dimensional space, x ∈ Rn We have a bunch of data points xi, and for each we have a label, yi A label yi can be either 1 (positive example – correct edge in our case), or −1 (negative example – wrong edge in our case)

Sanja Fidler Intro to Image Understanding 54 / 70

slide-80
SLIDE 80

Classification – a Disney edition (pictures only)

Sanja Fidler Intro to Image Understanding 55 / 70

slide-81
SLIDE 81

Classification – a Disney edition (pictures only)

Sanja Fidler Intro to Image Understanding 55 / 70

slide-82
SLIDE 82

Classification – a Disney edition (pictures only)

Sanja Fidler Intro to Image Understanding 55 / 70

slide-83
SLIDE 83

Training an Edge Detector

How should we do this?

Sanja Fidler Intro to Image Understanding 56 / 70

slide-84
SLIDE 84

Training an Edge Detector

How should we do this?

Sanja Fidler Intro to Image Understanding 56 / 70

slide-85
SLIDE 85

Training an Edge Detector

We extract lots of image patches

Sanja Fidler Intro to Image Understanding 56 / 70

slide-86
SLIDE 86

Training an Edge Detector

We extract lots of image patches These are our training data

Sanja Fidler Intro to Image Understanding 56 / 70

slide-87
SLIDE 87

Training an Edge Detector

We extract lots of image patches These are our training data We convert each image patch P (a matrix) into a vector x

Sanja Fidler Intro to Image Understanding 56 / 70

slide-88
SLIDE 88

Training an Edge Detector

We extract lots of image patches These are our training data We convert each image patch P (a matrix) into a vector x Well... This works better: Extract image features for each patch

Sanja Fidler Intro to Image Understanding 56 / 70

slide-89
SLIDE 89

Training an Edge Detector

We extract lots of image patches These are our training data We convert each image patch P (a matrix) into a vector x Well... This works better: Extract image features for each patch Image features are mappings from images (or patches) to other (vector) meaningful representations. More on this in the next class!

Sanja Fidler Intro to Image Understanding 56 / 70

slide-90
SLIDE 90

Using an Edge Detector

Once trained, how can we use our new edge detector?

Sanja Fidler Intro to Image Understanding 57 / 70

slide-91
SLIDE 91

Using an Edge Detector

We extract all image patches

Sanja Fidler Intro to Image Understanding 57 / 70

slide-92
SLIDE 92

Using an Edge Detector

We extract all image patches Extract features and use our trained classifier

Sanja Fidler Intro to Image Understanding 57 / 70

slide-93
SLIDE 93

Using an Edge Detector

We extract all image patches Extract features and use our trained classifier Place the predicted value (score) in the output matrix

Sanja Fidler Intro to Image Understanding 57 / 70

slide-94
SLIDE 94

Comparisons: Canny vs Structured Edge Detector

image image gradients gradients + NMS “edgeness score” score + NMS

Sanja Fidler Intro to Image Understanding 58 / 70

slide-95
SLIDE 95

Comparisons: Canny vs Structured Edge Detector

image image gradients gradients + NMS “edgeness” score score + NMS image gradient “edgeness” score

Sanja Fidler Intro to Image Understanding 59 / 70

slide-96
SLIDE 96

Comparisons: Canny vs Structured Edge Detector

image image gradients gradients + NMS “edgeness” score score + NMS

Sanja Fidler Intro to Image Understanding 60 / 70

slide-97
SLIDE 97

Comparisons: Canny vs Structured Edge Detector

image image gradients gradients + NMS “edgeness” score score + NMS

Sanja Fidler Intro to Image Understanding 61 / 70

slide-98
SLIDE 98

Comparisons: Canny vs Structured Edge Detector

image image gradients gradients + NMS “edgeness” score score + NMS

Sanja Fidler Intro to Image Understanding 62 / 70

slide-99
SLIDE 99

Comparisons: Canny vs Structured Edge Detector

image image gradients gradients + NMS “edgeness” score score + NMS image gradient “edgeness” score

Sanja Fidler Intro to Image Understanding 63 / 70

slide-100
SLIDE 100

Evaluation

Figure: green=correct, blue=wrong, red=missing, green+blue=output edges

Sanja Fidler Intro to Image Understanding 64 / 70

slide-101
SLIDE 101

Evaluation

Recall: How many of all annotated edges we got correct (best is 1) Precision How many of all output edges we got correct (best is 1) Recall = # of green (correct edges) # of all edges in ground-truth (first picture)

Sanja Fidler Intro to Image Understanding 64 / 70

slide-102
SLIDE 102

Evaluation

Recall: How many of all annotated edges we got correct (best is 1) Precision How many of all output edges we got correct (best is 1) Precision = # of green (correct edges) # of all edges in output (first picture)

Sanja Fidler Intro to Image Understanding 64 / 70

slide-103
SLIDE 103

Evaluation

Recall: How many of all annotated edges we got correct (best is 1) Precision How many of all output edges we got correct (best is 1)

Sanja Fidler Intro to Image Understanding 64 / 70

slide-104
SLIDE 104

Lesson 1

Trained detectors (typically) perform better (true for all applications) In this case, the code seem to work better for finding object boundaries (edges) than finding text boundaries. Any idea why? What would you do if you wanted to detect text (e.g., licence plates)? Think about your problem, don’t just use code as a black box

Sanja Fidler Intro to Image Understanding 65 / 70

slide-105
SLIDE 105

So much trouble for just edge computation... Can we do something cool with it already?

  • S. Avidan and A. Shamir

Seam Carving for Content-Aware Image Resizing SIGGRAPH 2007

Paper: http://www.win.tue.nl/~wstahw/edu/2IV05/seamcarving.pdf Sanja Fidler Intro to Image Understanding 66 / 70

slide-106
SLIDE 106

Simple Application: Seam Carving

Content-aware resizing Find path from top to bottom row with minimum gradient energy Remove (or replicate) those pixels

Sanja Fidler Intro to Image Understanding 67 / 70

slide-107
SLIDE 107

Simple Application: Seam Carving

Content-aware resizing Find path from top to bottom row with minimum gradient energy

Sanja Fidler Intro to Image Understanding 67 / 70

slide-108
SLIDE 108

Simple Application: Seam Carving

Content-aware resizing

Sanja Fidler Intro to Image Understanding 67 / 70

slide-109
SLIDE 109

Seam Carving

A vertical seam s is a list of column indices, one for each row, where each subsequent column differs by no more than one slot. Let G denote the image gradient magnitude. Optimal 8-connected path: s∗ = argminsE(s) = argmins

n

  • i=1

G(si) Can be computed via dynamic programming Compute the cumulative minimum energy for all possible connected seams at each entry (i, j): M(i, j) = G(i, j) + min (M(i − 1, j − 1), M(i − 1, j), M(i − 1, j + 1)) Backtrack from min value in last row of M to pull out optimal seam path. [Source: K. Grauman]

Sanja Fidler Intro to Image Understanding 68 / 70

slide-110
SLIDE 110

Seam Carving – Examples

Implement seam carving for 5% extra credit on first assignment

Sanja Fidler Intro to Image Understanding 69 / 70

slide-111
SLIDE 111

Next time:

Image Features

Sanja Fidler Intro to Image Understanding 70 / 70