Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 04 Edge Detection Lecture 04 Edge Detection Mata kuliah: T0283 - Computer Vision Tahun: 2010.

Similar presentations


Presentation on theme: "Lecture 04 Edge Detection Lecture 04 Edge Detection Mata kuliah: T0283 - Computer Vision Tahun: 2010."— Presentation transcript:

1

2 Lecture 04 Edge Detection Lecture 04 Edge Detection Mata kuliah: T0283 - Computer Vision Tahun: 2010

3 January 20, 2010T0283 - Computer Vision3 Learning Objectives After carefullylistening this lecture, students will be able to do the following : After carefully listening this lecture, students will be able to do the following : show basic principles of edge detection techniques show basic principles of edge detection techniques demonstrate various convolution-based edge detection techniques such as LOG and Canny edge detectors demonstrate various convolution-based edge detection techniques such as LOG and Canny edge detectors

4 January 20, 2010T0283 - Computer Vision4 Edge Detection Definition of Edges Edges are significant local changes of intensity in an image Typically occur on the boundary between two different regions in an image Goal of Edge Detection Produce a line drawing of a scene from an image of that scene 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)

5 January 20, 2010T0283 - Computer Vision5 Various physical events cause intensity changes Geometric events Object boundary (discontinuity in depth) Surface boundary (discontinuity in surface orientation and/or surface color and texture) Non-geometric events Specularity (direct reflection of light, such as a mirror) Shadows (from other object or from the same object) Inter-reflections What causes intensity changes ?

6 January 20, 2010T0283 - Computer Vision6 Edge normal Unit vector in the direction of maximum intensity change Edge direction Unit vector perpendicular to the edge normal Edge position or center The image position at which the edge is located Edge strength Related the local image contrast along the normal Edge Descriptors

7 January 20, 2010T0283 - Computer Vision7 The Four Steps of Edge Detection Edge Types Step edge (ramp) Line edge (roof) Searching for Edges Filtering: Smooth image Enhancement: Apply numerical derivative approximation Detection: Threshold to find strong edges Localization/analyze: Reject spurious edges, include weak but justified edges

8 January 20, 2010T0283 - Computer Vision8 Edge Detection Using Derivatives Calculus describe changes of continuous functions using derivatives An image is a 2D function, so operators describing edges are expressed using partial derivatives Points which lie on an edge can be detected by Detecting local maxima or minima of the 1 st derivative Detecting the zero-crossing of the 2 nd derivative 1st derivative 2nd derivative

9 January 20, 2010T0283 - Computer Vision9 Computing the 1 st derivative To compute the derivative of a signal, we approximate the derivative by finite differences : Examples using the edge models and the mask [-1 0 1] (centered about x) S1S112121212122424242424 S2S2S2S2M000012120000 MASK M = [-1, 0, 1] S1S124242424241212121212 S2S2S2S2M0000-12-120000

10 January 20, 2010T0283 - Computer Vision10 Computing the 2 nd derivative This approximation is centered about x + 1; by replacing x + 1 by x we obtain

11 January 20, 2010T0283 - Computer Vision11 Examples using edge models S1S112121212122424242424 S2S2S2S2M0000-12120000 MASK M = [-1, 2, -1] S1S124242424241212121212 S2S2S2S2M000012-120000 S1S112121212151821242424 S2S2S2S2M000-3000300 S1S112121212241212121212 S2S2S2S2M000-1224-120000

12 January 20, 2010T0283 - Computer Vision12 The gradient of an image: The gradient points in the direction of most rapid change in intensity The gradient direction is given by: The edge strength is given by the gradient magnitude Edge Detection Using The Gradient

13 January 20, 2010T0283 - Computer Vision13 Estimating Gradient with Finite Differences The gradient can be approximated by finite differences 11 MASK M x dan M y

14 January 20, 2010T0283 - Computer Vision14 Robert Edge Detector This approximation can be implemented by the following mask

