1 / 60

Edge Detection

Edge Detection. Giacomo Boracchi 5/12/2007 boracchi@elet.polimi.it. Edge Detection in Images. Goal: Automatically find the contour of objects in a scene. What For: Edges are significant descriptors, useful for classification, compression…. Edge Detection in Images. What is an object?

lydia
Download Presentation

Edge Detection

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Edge Detection Giacomo Boracchi 5/12/2007 boracchi@elet.polimi.it

  2. Edge Detection in Images • Goal: Automatically find the contour of objects in a scene. • What For: Edges are significant descriptors, useful for classification, compression…

  3. Edge Detection in Images • What is an object? It is one of the goals of computer vision to identify objects in scenes.

  4. Edges May Have Different Sources • Object Boundaries • Occlusions • Textures • Shading

  5. What is an Edge • Lets define an edge to be a discontinuity in image intensity function. • Several Models • Step Edge • Ramp Edge • Roof Edge • Spike Edge • They can bethus detected asdiscontinuitiesof image Derivatives

  6. Recall Now this is linear and shift invariant. Therefore, in discrete domain, it will be represented as a convolution Differentiation and convolution

  7. Recall Now this is linear and shift invariant, so must be the result of a convolution. We could approximate this as (which is obviously a convolution with Kernel ; it’s not a very good way to do things, as we shall see) Differentiation and convolution

  8. Finite Difference in 2D Horizontal Vertical Discrete Approximation Convolution Kernels

  9. Finite differences

  10. Simplest noise model independent stationary additive Gaussian noise the noise value at each pixel is given by an independent draw from the same normal probability distribution Issues this model allows noise values that could be greater than maximum camera output or less than zero for small standard deviations, this isn’t too much of a problem - it’s a fairly good model independence may not be justified (e.g. damage to lens) may not be stationary (e.g. thermal gradients in the ccd) Noise

  11. Finite difference filters respond strongly to noise obvious reason: image noise results in pixels that look very different from their neighbors The more relevant is the noise, the stronger the response Finite differences and noise

  12. What is to be done? intuitively, most pixels in images look quite a lot like their neighbors. this is true even at an edge; along the edge they’re similar, across the edge they’re not. suggests that smoothing the image should help, by forcing pixels different to their neighbors (=noise pixels?) to look more like neighbors. Finite differences and noise

  13. Finite differences responding to noise Increasing noise -> (this is zero mean additive gaussian noise)

  14. Finite differences responding to noise Increasing noise -> (this is zero mean additive gaussian noise)

  15. Finite differences responding to noise Increasing noise -> (this is zero mean additive gaussian noise)

  16. Generally expect pixels to “be like” their neighbors surfaces turn slowly relatively few reflectance changes Generally expect noise processes to be independent from pixel to pixel Smoothing reduces noise

  17. Generally expect pixels to “be like” their neighbors surfaces turn slowly relatively few reflectance changes Generally expect noise processes to be independent from pixel to pixe Implies that smoothingsuppresses noise, (i.i.d. noise!) Gaussian Filtering the parameter in the symmetric Gaussian as this parameter goes up, more pixels are involved in the average and the image gets more blurred and noise is somehow suppressed Smoothing reduces noise

  18. Low - Pass The effects of smoothing Each row shows smoothing with gaussians of different width; each column shows different realisations of an image of gaussian noise.

  19. Classical Operators : Prewitt Horizontal Differentiate Smooth Vertical

  20. Classical Operators: Sobel Horizontal Differentiate Smooth Vertical

  21. Gaussian Filter

  22. Detecting Edges in Image • Sobel Edge Detector Threshold Discrete Derivatives Gradient Norms Edges Threshold Image I any alternative ?

  23. Quality of an Edge Detector • Robustness to Noise • Localization • Too Many/Too less Responses True Edge Poor localization Too many responses Poor robustness to noise

  24. Canny Edge Detector Criteria • Good Detection: The optimal detector must minimize the probability of false positives as well as false negatives. • 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 edge point.

  25. Canny Edge Detector • Basically • Convolution with derivative of Gaussian • Non-maximum Suppression • Hysteresis Thresholding

  26. Canny Edge Detector • Smooth by Gaussian • Compute x and y derivatives • Compute gradient magnitude and orientation

  27. Canny Edge Operator

  28. Canny Edge Detector

  29. The Gradient Orientation • Like for continuous function, the gradient at each pixel points at the steepest intensity growth direction. • The gradient norm indicates the inclination of the intensity growth. • Matlab…..

  30. Canny Edge Detector

  31. Non-Maximum Suppression - Idea 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 are then two algorithmic issues: at which point is the maximum, and where is the next one?

  32. Non-Maximum Suppression – Idea (II) 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 are then two algorithmic issues: at which point is the maximum, and where is the next one?

  33. Non-Maximum Suppression - Threshold • Suppress the pixels in ‘Gradient Magnitude Image’ which are not local maximum

  34. An Overview on Threshold • According to the way the Threshold T is used they are divided into • Global Threshold • Local (or) Adaptive Threshold • According to the output they can be classified in • Binary Threshold • Hard Threshold • Soft Threshold

  35. Non-Maximum Suppression

  36. Hysteresis Thresholding • Use of two different threshold High and Low for • For new edge starting point • For continuing edges • In such a way the edges continuity is preserved

  37. Hysteresis Thresholding • If the gradient at a pixel is above ‘High’, declare it an ‘edge pixel’. • If the gradient at a pixel is below ‘Low’, declare it a ‘non-edge-pixel’. • If the gradient at a pixel is between ‘Low’ and ‘High’ then declare it an ‘edge pixel’ if and only if it is connected to an ‘edge pixel’ directly or via pixels between ‘Low’ and ‘ High’.

  38. Hysteresis Thresholding

  39. Examples its detected edges an image

  40. In matlab.. • Canny edge detector is implemented with theedge.m command

  41. A brief overview on Morphological Operators in Image Processing Giacomo Boracchi 5/12/2007 boracchi@elet.polimi.it

  42. An overview on morphological operations • Erosion, Dilation • Open, Closure • We assume the image being processed is binary, as these operators are typically meant for refining “mask” images.

  43. AND operator in Binary images Images From Digital Image Processing II edition Gonzalez & Woods Chapter 9

  44. OR in Binary Images

  45. Erosion • General definition: Nonlinear Filtering procedure that replace to each pixel valuethe maximum on a given neighbor • As a consequence on binary images E(x)=1 iff the image in the neighbor is constantly 1 • This operation reduces thus the boundaries of binary images • It can be interpreted as an AND operation of the image and the neighbor overlapped at each pixel

  46. Erosion Example

  47. Erosion Example

  48. Dilation • General definition: Nonlinear Filtering procedure that replace to each pixel valuethe minimum on a given neighbor • As a consequence on binary images E(x)=1 iff at least a pixel in the neighbor is1 • This operation grows fat the boundaries of binary images • It can be interpreted as an OR operation of the image and the neighbor overlapped at each pixel

  49. Dilation Example

  50. Dilation Example

More Related