edge detection

53
EDGE DETECTION 1

Upload: levana

Post on 19-Jan-2016

27 views

Category:

Documents


0 download

DESCRIPTION

EDGE DETECTION. Edge Detection. Important primitive characteristics of an image: Changes or discontinuities in an image amplitude such as luminance value. Edge and Segment. Local discontinuities in image luminance from one level to another are called luminance edges . - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: EDGE DETECTION

1

EDGE DETECTION

Page 2: EDGE DETECTION

2

Edge Detection

• Important primitive characteristics of an image:

– Changes or discontinuities in an image amplitude such as

luminance value

Page 3: EDGE DETECTION

3

Edge and Segment

Local discontinuities in image luminance from one level to another are called luminance edges.

Global luminance discontinuities, called luminance boundary segments,

Page 4: EDGE DETECTION

4

EDGE MODEL • One-dimensional ramp edge modeled as a ramp increase

in image amplitude from a low to a high level, or vice versa.

• The edge is characterized by its – height, – slope angle, and – horizontal coordinate of the slope midpoint.

• An edge exists if the edge height is greater than a specified value.

a sketch of a continuous domain

Page 5: EDGE DETECTION

5

EDGE MODELS

• An ideal edge detector: – produce an edge indication localized to a

single pixel located at the midpoint of the slope.

• If the slope angle of Figure a is 90°, – the resultant edge is called a step edge, – as shown in Figure b.

• Step edges usually exist only for artificially generated images

Page 6: EDGE DETECTION

6

EDGE MODELS

• Digital images, resulting from digitization of optical images of real scenes, generally do not possess step edges

• Because the anti aliasing low-pass filtering prior to digitization reduces the edge slope in the digital image caused by any sudden luminance change in the scene.

Page 7: EDGE DETECTION

7

First and Second order Derivative Edge Detection

Page 8: EDGE DETECTION

8

A basic definition of the first-order derivative of a one-dimensional

The First-Order Derivative

Page 9: EDGE DETECTION

9

Second-Order Derivative

A second-order derivative as the difference

Page 10: EDGE DETECTION

10

A Simple Image

1-D horizontal graylevel profile along the center of the image and including the isolated noise point.

Page 11: EDGE DETECTION

11

Simplified profile (the points are joined by dashed lines to simplify interpretation).

Page 12: EDGE DETECTION

12

(1)First-order derivatives generally produce thicker edges in an image.

(2) Second-order derivatives have a stronger response to

fine detail, such as thin lines and isolated points.

(3) First-order derivatives generally have a stronger response to a gray-level step.

(4) Second-order derivatives produce a double response at step changes in gray level.

second-order derivatives: for similar changes in gray-level values in an image, their response is stronger to a line than to a step, and to a point than to a line.

Page 13: EDGE DETECTION

13

rotating the image and then applying the filter gives the same result as applying the filter to the image first and then rotating the result.

Isotropic filters

response is independent of the direction of the discontinuities in the image to which the filter is applied

Rotation Invariant

Page 14: EDGE DETECTION

14

Laplacian

Page 15: EDGE DETECTION

15

FIRST-ORDER DERIVATIVE EDGE

DETECTION SCHEMS

• There are two fundamental methods for generating first-order derivative edge gradi ents:– Generation of gradients in two orthogonal directions

in an image– Utilizing a set of directional derivatives

Page 16: EDGE DETECTION

16

Orthogonal Gradient Generation• In the discrete domain,

in terms of a row and a column gradient G(j,k):

Page 17: EDGE DETECTION

17

Orthogonal Gradient Generation

For computational efficiency, the gradient amplitude is

sometimes approximated by the magnitude combination

The orientation of the spatial gradient with respect to the row axis is:

Page 18: EDGE DETECTION

18

Orthogonal Gradient Generation

• Discrete gradient generation is to form the running differ ence of pixels along rows and columns of the image.

The row gradient is defined as

The column gradient is

Page 19: EDGE DETECTION

19

Page 20: EDGE DETECTION

20

Edeg Detection Operators

