- ? Edge detection Goal : map - - PowerPoint PPT Presentation

edge detection
SMART_READER_LITE
LIVE PREVIEW

- ? Edge detection Goal : map - - PowerPoint PPT Presentation

- ? Edge detection Goal : map image from 2d array of pixels to a set of curves or line segments or contours. Why? Figure from J. Shotton et al., PAMI 2007 Main idea :


slide-1
SLIDE 1

רותיא- ףס– יאהנומתב םיוקה םירבוע הפ?

slide-2
SLIDE 2

Edge detection

  • Goal: map image from 2d array of pixels to a set of curves
  • r line segments or contours.
  • Why?
  • Main idea: look for strong gradients, post-process

Figure from J. Shotton et al., PAMI 2007

slide-3
SLIDE 3

What can cause an edge?

Depth discontinuity:

  • bject boundary

Change in surface

  • rientation: shape

Cast shadows Reflectance change: appearance information, texture

slide-4
SLIDE 4

Recall : Images as functions

  • Edges look like steep cliffs

Source: S. Seitz

slide-5
SLIDE 5

Derivatives and edges

image intensity function (along horizontal scanline) first derivative edges correspond to extrema of derivative

Source: L. Lazebnik

An edge is a place of rapid change in the image intensity function.

slide-6
SLIDE 6

Differentiation and convolution

For 2D function, f(x,y), the partial derivative is: For discrete data, we can approximate using finite differences: To implement above as convolution, what would be the associated filter?

 

) , ( ) , ( lim ) , ( y x f y x f x y x f     

1 ) , ( ) , 1 ( ) , ( y x f y x f x y x f     

slide-7
SLIDE 7
  • First, consider a signal in 1D…
  • Let’s replace each pixel with an average of all

the values in its neighborhood

  • Moving average in 1D:

Side note: Filters and Convolutions

Source: S. Marschner

slide-8
SLIDE 8

Weighted Moving Average

  • Can add weights to our moving average
  • Weights [1, 1, 1, 1, 1] / 5

Source: S. Marschner

slide-9
SLIDE 9

Weighted Moving Average

  • Non-uniform weights [1, 4, 6, 4, 1] / 16

Source: S. Marschner

slide-10
SLIDE 10

Moving Average In 2D

90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90

Source: S. Seitz

slide-11
SLIDE 11

Moving Average In 2D

90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 10 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90

Source: S. Seitz

slide-12
SLIDE 12

Moving Average In 2D

90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 10 20 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90

Source: S. Seitz

slide-13
SLIDE 13

Moving Average In 2D

90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 10 20 30 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90

Source: S. Seitz

slide-14
SLIDE 14

Moving Average In 2D

10 20 30 30 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90

Source: S. Seitz

slide-15
SLIDE 15

Moving Average In 2D

90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 10 20 30 30 30 20 10 20 40 60 60 60 40 20 30 60 90 90 90 60 30 30 50 80 80 90 60 30 30 50 80 80 90 60 30 20 30 50 50 60 40 20 10 20 30 30 30 30 20 10 10 10 10

Source: S. Seitz

slide-16
SLIDE 16

Correlation filtering

Say the averaging window size is 2k+1 x 2k+1:

Loop over all pixels in neighborhood around image pixel F[i,j] Attribute uniform weight to each pixel

Now generalize to allow different weights depending on neighboring pixel’s relative position:

Non-uniform weights

slide-17
SLIDE 17

Correlation filtering

Filtering an image: replace each pixel with a linear combination of its neighbors. The filter “kernel” or “mask” H[u,v] is the prescription for the weights in the linear combination. This is called cross-correlation, denoted

slide-18
SLIDE 18

Convolution

  • Convolution:

– Flip the filter in both dimensions (bottom to top, right to left) – Then apply cross-correlation

Notation for convolution

  • perator

F H

slide-19
SLIDE 19

Convolution vs. correlation

Convolution Cross-correlation

Back to our question: To implement the derivates, what would be the associated filter?

1 ) , ( ) , 1 ( ) , ( y x f y x f x y x f     

slide-20
SLIDE 20

Partial derivatives of an image

Which shows changes with respect to x?

  • 1

1

  • 1 1

x y x f   ) , ( y y x f   ) , (

slide-21
SLIDE 21

Assorted finite difference filters

>> My = fspecial(‘sobel’); >> outim = imfilter(double(im), My); >> imagesc(outim); >> colormap gray;

slide-22
SLIDE 22

Image gradient

The gradient of an image: The gradient points in the direction of most rapid change in intensity The gradient direction (orientation of edge normal) is given by: The edge strength is given by the gradient magnitude

Slide credit S. Seitz

slide-23
SLIDE 23
slide-24
SLIDE 24
slide-25
SLIDE 25
slide-26
SLIDE 26
slide-27
SLIDE 27
slide-28
SLIDE 28
slide-29
SLIDE 29
slide-30
SLIDE 30
slide-31
SLIDE 31

Another issue: The 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?

slide-32
SLIDE 32

Where is the edge?

Solution: smooth first

Look for peaks in

slide-33
SLIDE 33

Smoothing with a Gaussian

Parameter σ is the “scale” / “width” / “spread” of the Gaussian kernel, and controls the amount of smoothing.

slide-34
SLIDE 34

Effect of σ on derivatives

The apparent structures differ depending on Gaussian’s scale parameter. Larger values: larger scale edges detected Smaller values: finer features detected

σ = 1 pixel σ = 3 pixels

slide-35
SLIDE 35

So, what scale to choose?

It depends what we’re looking for. Too fine of a scale…can’t see the forest for the trees. Too coarse of a scale…can’t tell the maple grain from the cherry.

slide-36
SLIDE 36
slide-37
SLIDE 37
slide-38
SLIDE 38
slide-39
SLIDE 39
slide-40
SLIDE 40
slide-41
SLIDE 41
slide-42
SLIDE 42
slide-43
SLIDE 43

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

Source: L. Lazebnik

Much more on segmentation later…