Presentation is loading. Please wait.

Presentation is loading. Please wait.

DREAM PLAN IDEA IMPLEMENTATION 1. 2 3 Introduction to Image Processing Dr. Kourosh Kiani

Similar presentations


Presentation on theme: "DREAM PLAN IDEA IMPLEMENTATION 1. 2 3 Introduction to Image Processing Dr. Kourosh Kiani"— Presentation transcript:

1 DREAM PLAN IDEA IMPLEMENTATION 1

2 2

3 3 Introduction to Image Processing Dr. Kourosh Kiani Web: Present to: Amirkabir University of Technology (Tehran Polytechnic) & Semnan University

4 Lecture 11 4 Introduction to Edge Detection

5

6

7

8

9

10

11

12

13 Edge : an edge is a significant, local change in the image intensity. Edge Detection : Why we do it.  Humans can recognize an enormous range of objects from just line images.  Human visual system performs some sort of edge detection prior to recognition on color or intensity images.  Drastically reduces data to be processed.  Preserves the structural information.  Edge detection contributes significantly to algorithms for feature detection, segmentation, and motion analysis  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).

14 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

15 Gradient For a continuous two dimensional function Gradient is defined as

16 LetFind

17 LetFind

18 Gradient Example 1Gradient Example 1: A scalar field is defined by: T = 10 + x for -10 < x < 10 The field T is displayed graphically in the figure, wherein the brightness of the image at a given location is proportional to the magnitude of T at that location The gradient of T is then given by i. This vector function is plotted below.

19 Gradient Example 2Gradient Example 2: A scalar field is defined by: T = x 2 for -10 < x < 10 The field T is displayed graphically in the figure, wherein the brightness of the image at a given location is proportional to the magnitude of T at that location The gradient of T is then given by 2xi. This vector function is plotted below.

20 Gradient Example 3Gradient Example 3: A scalar field is defined by: T = 20 + x + y for -10 < x,y < 10 The field T is displayed graphically in the figure, wherein the brightness of the image at a given location is proportional to the magnitude of T at that location The gradient of T is then given by i + j. This vector function is plotted below.

21 Gradient Example 4Gradient Example 4: A scalar field is defined by: T = xy for -10 < x,y < 10 The field T is displayed graphically in the figure, wherein the brightness of the image at a given location is proportional to the magnitude of T at that location The gradient of T is then given by yi + xj. This vector function is plotted below.

22 Gradient ExampleGradient Example 5 : A scalar field is defined by: T = x 2 y 2 for -10 < x,y < 10 The field T is displayed graphically in the figure, wherein the brightness of the image at a given location is proportional to the magnitude of T at that location The gradient of T is then given by 2xy 2 i + 2x 2 yj. This vector function is plotted below.

23 Gradient ExampleGradient Example 6 : A scalar field is defined by: T = 1 + sin (2px/6) for -10 < x < 10 The field T is displayed graphically in the figure, wherein the brightness of the image at a given location is proportional to the magnitude of T at that location The gradient of T is then given by (2p/6) cos(2px/6) i. This vector function is plotted below.

24 Change No Change

25 Change

26 Much Change Gradient direction is perpendicular to edge. Gradient Magnitude measures edge strength.

27

28

29 Edge Profiles Sharp discontinuities do not exist in real images because of low-frequency components or the smoothing introduced by image acquisition. Step edges become ramp edges, and line edges become roof edges, where intensity changes are not instantaneous but occur over a finite distance. We concentrate on step (ramp) edges because they are more commonly encountered.

30 Step edge: the image intensity abruptly changes from one value on one side of the discontinuity to a different value on the opposite side. Edge Profiles

31 Ramp edge: a step edge where the intensity change is not instantaneous but occur over a finite distance. Edge Profiles

32 Ridge edge: the image intensity abruptly changes value but then returns to the starting value within some short distance (i.e., usually generated by lines). Edge Profiles

33 Roof edge: a ridge edge where the intensity change is not instantaneous but occur over a finite distance (i.e., usually generated by the intersection of two surfaces). Edge Profiles

34 Edge Detection Using Derivatives Often, points that lie on an edge are detected by: (1) Detecting the local maxima or minima of the first derivative. (2) Detecting the zero-crossings of the second derivative. 2 nd derivative 1 st derivative