• Prewitt operator• Roberts Cross-Difference Operator• Sobel Edge Detector• Frei-Chen Operator• Canny Edge Detector• Truncated Pyramid Operator• Argyle and Macleod operator

Page 21: EDGE DETECTION

21

Prewitt Operator

• The separated pixel difference gradient generation method remains highly sensitive to small luminance fluctuations in the image.

• Solving: 2-D gradient formation operators that

perform– differentiation in one coordinate direction and – spatial averaging in the orthogonal direction

simultaneously.

Page 22: EDGE DETECTION

22

Prewitt operator

• Prewitt has introduced a 3x3 pixel edge gradient operator.

• The Prewitt operator square root edge gradient is defined as:

Page 23: EDGE DETECTION

23

Prewitt Operators

• The row and column gradients for all the edge detectors involve a linear combination of pixels within a small neighborhood.

• The row and column gradients can be computed

by the convolution relationships:

row and column impulse response arrays

Page 24: EDGE DETECTION

24

Prewitt Operators

• A limitation common to the edge gradient generation operators is their inability to detect accurately edges in high-noise environments.

• This problem can be alleviated by properly extending the size of the neighborhood operators over which the differential gradients are computed.

Page 25: EDGE DETECTION

25

Prewitt Operators

• A Prewitt type 7x7 operator has a row gradient impulse response of the form

An operator of this type is called a boxcar operator

Page 26: EDGE DETECTION

26

Roberts Cross-Difference Operator

Page 27: EDGE DETECTION

27

Roberts Cross Edge Detector

• Performs a simple, quick to compute, 2-D spatial gradient measurement on an image.

• It highlights regions of high spatial frequency

which often correspond to edges. • In its most common usage,

– the input a grayscale image, as is the output. – Output pixel values at each point represent the

estimated absolute magnitude of the spatial gradient at that point.

Page 28: EDGE DETECTION

28

How Roberts Cross Edge Detector Works

• The operator consists of a pair of 2×2 convolution kernels as shown below

One kernel is the other rotated by 90°

Page 29: EDGE DETECTION

29

How Roberts Cross Edge Detector Works• Kernels are designed to respond maximally to edges running at

45° to the pixel grid, one kernel for each of the two perpendicular orientations.

• Kernels can be applied separately to the input image, to

produce separate measurements of the gradient component in each orientation (Gx and Gy).

• These can be combined together to find the absolute

magnitude of the gradient at each point and the orientation of that gradient.

Page 30: EDGE DETECTION

30

The angle of orientation of the edge giving rise to the spatial gradient (relative to the pixel grid orientation) is given by:

The gradient magnitude is given by:

Page 31: EDGE DETECTION

31

Often, the absolute magnitude is the only output the user sees.

The two components of the gradient are computed and added in a single pass using the pseudo-convolution operator shown below.

Page 32: EDGE DETECTION

32

The main reason for using the Roberts Cross operator is that it is very quick to compute.

Only four input pixels need to be examined to determine the value of each output pixel.

1. Only subtractions and additions are used . 2. There are no parameters to set.

Disadvantage

High noise sensitivity

Page 33: EDGE DETECTION

33

The spurious bright dots on the image which demonstrate that the operator is susceptible to noise

Only the strongest edges have been detected with any reliability

The result of thresholding output at a pixel value of 80

Page 34: EDGE DETECTION

34

Example Roberts Cross operator Edge detection

Threshold the image at a value of 20, all depth discontinuities in the object produce an edge in the image

Page 35: EDGE DETECTION

35

Noise Sensitivity

Output of the Roberts Cross operator

Threshold the image at a value of 20

Page 36: EDGE DETECTION

36

range image where the depth values change much

more slowly

The edges in the resulting Roberts Cross image are

rather faint

Since the intensity of many edge pixels in this image is very low, it is not possible to entirely separate the edges from the noise

Thresholding the image at a value of 30

Noise Sensitivity

Page 37: EDGE DETECTION

37

The effects of the shape of the edge detection kernel on the edge image

Due to the different width and orientation of the lines in the image, the response in the edge image varies significantly.

The intensity steps between foreground and background are constant in all patterns of the original image,

This shows that :the Roberts Cross operator responds differently

