edges. cs8690 computer vision university of missouri at columbia gradients and edges points of sharp...

31
Edges

Upload: clemence-may

Post on 17-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

Edges

Page 2: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

Gradients and edges• Points of sharp change in

an image are interesting:– change in reflectance

– change in object

– change in illumination

– noise

• Sometimes called edge points

• Points of sharp change in an image are interesting:– change in reflectance

– change in object

– change in illumination

– noise

• Sometimes called edge points

• General strategy– determine image gradient

– now mark points where gradient magnitude is particularly large wrt neighbours (ideally, curves of such points).

• General strategy– determine image gradient

– now mark points where gradient magnitude is particularly large wrt neighbours (ideally, curves of such points).

Page 3: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

There are three major issues: 1) The gradient magnitude at different scales is different; which should we choose? 2) The gradient magnitude is large along thick trail; how do we identify the significant points? 3) How do we link the relevant points up into curves?

Page 4: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

Smoothing and Differentiation• Issue: noise

– smooth before differentiation– two convolutions to smooth, then differentiate?– actually, no - we can use a derivative of Gaussian

filter• because differentiation is convolution, and convolution is

associative

• Issue: noise– smooth before differentiation– two convolutions to smooth, then differentiate?– actually, no - we can use a derivative of Gaussian

filter• because differentiation is convolution, and convolution is

associative

Page 5: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

The scale of the smoothing filter affects derivative estimates, and alsothe semantics of the edges recovered.

1 pixel 3 pixels 7 pixels

Page 6: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

We wish to mark points along the curve where the magnitude is biggest.We can do this by looking for a maximum along a slice normal to the curve(non-maximum suppression). These points should form a curve. There arethen two algorithmic issues: at which point is the maximum, and where is thenext one?

Page 7: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

Non-maximumsuppression

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

Page 8: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

Predictingthe nextedge point

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).

Page 9: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

Remaining issues• 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.

• 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.

Page 10: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

Notice• Something nasty is happening at corners

• Scale affects contrast

• Edges aren’t bounding contours

• Something nasty is happening at corners

• Scale affects contrast

• Edges aren’t bounding contours

Page 11: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

Page 12: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

fine scalehigh threshold

Page 13: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

coarse scale,high threshold

Page 14: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

coarsescalelowthreshold

Page 15: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

The Laplacian of Gaussian• Another way to detect an

extremal first derivative is to look for a zero second derivative

• Appropriate 2D analogy is rotation invariant– the Laplacian

• Another way to detect an extremal first derivative is to look for a zero second derivative

• Appropriate 2D analogy is rotation invariant– the Laplacian

• Bad idea to apply a Laplacian without smoothing

– smooth with Gaussian, apply Laplacian

– this is the same as filtering with a Laplacian of Gaussian filter

• Now mark the zero points where there is a sufficiently large derivative, and enough contrast

• Bad idea to apply a Laplacian without smoothing

– smooth with Gaussian, apply Laplacian

– this is the same as filtering with a Laplacian of Gaussian filter

• Now mark the zero points where there is a sufficiently large derivative, and enough contrast

Page 16: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

sigma=2

sigma=4

contrast=1 contrast=4LOG zero crossings

Page 17: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

We still have unfortunate behaviourat corners

Page 18: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

Filters are templates• Applying a filter at some

point can be seen as taking a dot-product between the image and some vector

• Filtering the image is a set of dot products

• Applying a filter at some point can be seen as taking a dot-product between the image and some vector

• Filtering the image is a set of dot products

• Insight – filters look like the effects

they are intended to find

– filters find effects they look like

• Insight – filters look like the effects

they are intended to find

– filters find effects they look like

Page 19: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

Positive responses

Zero mean image, -1:1 scale Zero mean image, -max:max scale

Page 20: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

Positive responses

Zero mean image, -1:1 scale Zero mean image, -max:max scale

Page 21: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

Figure from “Computer Vision for Interactive Computer Graphics,” W.Freeman et al, IEEE Computer Graphics and Applications, 1998 copyright 1998, IEEE

Page 22: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

Normalized correlation• Think of filters of a dot

product– now measure the angle

– i.e normalised correlation output is filter output, divided by root sum of squares of values over which filter lies

• Think of filters of a dot product– now measure the angle

– i.e normalised correlation output is filter output, divided by root sum of squares of values over which filter lies

• Tricks:– ensure that filter has a zero

response to a constant region (helps reduce response to irrelevant background)

– subtract image average when computing the normalizing constant (i.e. subtract the image mean in the neighbourhood)

– absolute value deals with contrast reversal

• Tricks:– ensure that filter has a zero

response to a constant region (helps reduce response to irrelevant background)

– subtract image average when computing the normalizing constant (i.e. subtract the image mean in the neighbourhood)

– absolute value deals with contrast reversal

Page 23: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

• Sum of squared differences

• Normalize cross-correlation

• Sum of absolute differences

Region based Similarity Metric

Page 24: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

Orientation representations• The gradient magnitude

is affected by illumination changes– but it’s direction isn’t

• We can describe image patches by the swing of the gradient orientation

• The gradient magnitude is affected by illumination changes– but it’s direction isn’t

• We can describe image patches by the swing of the gradient orientation

• Important types:– constant window

• small gradient mags

– edge window• few large gradient mags in

one direction

– flow window• many large gradient mags

in one direction

– corner window• large gradient mags that

swing

• Important types:– constant window

• small gradient mags

– edge window• few large gradient mags in

one direction

– flow window• many large gradient mags

in one direction

– corner window• large gradient mags that

swing

Page 25: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

Representing Windows• Types

– constant• small eigenvalues

– Edge • one medium, one small

– Flow• one large, one small

– corner• two large eigenvalues

• Types– constant

• small eigenvalues

– Edge • one medium, one small

– Flow• one large, one small

– corner• two large eigenvalues

H I I Twindow

Page 26: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

• Compute eigenvalues of G• If smallest eigenvalue of G is bigger than - mark pixel as candidate feature point

• Alternatively feature quality function (Harris Corner Detector)

Point Feature Extraction

Page 27: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

Harris Corner Detector - Example

Page 28: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

Page 29: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

Page 30: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia

Page 31: Edges. CS8690 Computer Vision University of Missouri at Columbia Gradients and edges Points of sharp change in an image are interesting: –change in reflectance

CS8690 Computer Vision University of Missouri at Columbia