Computer Vision Fitting Marc Pollefeys COMP 256 Some slides and illustrations from D. Forsyth, T. Darrel, A. Zisserman,...

Slides:



Advertisements
Similar presentations
Computer Vision - A Modern Approach Set: Probability in segmentation Slides by D.A. Forsyth Missing variable problems In many vision problems, if some.
Advertisements

776 Computer Vision Jan-Michael Frahm, Enrique Dunn Spring 2013.
Segmentation and Fitting Using Probabilistic Methods
776 Computer Vision Jared Heinly Spring 2014 (slides borrowed from Jan-Michael Frahm, Svetlana Lazebnik, and others)
Lecture 5 Hough transform and RANSAC
Projective structure from motion
Multiple View Geometry
Fitting lines. Fitting Choose a parametric object/some objects to represent a set of tokens Most interesting case is when criterion is not local –can’t.
Computer Vision Fitting Marc Pollefeys COMP 256 Some slides and illustrations from D. Forsyth, T. Darrel, A. Zisserman,...
Jan-Michael Frahm, Philippos Mordohai
Computer Vision - A Modern Approach Set: Fitting Slides by D.A. Forsyth Fitting Choose a parametric object/some objects to represent a set of tokens Most.
Fitting. We’ve learned how to detect edges, corners, blobs. Now what? We would like to form a higher-level, more compact representation of the features.
Computing F Class 8 Read notes Section 4.2. C1C1 C2C2 l2l2  l1l1 e1e1 e2e2 Fundamental matrix (3x3 rank 2 matrix) 1.Computable from corresponding points.
Fitting: Concepts and recipes. Review: The Hough transform What are the steps of a Hough transform? What line parametrization is best for the Hough transform?
Parameter estimation class 6 Multiple View Geometry Comp Marc Pollefeys.
Computer Vision Segmentation Marc Pollefeys COMP 256 Some slides and illustrations from D. Forsyth, T. Darrel,...
Multiple View Geometry Marc Pollefeys University of North Carolina at Chapel Hill Modified by Philippos Mordohai.
Triangulation and Multi-View Geometry Class 9 Read notes Section 3.3, , 5.1 (if interested, read Triggs’s paper on MVG using tensor notation, see.
Fitting a Model to Data Reading: 15.1,
Computer Vision Non-linear tracking Marc Pollefeys COMP 256 Some slides and illustrations from D. Forsyth, M. Isard, T. Darrell …
Some slides and illustrations from D. Forsyth, …
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.
Lecture 8: Image Alignment and RANSAC
Algorithm Evaluation and Error Analysis class 7 Multiple View Geometry Comp Marc Pollefeys.
Robust estimation Problem: we want to determine the displacement (u,v) between pairs of images. We are given 100 points with a correlation score computed.
Lecture 10: Robust fitting CS4670: Computer Vision Noah Snavely.
Computer Vision Segmentation Marc Pollefeys COMP 256 Some slides and illustrations from D. Forsyth, T. Darrel,...
1Jana Kosecka, CS 223b EM and RANSAC EM and RANSAC.
Computer Vision Calibration Marc Pollefeys COMP 256 Read F&P Chapter 2 Some slides/illustrations from Ponce, Hartley & Zisserman.
Fitting.
כמה מהתעשייה? מבנה הקורס השתנה Computer vision.
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean Hall 5409 T-R 10:30am – 11:50am.
Computer Vision - Fitting and Alignment
Fitting and Registration Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/14/12.
Fitting: The Hough transform. Voting schemes Let each feature vote for all the models that are compatible with it Hopefully the noise features will not.
Fitting & Matching Lecture 4 – Prof. Bregler Slides from: S. Lazebnik, S. Seitz, M. Pollefeys, A. Effros.
HOUGH TRANSFORM & Line Fitting Introduction  HT performed after Edge Detection  It is a technique to isolate the curves of a given shape / shapes.
Example: line fitting. n=2 Model fitting Measure distances.
CS654: Digital Image Analysis Lecture 25: Hough Transform Slide credits: Guillermo Sapiro, Mubarak Shah, Derek Hoiem.
776 Computer Vision Jan-Michael Frahm, Enrique Dunn Spring 2013.
Fitting: The Hough transform
EECS 274 Computer Vision Model Fitting. Fitting Choose a parametric object/some objects to represent a set of points Three main questions: –what object.
Computer Vision - Fitting and Alignment (Slides borrowed from various presentations)
CSE 185 Introduction to Computer Vision Feature Matching.
Robust Estimation Course web page: vision.cis.udel.edu/~cv April 23, 2003  Lecture 25.
Fitting.
Hough Transform CS 691 E Spring Outline Hough transform Homography Reading: FP Chapter 15.1 (text) Some slides from Lazebnik.
Grouping and Segmentation. Sometimes edge detectors find the boundary pretty well.
25 Years of RANSAC 25 Years of RANSAC Ondřej Chum
Fitting.
Line Fitting James Hayes.
Fitting: The Hough transform
Exercise Class 11: Robust Tecuniques RANSAC, Hough Transform
Lecture 7: Image alignment
Homography From Wikipedia In the field of computer vision, any
A special case of calibration
Fitting Curve Models to Edges
3D Photography: Epipolar geometry
Fitting.
Computer Vision - A Modern Approach
Segmentation by fitting a model: robust estimators and RANSAC
Fitting CS 678 Spring 2018.
776 Computer Vision Jan-Michael Frahm.
Introduction to Sensor Interpretation
CSE 185 Introduction to Computer Vision
Introduction to Sensor Interpretation
Calibration and homographies
CS5760: Computer Vision Lecture 9: RANSAC Noah Snavely
Parameter estimation class 6
CS5760: Computer Vision Lecture 9: RANSAC Noah Snavely
Presentation transcript:

Computer Vision Fitting Marc Pollefeys COMP 256 Some slides and illustrations from D. Forsyth, T. Darrel, A. Zisserman,...

Computer Vision 2 Jan 16/18-Introduction Jan 23/25CamerasRadiometry Jan 30/Feb1Sources & ShadowsColor Feb 6/8Linear filters & edgesTexture Feb 13/15Multi-View GeometryStereo Feb 20/22Optical flowProject proposals Feb27/Mar1Affine SfMProjective SfM Mar 6/8Camera CalibrationSegmentation Mar 13/15Springbreak Mar 20/22FittingProb. Segmentation Mar 27/29Silhouettes and Photoconsistency Linear tracking Apr 3/5Project UpdateNon-linear Tracking Apr 10/12Object Recognition Apr 17/19Range data Apr 24/26Final project Tentative class schedule

Computer Vision 3 Last time: Segmentation Group tokens into clusters that fit together –foreground-background –cluster on intensity, color, texture, location, … K-means graph-based

Computer Vision 4 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 5 Hough transform : straight lines implementation : 1. the parameter space is discretised 2. a counter is incremented at each cell where the lines pass 3. peaks are detected 

Computer Vision 6 Hough transform : straight lines problem : unbounded parameter domain vertical lines require infinite a Each point will add a cosine function in the ( ,  ) parameter space  alternative representation:

Computer Vision 7 tokens votes

Computer Vision 8 Hough transform : straight lines Square : Circle : 

Computer Vision 9 Hough transform : straight lines 

Computer Vision 10 Mechanics of the Hough transform Construct an array representing , d For each point, render the curve (, 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 11 tokens votes

Computer Vision 12

Computer Vision 13

Computer Vision 14

Computer Vision 15 Cascaded hough transform Tuytelaars and Van Gool ICCV‘98

Computer Vision 16 Line fitting can be max. likelihood - but choice of model is important standard least-squares total least-squares

Computer Vision 17 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 18

Computer Vision 19

Computer Vision 20

Computer Vision 21

Computer Vision 22

Computer Vision 23

Computer Vision 24

Computer Vision 25

Computer Vision 26

Computer Vision 27

Computer Vision 28

Computer Vision 29

Computer Vision 30

Computer Vision 31

Computer Vision 32 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 33

Computer Vision 34

Computer Vision 35

Computer Vision 36

Computer Vision 37 M-estimators Generally, minimize whereis the residual

Computer Vision 38

Computer Vision 39

Computer Vision 40

Computer Vision 41 Too small

Computer Vision 42 Too large

Computer Vision 43

Computer Vision 44 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

Computer Vision 45

Computer Vision 46 Distance threshold Choose t so probability for inlier is α (e.g. 0.95) Often empirically Zero-mean Gaussian noise σ then follows distribution with m =codimension of model (dimension+codimension=dimension space) CodimensionModelt 2 1line,F3.84σ 2 2H,P5.99σ 2 3T7.81σ 2

Computer Vision 47 How many samples? Choose N so that, with probability p, at least one random sample is free from outliers. e.g. p=0.99 proportion of outliers e s5%10%20%25%30%40%50%

Computer Vision 48 Acceptable consensus set? Typically, terminate when inlier ratio reaches expected ratio of inliers

Computer Vision 49 Adaptively determining the number of samples e is often unknown a priori, so pick worst case, e.g. 50%, and adapt if more inliers are found, e.g. 80% would yield e =0.2 –N=∞, sample_count =0 –While N >sample_count repeat Choose a sample and count the number of inliers Set e=1-(number of inliers)/(total number of points) Recompute N from e Increment the sample_count by 1 –Terminate

Computer Vision 50 Step 1. Extract features Step 2. Compute a set of potential matches Step 3. do Step 3.1 select minimal sample (i.e. 7 matches) Step 3.2 compute solution(s) for F Step 3.3 determine inliers until  (#inliers,#samples)<95% #inliers90%80%70%60%50% #samples Step 4. Compute F based on all inliers Step 5. Look for additional matches Step 6. Refine F based on all correct matches (generate hypothesis) (verify hypothesis) RANSAC for Fundamental Matrix

Computer Vision 51 Step 1. Extract features Step 2. Compute a set of potential matches Step 3. do Step 3.1 select minimal sample (i.e. 7 matches) Step 3.2 compute solution(s) for F Step 3.3 Randomize verification verify if inlier while hypothesis is still promising while  (#inliers,#samples)<95% Step 4. Compute F based on all inliers Step 5. Look for additional matches Step 6. Refine F based on all correct matches (generate hypothesis) (verify hypothesis) Randomized RANSAC for Fundamental Matrix

Computer Vision 52 Example: robust computation Interest points (500/image) (640x480) Putative correspondences (268) (Best match,SSD<20,±320) Outliers (117) (t=1.25 pixel; 43 iterations) Inliers (151) Final inliers (262) (2 MLE-inlier cycles; d  =0.23→d  =0.19; Iter Lev-Mar =10) #in 1-e adapt. N 62%20M 103%2.5M 4416%6, %2, % %43 from H&Z

Computer Vision 53 More on robust estimation LMedS, an alternative to RANSAC (minimize Median residual in stead of maximizing inlier count) Enhancements to RANSAC –Randomized RANSAC –Sample ‘good’ matches more frequently –… RANSAC is also somewhat robust to bugs, sometimes it just takes a bit longer…

Computer Vision 54 RANSAC for quasi-degenerate data Often data can be almost degenerate e.g. 337 matches on plane, 11 off plane RANSAC gets confused by quasi-degenerate data Probability of valid non-degenerate sample Probability of success for RANSAC (aiming for 99%) planar points only provide 6 in stead of 8 linearly independent equations for F

Computer Vision 55 RANSAC for quasi-degenerate data (QDEGSAC) (Frahm and Pollefeys, CVPR06) QDEGSAC estimates robust rank of datamatrix (i.e. large % of rows approx. fit in a lower dimensional subspace)

Computer Vision 56 Experiments for computing F matrix Comparison to Chum et al. (CVPR’05) Data courtesy of Chum et al. QDEGSAC (and DEGENSAC) are successful at dealing with quasi-degenerate data

Computer Vision 57 Experiments for computing P matrix QDEGSAC is general and can deal with other robust estimation problems QDEGSAC does not require to know which degeneracies can occur Similar results for H, Q, …

Computer Vision 58 Fitting curves other than lines In principle, an easy generalisation –The probability of obtaining a point, given a curve, is given by a negative exponential of distance squared In practice, rather hard –It is generally difficult to compute the distance between a point and a curve

Computer Vision 59 Next class: Segmentation and Fitting using Probabilistic Methods Reading: Chapter 16 Missing data: EM algorithm Model selection