to different frequencies and orientations.

Page 38: EDGE DETECTION

38

Sobel Edge Detector

The Sobel operator performs a 2-D spatial gradient measurement on an image and so emphasizes regions of high spatial frequency

that correspond to edges.

Typically it is used to find the approximate absolute gradient magnitude at each point in an input grayscale image.

Page 39: EDGE DETECTION

39

How Sobel Operator Works

The operator consists of a pair of 3×3 convolution kernels as shown below.

One kernel is simply the other rotated by 90°. This is very similar to the Roberts Cross operator.

Page 40: EDGE DETECTION

40

These kernels are designed to respond maximally to edges running vertically and horizontally relative to the pixel grid.

One kernel for each of the two perpendicular orientations.

The kernels can be applied separately to the input image, to produce separate measurements of the gradient component in each orientation

(Gx and Gy).

These can then be combined together to find the absolute magnitude of the gradient at each

point and the orientation of that gradient.

Page 41: EDGE DETECTION

41

The gradient magnitude is given by:

An approximate magnitude is computed using:

The angle of orientation of the edge (relative to the pixel grid) giving rise to the spatial gradient is given by:

Orientation 0 is taken to mean that the direction of maximum contrast from black to white runs from left to right on the image,

and other angles are measured anti-clockwise from this.

Page 42: EDGE DETECTION

42

The absolute magnitude is the only output the user sees.

The pseudo-convolution operator shown in Figure below is employed.

The two components of the gradient are computed and added in a single pass over the input image.

Page 43: EDGE DETECTION

43

1. The Sobel operator is slower to compute than the Roberts Cross operator.

2. Its larger convolution kernel smooths the input image to a greater extent

makes the operator less sensitive to noise.

3. The operator produces higher output values for similar edges, compared with the Roberts Cross.

Sobel Edge Detector Specifications

Page 44: EDGE DETECTION

44

Natural edges often lead to lines that are several pixels wide due to the smoothing effect

of the Sobel operator.

Some thinning may be desirable to counter this.

Sobel Edge Detector Specifications

Page 45: EDGE DETECTION

45

Sobel operator Roberts Cross

The spurious noise that afflicted the Roberts Cross output image is still present, but its intensity relative to the genuine lines has been reduced,

we may get rid of this entirely by thresholding.

The lines corresponding to edges have become thicker compared with the Roberts Cross output

due to the increased smoothing of the Sobel operator.

Sobel Edge Detector Specifications

Page 46: EDGE DETECTION

46

Sobel Edge Detector Specifications

Page 47: EDGE DETECTION

47

All edges have been detected and can be separated from the background using a threshold value (150)

Sobel Edge Detector Specifications

Page 48: EDGE DETECTION

48

The Sobel operator is not as sensitive to noise as the Roberts Cross operator,

it still amplifies high frequencies.

The noise has increased during the edge detection.

It is no longer possible to find a threshold which removes all noise pixels and at the same time retains the edges of the objects

Page 49: EDGE DETECTION

49

The object in the previous example contains: sharp edges and

its surface is rather smooth. we could (in the noise-free case) easily detect the boundary of the object without getting any erroneous pixels.

A more difficult task is to detect the boundary of:

Sobel Edge Detector Specifications

Page 50: EDGE DETECTION

50

The intensity of many pixels on the surface is as high as along the actual edges. One reason is that the output of many edge pixels is greater than the maximum pixel value and therefore they are `cut off' at 255.

To avoid this overflow we scale the range image by a factor 0.25 prior to the edge detection and then normalize the output

Page 51: EDGE DETECTION

51

Page 52: EDGE DETECTION

52

Comparing Operators

• The Sobel operator edge detector differs from the Prewitt edge detector in that the values of the north, south, east, and west pixels are doubled (K = 2).

• The motivation for this weighting is to give equal

importance to each pixel in terms of its contribution to the spatial gradient.

• Frei and Chen have proposed north, south, east, and

west weightings by K=

Page 53: EDGE DETECTION

53

The reason that these operators visually appear to better delineate object edges than the Roberts operator is

attributable to their larger size, which provides averaging of small luminance fluctuations.