1 / 15

Hough transform and RANSAC

Hough transform and RANSAC. Further abstraction. Even after edge detection we may have more information than we want. How can we abstract this even further? Choose a parametric object to represent a set of pixels Example: a line (or segment) can represent a set of edge pixels

fisk
Download Presentation

Hough transform and RANSAC

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. Hough transform and RANSAC Computer Vision Set: Hough transform and RANSAC Slides by D.A. Forsyth, C.F. Olson

  2. Further abstraction • Even after edge detection we may have more information than we want. • How can we abstract this even further? • Choose a parametric object to represent a set of pixels • Example: a line (or segment) can represent a set of edge pixels • Other possibilities include circles and complex structures Computer Vision Set: Hough transform and RANSAC Slides by D.A. Forsyth, C.F. Olson

  3. Fitting • After deciding what representation you are using, there are three main questions: • How many objects are there? • To which of the objects does each pixel belong (if any)? • What parameters best represents each of the objects? Computer Vision Set: Hough transform and RANSAC Slides by D.A. Forsyth, C.F. Olson

  4. Curve extraction • One way to extract curves is to link edge pixels together, with junctions indicating breaks. • Can fit curves with model (line, conic section, etc.) after extraction. • However, this doesn’t usually work that well: • Edges are broken by areas of low contrast • Junctions are often missed by edge detectors • Another bad idea: test all possible lines (or other shape). Computer Vision Set: Hough transform and RANSAC Slides by D.A. Forsyth, C.F. Olson

  5. Incremental line fitting Computer Vision Set: Hough transform and RANSAC Slides by D.A. Forsyth, C.F. Olson

  6. The Hough transform • The Hough transform is an important method for detecting structure (originally lines, but much more general). • The basic idea is to examine the parameter space for lines, rather than the image space, by mapping pixels in the image into the parameter space. Computer Vision Set: Hough transform and RANSAC Slides by D.A. Forsyth, C.F. Olson

  7. Line parameterizations A line is the set of points (x, y) such that: y = mx + b (slope-intercept) or (sin θ) x + (cos θ) y + ρ = 0 (rho-theta) (Two common ways to parameterize a line.) Computer Vision Set: Hough transform and RANSAC Slides by D.A. Forsyth, C.F. Olson

  8. The Hough transform • Different choices of m, b (or q, ρ > 0) give different lines • For any (x, y) there is a one parameter family of lines through this point. • Each point gets to vote for each line in the family; if there is a line that has lots of votes, that should be the line passing through the points Computer Vision Set: Hough transform and RANSAC Slides by D.A. Forsyth, C.F. Olson

  9. ρ y x pixels θ votes Computer Vision Set: Hough transform and RANSAC Slides by D.A. Forsyth, C.F. Olson

  10. Construct an array representing q, ρ For each point, render the curve (q, ρ) into this array, adding one at each cell Difficulties: How big should the cells be? If too big, we can’t distinguish between different lines; if too small, noise causes lines to be missed) How many lines? Count the peaks in the array Who belongs to which line? Tag the votes, or post-process Mechanics of the Hough transform Computer Vision Set: Hough transform and RANSAC Slides by D.A. Forsyth, C.F. Olson

  11. ρ y x pixels votes θ Computer Vision Set: Hough transform and RANSAC Slides by D.A. Forsyth, C.F. Olson

  12. ρ y x pixels votes θ Computer Vision Set: Hough transform and RANSAC Slides by D.A. Forsyth, C.F. Olson

  13. Hough transform algorithm Construct parameter space voting array (bins). For each edge pixel in image: Increment counter for each bin consistent with pixel. For each bin in voting array: Determine if sufficient votes exist (and local maximum). If so, output line. Computer Vision Set: Hough transform and RANSAC Slides by D.A. Forsyth, C.F. Olson

  14. Variations • Can use pairs of points to vote in parameter space • Two points are consistent with only one line • Can use the edge gradient to reduce the number of bins consistent with an edge pixel • One point plus orientation is consistent with only one line • Same ideas can be applied to many other structures: • Circles • Conic sections • Arbitrary 2D shapes • Three-dimensional objects Computer Vision Set: Hough transform and RANSAC Slides by D.A. Forsyth, C.F. Olson

  15. Choose a small subset uniformly at random Fit the selected subset Anything else that is close to this fit is included Refit Do this many times and choose the best fits Issues How big a subset? Smallest possible How many times? Often enough that we are likely to have a good line How close is “close enough”? Depends on the problem RANSAC Computer Vision Set: Hough transform and RANSAC Slides by D.A. Forsyth, C.F. Olson

More Related