1 / 29

Lecture 2: Convolution and edge detection

CS4670: Computer Vision. Noah Snavely. Lecture 2: Convolution and edge detection. From Sandlot Science. Gaussian Kernel. Source: C. Rasmussen. Mean vs. Gaussian filtering. Gaussian filters. = 1 pixel. = 10 pixels. = 30 pixels. = 5 pixels. Gaussian filter.

gafna
Download Presentation

Lecture 2: Convolution and 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. CS4670: Computer Vision Noah Snavely Lecture 2: Convolution and edge detection From Sandlot Science

  2. Gaussian Kernel Source: C. Rasmussen

  3. Mean vs. Gaussian filtering

  4. Gaussian filters = 1 pixel = 10 pixels = 30 pixels = 5 pixels

  5. Gaussian filter • Removes “high-frequency” components from the image (low-pass filter) • Convolution with self is another Gaussian • Convolving two times with Gaussian kernel of width = convolving once with kernel of width = * Source: K. Grauman

  6. Sharpening Source: D. Lowe

  7. = detail smoothed (5x5) original Let’s add it back: = + α original detail sharpened Sharpening revisited • What does blurring take away? – Source: S. Lazebnik

  8. scaled impulse Gaussian Laplacian of Gaussian Sharpen filter blurredimage image unit impulse(identity)

  9. Sharpen filter unfiltered filtered

  10. Convolution in the real world Camera shake = * Source: Fergus, et al. “Removing Camera Shake from a Single Photograph”, SIGGRAPH 2006 Bokeh: Blur in out-of-focus regions of an image. Source: http://lullaby.homepage.dk/diy-camera/bokeh.html

  11. Questions?

  12. Image noise Original image White Gaussian noise Salt and pepper noise (each pixel has some chance of being switched to zero or one) http://theory.uchicago.edu/~ejm/pix/20d/tests/noise/index.html

  13. Gaussian noise = 1 pixel = 2 pixels = 5 pixels Smoothing with larger standard deviations suppresses noise, but also blurs the image

  14. Salt & pepper noise – Gaussian blur p = 10% = 1 pixel = 2 pixels = 5 pixels • What’s wrong with the results?

  15. Alternative idea: Median filtering • A median filter operates over a window by selecting the median intensity in the window • Is median filtering linear? Source: K. Grauman

  16. Median filter • What advantage does median filtering have over Gaussian filtering? Source: K. Grauman

  17. Salt & pepper noise – median filtering p = 10% = 1 pixel = 2 pixels = 5 pixels 3x3 window 5x5 window 7x7 window

  18. Edge detection • Convert a 2D image into a set of curves • Extracts salient features of the scene • More compact than pixels TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAA

  19. Origin of Edges Edges are caused by a variety of factors surface normal discontinuity depth discontinuity surface color discontinuity illumination discontinuity

  20. intensity function(along horizontal scanline) first derivative edges correspond toextrema of derivative Characterizing edges • An edge is a place of rapid change in the image intensity function image Source: L. Lazebnik

  21. Image derivatives • How can we differentiate a digital image F[x,y]? • Option 1: reconstruct a continuous image, f, then compute the derivative • Option 2: take discrete derivative (finite difference) How would you implement this as a linear filter? : : Source: S. Seitz

  22. Image gradient • The gradient of an image: The gradient points in the direction of most rapid increase in intensity • The edge strength is given by the gradient magnitude: • The gradient direction is given by: • how does this relate to the direction of the edge? Source: Steve Seitz

  23. Image gradient Source: L. Lazebnik

  24. Effects of noise Noisy input image Where is the edge? Source: S. Seitz

  25. h f * h Solution: smooth first f To find edges, look for peaks in Source: S. Seitz

  26. f Associative property of convolution • Differentiation is convolution, and convolution is associative: • This saves us one operation: Source: S. Seitz

  27. 2D edge detection filters derivative of Gaussian (x) Gaussian

  28. Derivative of Gaussian filter y-direction x-direction

  29. The Sobel operator Common approximation of derivative of Gaussian • The standard defn. of the Sobel operator omits the 1/8 term • doesn’t make a difference for edge detection • the 1/8 term is needed to get the right gradient value

More Related