כמה מהתעשייה? מבנה הקורס השתנה Computer vision.

Slides:



Advertisements
Similar presentations
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.
Advertisements

Feature Matching and Robust Fitting Computer Vision CS 143, Brown James Hays Acknowledgment: Many slides from Derek Hoiem and Grauman&Leibe 2008 AAAI Tutorial.
Chapter 6 Feature-based alignment Advanced Computer Vision.
Photo by Carl Warner.
Hough Transform Reading Watt, An edge is not a line... How can we detect lines ?
Instructor: Mircea Nicolescu Lecture 13 CS 485 / 685 Computer Vision.
Fitting: The Hough transform
Lecture 5 Hough transform and RANSAC
1 Model Fitting Hao Jiang Computer Science Department Oct 6, 2009.
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.
Fitting a Model to Data Reading: 15.1,
CS 376b Introduction to Computer Vision 04 / 14 / 2008 Instructor: Michael Eckmann.
Fitting: The Hough transform
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.
Fitting.
Fitting and Registration
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean Hall 5409 T-R 10:30am – 11:50am.
October 8, 2013Computer Vision Lecture 11: The Hough Transform 1 Fitting Curve Models to Edges Most contours can be well described by combining several.
CSE 185 Introduction to Computer Vision
Chapter 6 Feature-based alignment Advanced Computer Vision.
Computer Vision - Fitting and Alignment
Hough Transform on the GPU Presented by Javier Garcia November 29, 2010.
1 Robust estimation techniques in real-time robot vision Ezio Malis, Eric Marchand INRIA Sophia, projet ICARE INRIA Rennes, projet Lagadic.
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 Presentation by Sumit Tandon
HOUGH TRANSFORM & Line Fitting Introduction  HT performed after Edge Detection  It is a technique to isolate the curves of a given shape / shapes.
Photo by Carl Warner. Feature Matching and Robust Fitting Computer Vision James Hays Acknowledgment: Many slides from Derek Hoiem and Grauman&Leibe.
CS 1699: Intro to Computer Vision Matching and Fitting Prof. Adriana Kovashka University of Pittsburgh September 29, 2015.
CS654: Digital Image Analysis Lecture 25: Hough Transform Slide credits: Guillermo Sapiro, Mubarak Shah, Derek Hoiem.
Fitting: The Hough transform
Model Fitting Computer Vision CS 143, Brown James Hays 10/03/11 Slides from Silvio Savarese, Svetlana Lazebnik, and Derek Hoiem.
Edge Detection and Geometric Primitive Extraction Jinxiang Chai.
EECS 274 Computer Vision Model Fitting. Fitting Choose a parametric object/some objects to represent a set of points Three main questions: –what object.
Fitting Thursday, Sept 24 Kristen Grauman UT-Austin.
Computer Vision - Fitting and Alignment (Slides borrowed from various presentations)
Object Detection 01 – Basic Hough Transformation JJCAO.
Course 8 Contours. Def: edge list ---- ordered set of edge point or fragments. Def: contour ---- an edge list or expression that is used to represent.
CSE 185 Introduction to Computer Vision Feature Matching.
October 16, 2014Computer Vision Lecture 12: Image Segmentation II 1 Hough Transform The Hough transform is a very general technique for feature detection.
CS 2750: Machine Learning Linear Regression Prof. Adriana Kovashka University of Pittsburgh February 10, 2016.
Digital Image Processing Lecture 17: Segmentation: Canny Edge Detector & Hough Transform Prof. Charlene Tsai.
Fitting.
Detecting Image Features: Corner. Corners Given an image, denote the image gradient. C is symmetric with two positive eigenvalues. The eigenvalues give.
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.
Segmentation by fitting a model: Hough transform and least squares
University of Ioannina
Fitting: Voting and the Hough Transform
Line Fitting James Hayes.
Detection of discontinuity using
Fitting: The Hough transform
Exercise Class 11: Robust Tecuniques RANSAC, Hough Transform
Lecture 7: Image alignment
CS 2750: Machine Learning Linear Regression
A special case of calibration
Fitting Curve Models to Edges
Fitting.
Photo by Carl Warner.
Photo by Carl Warner.
Segmentation by fitting a model: robust estimators and RANSAC
Fitting CS 678 Spring 2018.
Hough Transform.
Introduction to Sensor Interpretation
CSE 185 Introduction to Computer Vision
Introduction to Sensor Interpretation
Calibration and homographies
Introduction to Artificial Intelligence Lecture 22: Computer Vision II
Presentation transcript:

