1 / 74

CS 440 / ECE 448 Introduction to Artificial Intelligence Fall 2006

Learn about edge detection techniques to convert a 2D image into curves, extracting important features of the scene in a more compact manner than pixels.

leelinda
Download Presentation

CS 440 / ECE 448 Introduction to Artificial Intelligence Fall 2006

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. CS 440 / ECE 448Introduction to Artificial IntelligenceFall 2006 Instructor: Eyal Amir TAs: Deepak Ramachandran (head TA), Jaesik Choi CS440 / ECE 448 – Fall 2006 Lecture #2

  2. Edge detection • Convert a 2D image into a set of curves • Extracts salient features of the scene • More compact than pixels CS440 / ECE 448 – Fall 2006 Lecture #2

  3. Origin of Edges • Edges are caused by a variety of factors surface normal discontinuity depth discontinuity surface color discontinuity illumination discontinuity CS440 / ECE 448 – Fall 2006 Lecture #2

  4. Last Time: Detecting Local Features • Convolution: Slide a window over the image, creating an image of dot products • Detect • Line • Edge / Edgel • Corners • Direction of the above CS440 / ECE 448 – Fall 2006 Lecture #2

  5. Effect of  (Gaussian kernel size) original Canny with Canny with • The choice of depends on desired behavior • large detects large scale edges • small detects fine features CS440 / ECE 448 – Fall 2006 Lecture #2

  6. Edge detection by subtraction original CS440 / ECE 448 – Fall 2006 Lecture #2

  7. Edge detection by subtraction smoothed (5x5 Gaussian) CS440 / ECE 448 – Fall 2006 Lecture #2

  8. Edge detection by subtraction Why does this work? smoothed – original (scaled by 4, offset +128) CS440 / ECE 448 – Fall 2006 Lecture #2 filter demo

  9. Gaussian - image filter Gaussian delta function CS440 / ECE 448 – Fall 2006 Lecture #2 Laplacian of Gaussian

  10. An edge is not a line... • How can we detect lines ? CS440 / ECE 448 – Fall 2006 Lecture #2

  11. Finding lines in an image • Option 1: • Search for the line at every possible position/orientation • What is the cost of this operation? • Option 2: • Use a voting scheme: Hough transform CS440 / ECE 448 – Fall 2006 Lecture #2

  12. Finding lines in an image y b • Connection between image (x,y) and Hough (m,b) spaces • A line in the image corresponds to a point in Hough space • To go from image space to Hough space: • given a set of points (x,y), find all (m,b) such that y = mx + b b0 m0 x m image space Hough space CS440 / ECE 448 – Fall 2006 Lecture #2

  13. A: the solutions of b = -x0m + y0 • this is a line in Hough space Finding lines in an image y b • Connection between image (x,y) and Hough (m,b) spaces • A line in the image corresponds to a point in Hough space • To go from image space to Hough space: • given a set of points (x,y), find all (m,b) such that y = mx + b • What does a point (x0, y0) in the image space map to? y0 x0 x m image space Hough space CS440 / ECE 448 – Fall 2006 Lecture #2

  14. Hough transform algorithm • Typically use a different parameterization • d is the perpendicular distance from the line to the origin •  is the angle this perpendicular makes with the x axis • Why? • Basic Hough transform algorithm • Initialize H[d, ]=0 • for each edge point I[x,y] in the image for  = 0 to 180 H[d, ] += 1 • Find the value(s) of (d, ) where H[d, ] is maximum • The detected line in the image is given by • What’s the running time (measured in # votes)? CS440 / ECE 448 – Fall 2006 Lecture #2

  15. Extensions • Extension 1: Use the image gradient • same • for each edge point I[x,y] in the image compute unique (d, ) based on image gradient at (x,y) H[d, ] += 1 • same • same • What’s the running time measured in votes? • Extension 2 • give more votes for stronger edges • Extension 3 • change the sampling of (d, ) to give more/less resolution • Extension 4 • The same procedure can be used with circles, squares, or any other shape CS440 / ECE 448 – Fall 2006 Lecture #2

  16. Extensions • Extension 1: Use the image gradient • same • for each edge point I[x,y] in the image compute unique (d, ) based on image gradient at (x,y) H[d, ] += 1 • same • same • What’s the running time measured in votes? • Extension 2 • give more votes for stronger edges • Extension 3 • change the sampling of (d, ) to give more/less resolution • Extension 4 • The same procedure can be used with circles, squares, or any other shape CS440 / ECE 448 – Fall 2006 Lecture #2

  17. Hough demos Line : http://www.dai.ed.ac.uk/HIPR2/houghdemo.html http://www.dis.uniroma1.it/~iocchi/slides/icra2001/java/hough.html Circle : http://www.markschulze.net/java/hough/ CS440 / ECE 448 – Fall 2006 Lecture #2

  18. CS440 / ECE 448 – Fall 2006 Lecture #2

  19. Edge detection • What real-world position does a pixel represent? CS440 / ECE 448 – Fall 2006 Lecture #2

  20. Simple Segmentation: Subtraction Next: Positioning CS440 / ECE 448 – Fall 2006 Lecture #2

  21. Processing an Image Image: array of pixels Localizing Transformation to real-world, 3D coordinates Features: lines, shapes, invariants, colors, positions, histograms matching against prototype/class Segmentation, aggregation CS440 / ECE 448 – Fall 2006 Lecture #2

  22. Processing an Image Image: array of pixels Localizing Transformation to real-world, 3D coordinates Features: lines, shapes, invariants, colors, positions, histograms CS440 / ECE 448 – Fall 2006 Lecture #2

  23. Rest of Today: Vision & Localization • 3-D EUCLIDEAN SPACE & RIGID-BODY MOTION • Coordinates and coordinate frames • Rigid-body motion and homogeneous • coordinates • GEOMETRIC MODELS OF IMAGE FORMATION • Pinhole camera model • CAMERA INTRINSIC PARAMETERS • From metric to pixel coordinates CS440 / ECE 448 – Fall 2006 Lecture #2

  24. Frontal pinhole IMAGE FORMATION – Pinhole Camera Model Pinhole Z CS440 / ECE 448 – Fall 2006 Lecture #2

  25. Coordinates of a point in space: Standard base vectors: 3-D EUCLIDEAN SPACE - Cartesian Coordinate Frame CS440 / ECE 448 – Fall 2006 Lecture #2

  26. Coordinates of the vector : 3-D EUCLIDEAN SPACE - Vectors A “free” vector is defined by a pair of points : CS440 / ECE 448 – Fall 2006 Lecture #2

  27. Cross product between two vectors: 3-D EUCLIDEAN SPACE – Inner Product and Cross Product Inner product between two vectors: CS440 / ECE 448 – Fall 2006 Lecture #2

  28. Coordinates are related by: RIGID-BODY MOTION – Rotation Rotation matrix: R is Orthogonal: CS440 / ECE 448 – Fall 2006 Lecture #2

  29. Coordinates are related by: Velocities are related by: RIGID-BODY MOTION – Rotation and Translation CS440 / ECE 448 – Fall 2006 Lecture #2

  30. Homogeneous coordinates: Homogeneous coordinates/velocities are related by: RIGID-BODY MOTION – Homogeneous Coordinates 3-D coordinates are related by: CS440 / ECE 448 – Fall 2006 Lecture #2

  31. Frontal pinhole IMAGE FORMATION – Pinhole Camera Model Pinhole Z CS440 / ECE 448 – Fall 2006 Lecture #2

  32. Homogeneous coordinates IMAGE FORMATION – Pinhole Camera Model 2-D coordinates CS440 / ECE 448 – Fall 2006 Lecture #2

  33. metric coordinates Linear transformation pixel coordinates CAMERA PARAMETERS – Pixel Coordinates CS440 / ECE 448 – Fall 2006 Lecture #2

  34. Calibration matrix (intrinsic parameters) Projection matrix Camera model CAMERA PARAMETERS – Calibration Matrix and Camera Model Pinhole camera Pixel coordinates CS440 / ECE 448 – Fall 2006 Lecture #2

  35. Projection of a 3-D point to an image plane IMAGE FORMATION – Image of a Point Homogeneous coordinates of a 3-D point Homogeneous coordinates of its 2-D image CS440 / ECE 448 – Fall 2006 Lecture #2

  36. Homogeneous representation of its 2-D image Projection of a 3-D line to an image plane IMAGE FORMATION – Image of a Line Homogeneous representation of a 3-D line CS440 / ECE 448 – Fall 2006 Lecture #2

  37. Multiple Images . . . • Images are all “incident” at the corresponding features in space; • Features in space have many types of incidence relationships; • Features in space have many types of metric relationships. CS440 / ECE 448 – Fall 2006 Lecture #2

  38. CAMERA PARAMETERS – Radial Distortion Nonlinear transformation along the radial direction Distortion correction: make lines straight CS440 / ECE 448 – Fall 2006 Lecture #2

  39. Next class: Probabilistic Knowledge CS440 / ECE 448 – Fall 2006 Lecture #2

  40. CS440 / ECE 448 – Fall 2006 Lecture #2

  41. Brooks and Binford, 1981 • Sullivan and Ponce, 1998 • Invariants (Weiss, 1988; Rothwell et al., 1992; etc.) • Murase and Nayar, 1992 • Schmid and Mohr, 1996 CS440 / ECE 448 – Fall 2006 Lecture #2

  42. Human Bug ?? Face Camel CS440 / ECE 448 – Fall 2006 Lecture #2

  43. EXTRA SLIDES(not included in class presentation) CS440 / ECE 448 – Fall 2006 Lecture #2

  44. Hough Transform for Curves • The H.T. can be generalized to detect any curve that can be expressed in parametric form: • Y = f(x, a1,a2,…ap) • a1, a2, … ap are the parameters • The parameter space is p-dimensional • The accumulating array is LARGE! CS440 / ECE 448 – Fall 2006 Lecture #2

  45. Corner detection Corners contain more edges than lines. • A point on a line is hard to match. CS440 / ECE 448 – Fall 2006 Lecture #2

  46. Corners contain more edges than lines. • A corner is easier CS440 / ECE 448 – Fall 2006 Lecture #2

  47. Edge Detectors Tend to Fail at Corners CS440 / ECE 448 – Fall 2006 Lecture #2

  48. Finding Corners • Intuition: • Right at corner, gradient is ill defined. • Near corner, gradient has two different values. CS440 / ECE 448 – Fall 2006 Lecture #2

  49. Formula for Finding Corners We look at matrix: Gradient with respect to x, times gradient with respect to y Sum over a small region, the hypothetical corner WHY THIS? CS440 / ECE 448 – Fall 2006 Lecture #2 Matrix is symmetric

  50. First, consider case where: • This means all gradients in neighborhood are: • (k,0) or (0, c) or (0, 0) (or off-diagonals cancel). • What is region like if: • l1 = 0? • l2 = 0? • l1 = 0 and l2 = 0? • l1 > 0 and l2 > 0? CS440 / ECE 448 – Fall 2006 Lecture #2

More Related