35 Image Derivatives How can we differentiate a digital image? – Option 1: reconstruct a continuous image, f(x,y), then compute the derivative. – Option 2: take discrete derivative (i.e., finite differences) Consider this case first!

36 Edge Detection Using First Derivative ramp edge roof edge (upward) step edge (downward) step edge (centered at x) 1D functions (not centered at x)

37 Edge Detection Using Second Derivative Approximate finding maxima/minima of gradient magnitude by finding places where: Can’t always find discrete pixels where the second derivative is zero – look for zero- crossing instead.

38 Replace x+1 with x (i.e., centered at x): 1D functions: (centered at x+1) Edge Detection Using Second Derivative (cont’d)

39 Derivative filters

40 A B

41 1 st Derivative The formula for the 1 st derivative of a function is as follows: It’s just the difference between subsequent values and measures the rate of change of the function

42 1 st Derivative (cont…) f(x) f’(x)

43 2 nd Derivative The formula for the 2 nd derivative of a function is as follows: Simply takes into account the values both before and after the current value

44 2 nd Derivative (cont…) f(x) f’’(x)

45 1 st and 2 nd Derivative f(x) f’(x) f’’(x)

46 Noise Suppression Consider a single row or column of the image Where is the edge??

47 Where is the edge? Solution: Smoothing Filter Look for peaks in

48 Effect Smoothing on Derivates Where is the edge??

49 Effect of Smoothing on Derivatives

50 Combine Smoothing with Differentiation (i.e., saves one operation)

51 Main Steps in Edge Detection (1) Smoothing: suppress as much noise as possible, without destroying true edges. (2) Enhancement: apply differentiation to enhance the quality of edges (i.e., sharpening).

52 Main Steps in Edge Detection (3) Thresholding: determine which edge pixels should be discarded as noise and which should be retained (i.e., threshold edge magnitude). (4) Localization: determine the exact edge location.

53 Using Second Derivatives For Image Enhancement The 2 nd derivative is more useful for image enhancement than the 1 st derivative – Stronger response to fine detail – Simpler implementation – We will come back to the 1 st order derivative later on The first sharpening filter we will look at is the Laplacian – Isotropic – One of the simplest sharpening filters – We will look at a digital implementation

54 First and Second-order derivative of f(x,y)  We consider an image function of two variables, f(x,y),  We deal with partial derivatives along the two spatial axes.

55 The Laplacian is defined as follows: where the partial 1 st order derivative in the x direction is defined as follows: and in the y direction as follows: 2 nd Derivatives – The Laplacian

56 So, the Laplacian can be given as follows: We can easily build a filter based on this nd Derivatives – The Laplacian

57

58

59

60 Basic Edge Detection 1 Step INPUT IMAGE Edge Enhancement Horizontal [-1 0 1] Vertical [-1 0 1] T But what about susceptibility to noise?

61 Basic Edge Detection 2 Step INPUT IMAGE Edge Enhancement Horizontal [-1 0 1] Vertical [-1 0 1] T Noise Smoothing

62

63

64

65 gradient magnitude low threshold high threshold

66

67 gradient magnitude low threshold high threshold

68 1st Derivative Filtering The magnitude of this vector is given by: For practical reasons this can be simplified as:

69 1st Derivative Filtering (cont…) Now we want to define digital approximations and their Filter Masks For simplicity we use a 3x3 region For example z 5 denotes f(x,y), z 1 denotes f(x-1,y-1) A simple approximation for First Derivative is z1z1 z2z2 z3z3 z4z4 z5z5 z6z6 z7z7 z8z8 z9z9

70 1st Derivative Filtering A simple approximation for First Derivative is z1z1 z2z2 z3z3 z4z4 z5z5 z6z6 z7z7 z8z8 z9z9 Two other definitions proposed by Roberts use cross- difference If we use

71 1st Derivative Filtering z1z1 z2z2 z3z3 z4z4 z5z5 z6z6 z7z7 z8z8 z9z9 If we use absolute values then The Masks corresponding to these equations are: Roberts Cross-Gradient Operators

72 Gradient Operators

73 Normally the smallest mask used is of size 3 x 3 Based on the concept of approximating the gradient several spatial masks have been proposed:

74 Gradient Operators

75 Questions? Discussion? Suggestions ?

76 76


Download ppt "DREAM PLAN IDEA IMPLEMENTATION 1. 2 3 Introduction to Image Processing Dr. Kourosh Kiani"

Similar presentations


Ads by Google