כמה מהתעשייה? מבנה הקורס השתנה Computer vision

Primitives detection Problem: In automated analysis of digital images, a sub-problem often arises of detecting simple shapes, such as straight lines, circles or ellipses Applications and Algorithms in CV Tutorial 3: Grouping & Fitting introduction

Primitives detection Solution? Edge detection Applications and Algorithms in CV Tutorial 3: Grouping & Fitting introduction

Finding straight lines An edge detector can be used as a pre-processing stage to obtain points (pixels) that are on the desired curve in the image space Due to imperfections in either the image data or the edge detector, there may be missing points on the desired curves as well as spatial deviations between the ideal line/circle/ellipse and the noisy edge points as they are obtained from the edge detector It is often non-trivial to group the extracted edge features to an appropriate set of lines, circles or ellipses Applications and Algorithms in CV Tutorial 3: Grouping & Fitting introduction

Grouping & Fitting methods 2 approaches for grouping & fitting 1. Global optimization / Search for parameters Least squares fit Total least squares fit Robust least squares Iterative closest point (ICP) Etc. 2. Hypothesize and test Hough transform Generalized Hough transform RANSAC Etc. Applications and Algorithms in CV Tutorial 3: Grouping & Fitting introduction

Grouping & Fitting methods 1. Global optimization / Search for parameters Least squares fit Applications and Algorithms in CV Tutorial 3: Grouping & Fitting introduction

Least square line fitting Data: (x1, y1), …, (xn, yn) Line equation: yi = m xi + b Find (m, b) to minimize: (xi, yi) Matlab: p = A \ y; Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Least square fit

Least square line fitting Question: Will least squares work in this case? Fails completely for vertical lines Question: is LSQ invariant to rotation? m2,b2 No. same edge, different parameters m1,b1 Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Least square fit

Grouping & Fitting methods 2 approaches for grouping & fitting 1. Global optimization / Search for parameters Total least squares fit Applications and Algorithms in CV Tutorial 3: Grouping & Fitting introduction

Total least square ax+by+c=0 (xi, yi) Unit normal: Find (a, b, c) to minimize the sum of squared perpendicular distances Unit normal: (xi, yi) Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Least square fit

*Solution is eigenvector corresponding to smallest eigenvalue of ATA Total least square *Solution is eigenvector corresponding to smallest eigenvalue of ATA Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Least square fit

LSQ & TLSQ analitic solutions Recap: Two Common Optimization Problems Problem statement Solution (matlab) Problem statement Solution Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Least square fit

Least square line fitting Least squares fit to the red points Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Least square fit

Least square line fitting:: robustness to noise Least squares fit with an outlier Squared error heavily penalizes outliers Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Least square fit

Least square line fitting:: conclusions Good Clearly specified objective Optimization is easy (for least squares) Bad Not appropriate for non-convex objectives May get stuck in local minima Sensitive to outliers Bad matches, extra points Doesn’t allow you to get multiple good fits Detecting multiple objects, lines, etc. Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Least square fit

Grouping & Fitting methods 2 approaches for grouping & fitting 2. Hypothesize and test Hough transform Applications and Algorithms in CV Tutorial 3: Grouping & Fitting introduction

Hough transform The purpose of the Hough transform is to address the problem of primitives detection by performing an explicit voting procedure over a set of parameterized image objects Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Hough Transform

Hough transform:: Detecting straight lines A line y = mx + b can be described as the set of all points comprising it: (x1, y1), (x2, y2)... Instead, a straight line  can be represented as a point (b, m) in the parameter space Question: does {b,m} (slope and intercept) indeed the best parameter space? Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Hough Transform

Hough transform:: Line parameterization Hough transform is calculated in polar coordinates The parameter 𝔯 represents the distance between the line and the origin 𝜃 is the angle of the vector from the origin to this closest point Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Hough Transform

Hough transform:: Line parameterization Using this parameterization, the equation of the line can be written as: which can be rearranged to: Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Hough Transform

Hough transform:: Example Question: Is there a straight line connecting the 3 dots? Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Hough Transform

