1 / 63

Edge Detection and Geometric Primitive Extraction

Edge Detection and Geometric Primitive Extraction. Jinxiang Chai. Outline. Edge detection Geometric primitive extraction. Edge Detection. What are edges in this image?. Edge Detection. What are edges in this image?. Origin of Edges. Edges are caused by a variety of factors.

ailsa
Download Presentation

Edge Detection and Geometric Primitive Extraction

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 and Geometric Primitive Extraction Jinxiang Chai

  2. Outline Edge detection Geometric primitive extraction

  3. Edge Detection What are edges in this image?

  4. Edge Detection What are edges in this image?

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

  6. Edge Detection One of the most important vision problems - really easy for human - really difficult for computers - fundamental for computer vision (object recognition, 3D reconstruction, etc.) How to tell a pixel is on the edge?

  7. Characterizing edges An edge is a place of rapid change in the image intensity function intensity function(along horizontal scanline) first derivative edges are related to derivative image

  8. Gradient A vector variable - Direction of the maximum growth of the function - Magnitude of the growth - Perpendicular to the edge direction

  9. Gradients

  10. How to Calculate Gradient? Intensity How to compute ? Pixel column

  11. The Good ole’ Taylor Series or… Subtracting the second from the first we obtain

  12. Discrete Gradient Estimation For discrete functions, we can use the first order approximation of the gradient where h corresponds to the step size

  13. Discrete Gradient Estimation For discrete functions, we can use the first order approximation of the gradient where h corresponds to the step size For our purposes, h corresponds to the width of 1 pixel =>

  14. Discrete Gradient Estimation So how can we compute the image gradient efficiently? - Using our good old friend convolution! - Dropped off the “divide by 2” for speed considerations. - This only scales the gradient.

  15. Taking the Discrete Derivative abs()

  16. Horizontal [-1 0 1] INPUT IMAGE 1) Edge Enhancement Vertical [-1 0 1]T Basic Edge Detection Step 1 But isn’t edge detection susceptible to noise?

  17. 1) Noise Smoothing Basic Edge Detection Steps 1-2 Horizontal [-1 0 1] INPUT IMAGE 2) Edge Enhancement Vertical [-1 0 1]T

  18. Discrete Gradient Estimation Remember that the gradient is a vector and we have calculated the coefficients in the x and y directions at each point in the image After convolving, we get the magnitude of the gradient from at each point (pixel) from In practice, we often sum the absolute values of the components for computational efficiency

  19. 1) Noise Smoothing Basic Edge Detection (cont’d) Horizontal [-1 0 1] INPUT IMAGE 2) Edge Enhancement Vertical [-1 0 1]T “GRADIENT” IMAGE

  20. 1) Noise Smoothing Basic Edge Detection (cont’d) Horizontal [-1 0 1] INPUT IMAGE 2) Edge Enhancement Vertical [-1 0 1]T What does the gradient image mean? “GRADIENT” IMAGE

  21. 1) Noise Smoothing Basic Edge Detection (cont’d) Horizontal [-1 0 1] INPUT IMAGE 2) Edge Enhancement Vertical [-1 0 1]T What does the gradient image mean? - Magnitude of intensity changes around each pixel “GRADIENT” IMAGE

  22. Discrete Gradient Estimation So how do we segment the edges from the rest of the scene? - Thresholding!

  23. The Effects of Thresholding While edge features are independent of illumination, the edge strength is not! Results from threshold values of 50 and 100

  24. 1) Noise Smoothing Basic Edge Detection Summary Horizontal [-1 0 1] INPUT IMAGE 2) Edge Enhancement Vertical [-1 0 1]T 3)Threshold EDGE IMAGE “GRADIENT” IMAGE

  25. The effects of Filtering Noise Threshold 20 Threshold 50 Unsmoothed Edges Gaussian Smoothing

  26. Sobel Edge Detection One of the dominant edge detection schemes uses the Sobel operators Convolving each of these with the original image generates horizontal and vertical gradient images that are combined as before

  27. Sobel Edge Detection One of the dominant edge detection schemes uses the Sobel operators • - Can be approximated as a derivative of Gaussian • First Gaussian smoothing and then compute derivatives

  28. Sobel Edge Detection One of the dominant edge detection schemes uses the Sobel operators • - Can be approximated as a derivative of Gaussian • First Gaussian smoothing and then compute derivatives Why?

  29. Sobel Edge Detection One of the dominant edge detection schemes uses the Sobel operators • - Can be approximated as a derivative of Gaussian • First Gaussian smoothing and then compute derivatives • - In practice we may still need to smooth for noise

  30. Robert and Prewitt Edge Detectors The Prewitt is similar to the Sobel, but uses a different kernel Roberts was an early edge detector kernel

  31. Sobel Edge Detector Java Applet

  32. Second Derivative Edge Detector Sobel Operator can produce thick edges; ideally we are looking for infinitely thin boundaries

  33. Second Derivative Edge Detector Sobel Operator can produce thick edges; ideally we are looking for infinitely thin boundaries An alternative approach is to look for local extrema in the first derivative A peak in the first derivative corresponds what in the second derivative?

  34. Second Derivative Edge Detector Sobel Operator can produce thick edges; ideally we are looking for infinitely thin boundaries An alternative approach is to look for local extrema in the first derivative A peak in the first derivative corresponds what in the second derivative?

  35. Localization with Laplacian An equivalent measure of the second derivative in 2D is the Laplacian: Numerically, we approximate the Laplacian using the following filtering kernel: Zeros crossings of the filter corresponds to positions of maximum gradient. - can be used for detecting edges - might be sensitive to noise - need to filter the image

  36. Laplacian of Gaussian In the LoG, there are two methods which are mathematically equivalent: - Convolve the image with a gaussian smoothing filter and compute the Laplacian of the result - Convolve the image with the linear filter that is the Laplacian of the Gaussian filter

  37. The Laplacian of Gaussian Kernel

  38. The Laplacian of Gaussian Filter Kernel

  39. Laplacian Edge Detector To avoid detection of insignificant edges, only the zero crossings whose corresponding first derivative is above some threshold, are selected as edge point. Java applet: Click here

  40. Edge Detection • Matlab functions for edge detection: - BW = edge(I,'sobel') % Sobel detector - BW = edge(I,'prewitt') % Prewitt detector - BW = edge(I,'roberts') % Robert detector - BW = edge(I,'log') % Laplacian of Gaussian detector - BW = edge(I,'canny') % canny detector

  41. Outline Edge detection Geometric primitive extraction

  42. Finding straight lines One solution: try many possible lines and see how many points each line passes through Hough transform provides a fast way to do this

  43. Hough transform An early type of voting scheme General outline: Discretize parameter space into bins For each feature point in the image, put a vote in every bin in the parameter space that could have generated this point Find bins that have the most votes Image space Hough parameter space P.V.C. Hough, Machine Analysis of Bubble Chamber Pictures, Proc. Int. Conf. High Energy Accelerators and Instrumentation, 1959

  44. Parameter space representation A line in the image corresponds to a point in Hough space Image space Hough parameter space Source: S. Seitz

  45. Parameter space representation What does a point (x0, y0) in the image space map to in the Hough space? Image space Hough parameter space

  46. Parameter space representation What does a point (x0, y0) in the image space map to in the Hough space? Answer: the solutions of b = –x0m + y0 This is a line in Hough space Image space Hough parameter space

  47. Parameter space representation Where is the line that contains both (x0, y0) and (x1, y1)? Image space Hough parameter space (x1, y1) (x0, y0) b = –x1m + y1

  48. Parameter space representation Where is the line that contains both (x0, y0) and (x1, y1)? It is the intersection of the lines b = –x0m + y0 and b = –x1m + y1 Image space Hough parameter space (x1, y1) (x0, y0) b = –x1m + y1

  49. Problems with the (m,b) space: Unbounded parameter domain Vertical lines require infinite m Parameter space representation

  50. Problems with the (m,b) space: Unbounded parameter domain Vertical lines require infinite m Alternative: polar representation Parameter space representation Each point will add a sinusoid in the (,) parameter space

More Related