15 January 20, 2010T0283 - Computer Vision15 Prewitt & Sobel Edge Detector Consider the arrangement of pixels about the pixel (i, j) The partial derivatives can be computed by M x = (a 2 + ca 3 + a 4 ) - (a 0 + ca 7 + a 6 ) M y = (a 6 + ca 5 + a 4 ) - (a 0 + ca 1 + a 2 ) The constant c implies the emphasis given to the pixels closer the center of the mask a0a0a0a0 a1a1a1a1 a2a2a2a2 a7a7a7a7[i,j] a3a3a3a3 a6a6a6a6 a5a5a5a5 a4a4a4a4

16 January 20, 2010T0283 - Computer Vision16 Prewitt & Sobel Edge Detector (cont’d) Setting c = 1, we get the Prewitt operator Setting c = 2, we get the Sobel operator

17 January 20, 2010T0283 - Computer Vision17 Main Steps in Edge Detection using Mask

18 January 20, 2010T0283 - Computer Vision18 Main Steps in Edge Detection using Mask

19 January 20, 2010T0283 - Computer Vision19 (A) Original & smoothed image(B) Robert Cross operator, T = 64 (C) Prewitt operator, T = 225(D) Sobel operator, T = 225 A Comparison of Various Edge Detector

20 January 20, 2010T0283 - Computer Vision20 Criteria for Optimal Edge Detection Good detection The optimal detector must minimize the probability of false positives (detecting spurious edges caused by noise), as well as that of false negatives (missing real edges) Good localization The edges detected must be as close as possible to the true edges Single response constraint The detector must return one point only for each true edge point, that is, minimize the number of local maxima around the true edge (created by noise)

21 January 20, 2010T0283 - Computer Vision21 Canny Edge Detector This is probably the most widely used edge detector in Computer Vision Algorithm Compute f x and f y : Compute the gradient magnitude : Apply non-maxima suppression Apply hysteresis thresholding/edge linking

22 January 20, 2010T0283 - Computer Vision22 Non Maxima Suppression To find the edge points, we need to find the local maxima of the gradient magnitude Broad ridges must be thinned so that only the magnitudes at the points of greatest local change remain All values along the direction of gradient that are not peak values of a ridge are suppressed

23 January 20, 2010T0283 - Computer Vision23 Hysteresis thresholding/Edge linking The output of non-maxima suppression still contains the local maxima created by noise Can we get rid of them just by using a single threshold ? If we set a low threshold some noisy maxima will be accepted too If we set a high threshold, true maxima might be missed (the value of true maxima will fluctuate above and below the threshold, fragmenting the edge) A more effective scheme is to use two thresholds A low threshold t L A high threshold t H, usually t H = 2 t L

24 January 20, 2010T0283 - Computer Vision24 A Comparison of Various Edge Detector

25 January 20, 2010T0283 - Computer Vision25 Edge Detection using 2 nd Derivatives Edge points can be detected by finding the zero-crossing of the second derivative There are two operators in 2D that correspond to the 2 nd derivative : Laplacian and Second directional derivative

26 January 20, 2010T0283 - Computer Vision26 The Laplacian

27 January 20, 2010T0283 - Computer Vision27 Example of Laplacian Mask

28 January 20, 2010T0283 - Computer Vision28 Laplacian of Gaussian (LOG) To reduce the noise effect, the images is first smoothed with a LPF In case of LOG, the LPF is chosen to be a Gaussian It can be shown that :

29 January 20, 2010T0283 - Computer Vision29 Gradient VS LOG : A Comparison Gradient works well when the image contains sharp intensity transitions and low noise Zero-crossing of LOG offer better localization, especially when the edges are not very sharp 2222258888 2222258888 2222258888 2222258888 2222258888 2222258888 00030-30000030-300 00030-300 00030-300


Download ppt "Lecture 04 Edge Detection Lecture 04 Edge Detection Mata kuliah: T0283 - Computer Vision Tahun: 2010."

Similar presentations


Ads by Google