Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Vision - A Modern Approach

Similar presentations


Presentation on theme: "Computer Vision - A Modern Approach"— Presentation transcript:

1 Computer Vision - A Modern Approach
Fitting Choose a parametric object/some objects to represent a set of tokens Most interesting case is when criterion is not local can’t tell whether a set of points lies on a line by looking only at each point and the next. Three main questions: what object represents this set of tokens best? which of several objects gets which token? how many objects are there? (you could read line for object here, or circle, or ellipse or...) Computer Vision - A Modern Approach Set: Fitting Slides by D.A. Forsyth

2 Fitting and the Hough Transform
Purports to answer all three questions in practice, answer isn’t usually all that much help We do for lines only A line is the set of points (x, y) such that Different choices of q, d>0 give different lines For any (x, y) there is a one parameter family of lines through this point, given by 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 - A Modern Approach Set: Fitting Slides by D.A. Forsyth

3 Computer Vision - A Modern Approach
Figure 15.1, top half. Note that most points in the vote array are very dark, because they get only one vote. tokens votes Computer Vision - A Modern Approach Set: Fitting Slides by D.A. Forsyth

4 Mechanics of the Hough transform
Construct an array representing q, d For each point, render the curve (q, d) into this array, adding one at each cell Difficulties how big should the cells be? (too big, and we cannot distinguish between quite different lines; too small, and noise causes lines to be missed) How many lines? count the peaks in the Hough array Who belongs to which line? tag the votes Hardly ever satisfactory in practice, because problems with noise and cell size defeat it Computer Vision - A Modern Approach Set: Fitting Slides by D.A. Forsyth

5 Computer Vision - A Modern Approach
This is 15.1 lower half tokens votes Computer Vision - A Modern Approach Set: Fitting Slides by D.A. Forsyth

6 Computer Vision - A Modern Approach
15.2; main point is that lots of noise can lead to large peaks in the array Computer Vision - A Modern Approach Set: Fitting Slides by D.A. Forsyth

7 Computer Vision - A Modern Approach
This is the number of votes that the real line of 20 points gets with increasing noise (figure15.3) Computer Vision - A Modern Approach Set: Fitting Slides by D.A. Forsyth

8 Computer Vision - A Modern Approach
Figure 15.4; as the noise increases in a picture without a line, the number of points in the max cell goes up, too Computer Vision - A Modern Approach Set: Fitting Slides by D.A. Forsyth

9 Computer Vision - A Modern Approach
Line fitting can be max. likelihood - but choice of model is important This is figure 15.5; I didn’t have the energy to write the algebra around that figure out on a slide, but the point is well worth making. Computer Vision - A Modern Approach Set: Fitting Slides by D.A. Forsyth

10 Who came from which line?
Assume we know how many lines there are - but which lines are they? easy, if we know who came from which line Three strategies Incremental line fitting K-means Probabilistic (later!) Computer Vision - A Modern Approach Set: Fitting Slides by D.A. Forsyth

11 Computer Vision - A Modern Approach
Incremental line fitting is a really useful idea; it’s the easiest way to fit a set of lines to a curve, and is often quite useful. Computer Vision - A Modern Approach Set: Fitting Slides by D.A. Forsyth

12 Computer Vision - A Modern Approach
You should point out that a little additional cleverness will be required to avoid having lines that pass through one point, etc. Computer Vision - A Modern Approach Set: Fitting Slides by D.A. Forsyth

13 Computer Vision - A Modern Approach
Robustness As we have seen, squared error can be a source of bias in the presence of noise points One fix is EM - we’ll do this shortly Another is an M-estimator Square nearby, threshold far away A third is RANSAC Search for good points Computer Vision - A Modern Approach Set: Fitting Slides by D.A. Forsyth

14 Computer Vision - A Modern Approach
Least squares fit to the red points Computer Vision - A Modern Approach Set: Fitting Slides by D.A. Forsyth

15 Computer Vision - A Modern Approach
Also a least squares fit. The problem is the single point on the right; the error for that point is so large that it drags the line away from the other points (the total error is lower if these points are some way from the line, because then the point on the line is not so dramatically far away). Computer Vision - A Modern Approach Set: Fitting Slides by D.A. Forsyth

16 Computer Vision - A Modern Approach
Same problem as above Computer Vision - A Modern Approach Set: Fitting Slides by D.A. Forsyth

17 Computer Vision - A Modern Approach
Detail of the previous slide - the line is actually quite far from the points. (All this is fig 15.7) Computer Vision - A Modern Approach Set: Fitting Slides by D.A. Forsyth

18 Computer Vision - A Modern Approach
RANSAC Choose a small subset uniformly at random Fit to that Anything that is close to result is signal; all others are noise Refit Do this many times and choose the best Issues How many times? Often enough that we are likely to have a good line How big a subset? Smallest possible What does close mean? Depends on the problem What is a good line? One where the number of nearby points is so big it is unlikely to be all outliers This algorithm contains concepts that are hugely useful; in my experience, everyone with some experience of applied problems who doesn’t yet know RANSAC is almost immediately able to use it to simplify some problem they’ve seen. Computer Vision - A Modern Approach Set: Fitting Slides by D.A. Forsyth

19 Computer Vision - A Modern Approach
Set: Fitting Slides by D.A. Forsyth


Download ppt "Computer Vision - A Modern Approach"

Similar presentations


Ads by Google