Hough transform:: Example point1 point2 point3 Hough Solution: 1. For each data point, a number of lines are plotted going through it, all at different angles (𝜃) (shown as solid lines) 2. Calculate 𝔯 For each solid line from step 1 (shown as dashed lines) 3. For each data point, organize the results in a table Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Hough Transform

Hough transform:: Example Hough Solution: 4. Draw the lines received for each data point in the Hough space 5. Intersection of all lines indicate a line passing through all data points (remember: each point in Hough space represent a line in the original space) Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Hough Transform

Hough transform:: Example features votes Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Hough Transform

Hough transform:: other shapes Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Hough Transform

Hough transform:: effect of noise features Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Hough Transform

Hough transform:: effect of noise features votes Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Hough Transform

Hough transform:: random points features votes Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Hough Transform

Random points:: Dealing with noise Grid resolution tradeoff Too coarse: large votes obtained when too many different lines correspond to a single bucket Too fine: miss lines because some points that are not exactly collinear cast votes for different buckets Increment neighboring bins Smoothing in accumulator array Try to get rid of irrelevant features Take only edge points with significant gradient magnitude Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Hough Transform

Random points:: conclusions Good Robust to outliers: each point votes separately Fairly efficient (often faster than trying all sets of parameters) Provides multiple good fits Bad Some sensitivity to noise Bin size trades off between noise tolerance, precision, and speed/memory Not suitable for more than a few parameters (grid size grows exponentially) Applications and Algorithms in CV Tutorial 3: Grouping & Fitting Hough Transform

(RANdom SAmple Consensus): RANSAC (RANdom SAmple Consensus): Learning technique to estimate parameters of a model by random sampling of observed data RANSAC

RANSAC:: algorithm Algorithm: Applications and Algorithms in CV Sample (randomly) the number of points required to fit the model Solve for model parameters using samples Score by the fraction of inliers within a preset threshold of the model Repeat 1-3 until the best model is found with high confidence Applications and Algorithms in CV Tutorial 3: Grouping & Fitting RANSAC

RANSAC:: line fitting example Algorithm: Sample (randomly) the number of points required to fit the model 𝒔 Solve for model parameters using samples Score by the fraction of inliers within a preset threshold of the model Repeat 1-3 until the best model is found with high confidence Applications and Algorithms in CV Tutorial 3: Grouping & Fitting RANSAC

RANSAC:: line fitting example Algorithm: Sample (randomly) the number of points required to fit the model 𝒔 Solve for model parameters using samples Score by the fraction of inliers within a preset threshold of the model Repeat 1-3 until the best model is found with high confidence Applications and Algorithms in CV Tutorial 3: Grouping & Fitting RANSAC

RANSAC:: line fitting example Algorithm: Sample (randomly) the number of points required to fit the model 𝒔 Solve for model parameters using samples Score by the fraction of inliers within a preset threshold of the model Repeat 1-3 until the best model is found with high confidence Applications and Algorithms in CV Tutorial 3: Grouping & Fitting RANSAC

RANSAC:: line fitting example Algorithm: Sample (randomly) the number of points required to fit the model 𝒔 Solve for model parameters using samples Score by the fraction of inliers within a preset threshold of the model Repeat 1-3 until the best model is found with high confidence Applications and Algorithms in CV Tutorial 3: Grouping & Fitting RANSAC

RANSAC:: parameter selection 𝒔 :initial number of points (Typically minimum number needed to fit the model) 𝑵 :number of RANSAC iterations 𝒑: probability of choosing 𝒔 inliers at least in some iteration 𝝎 :probability of choosing an inliers 𝝎𝒔 :probability that all s points are inliers 𝟏−𝝎𝒔:probability that at least one point is an outlier 𝟏−𝒑= 𝟏−𝝎𝒔 𝑵: probability that the algorithm never selects a set of s inliers Applications and Algorithms in CV Tutorial 3: Grouping & Fitting RANSAC

RANSAC:: conclusions Good Bad Robust to outliers Applicable for larger number of parameters than Hough transform Parameters are easier to choose than Hough transform Bad Computational time grows quickly with fraction of outliers and number of parameters Not good for getting multiple fits Applications and Algorithms in CV Tutorial 3: Grouping & Fitting RANSAC