Lightstick orientation; line fitting

Slides:



Advertisements
Similar presentations
Things to do in Lecture 1 Outline basic concepts of causality
Advertisements

Least squares CS1114
Sorting and Selection, Part 1 Prof. Noah Snavely CS1114
Definition  Regression Model  Regression Equation Y i =  0 +  1 X i ^ Given a collection of paired data, the regression equation algebraically describes.
Convex Hulls in Two Dimensions Definitions Basic algorithms Gift Wrapping (algorithm of Jarvis ) Graham scan Divide and conquer Convex Hull for line intersections.
Polygons and the convex hull Prof. Noah Snavely CS1114
Prof. Ramin Zabih (CS) Prof. Ashish Raj (Radiology) CS5540: Computational Techniques for Analyzing Clinical Data.
Regressions and approximation Prof. Graeme Bailey (notes modified from Noah Snavely, Spring 2009)
CS 1114: Sorting and selection (part one) Prof. Graeme Bailey (notes modified from Noah Snavely, Spring 2009)
Robustness and speed Prof. Noah Snavely CS1114
Polygons and the convex hull Prof. Noah Snavely CS1114
Neural Networks Lecture 8: Two simple learning algorithms
Voronoi diagrams and applications Prof. Ramin Zabih
CSE554AlignmentSlide 1 CSE 554 Lecture 5: Alignment Fall 2011.
Position, Velocity, and Acceleration By Han Kim Period 1.
CSE554AlignmentSlide 1 CSE 554 Lecture 8: Alignment Fall 2013.
Robustness and speed Prof. Noah Snavely CS1114
LINEAR EQUATIONS & THEIR GRAPHS CHAPTER 6. INTRODUCTION We will explore in more detail rates of change and look at how the slope of a line relates to.
Optimization and least squares Prof. Noah Snavely CS1114
Summer Assignment Review
CSE 554 Lecture 8: Alignment
CSC321: Neural Networks Lecture 9: Speeding up the Learning
Lecture Slides Elementary Statistics Twelfth Edition
What is the slope of (10, 4) and (20,3)?
The simple linear regression model and parameter estimation
Department of Mathematics
The Maximum Likelihood Method
1 Functions and Applications
Today we will graph linear equations in slope intercept form.
Statistical Data Analysis - Lecture /04/03
Computations, and the best fitting line.
Date: Topic: Similar Polygons (7.4)
Sec. 2-2: Linear Equations 9/19/17
Linear Equations, Tables, and Graphs
Sec. 2-2: Linear Equations
The Maximum Likelihood Method
Garbage collection; lightstick orientation
The Maximum Likelihood Method
Fitting Curve Models to Edges
© University of Wisconsin, CS559 Fall 2004
Student Interest Survey
Geometry.
Prof. Ramin Zabih Least squares fitting Prof. Ramin Zabih
Algebra Review.
Convex Sets & Concave Sets
Preprocessing to accelerate 1-NN
KS4 Mathematics Linear Graphs.
Chapter 3.3 – 3.5 Linear Equations and slope
Quickselect Prof. Noah Snavely CS1114
CS5112: Algorithms and Data Structures for Applications
Prof. Ramin Zabih Beyond binary search Prof. Ramin Zabih
CS5112: Algorithms and Data Structures for Applications
X and Y Intercepts.
Greedy clustering methods
Sorting, selecting and complexity
Convex Hulls Given a set of points (x1,y1),(x2,y2),…,(xn,yn), the convex hull is the smallest convex polygon containing all the points.
Principles of the Global Positioning System Lecture 11
Clipping Polygons Dr. Scott Schaefer.
Computational Geometry
Section 2-2 : Linear Equations
Bounding Boxes, Algorithm Speed
Unit 3 Vocabulary.
Part 2 of Unit 2 vocabulary
A8 Linear and real-life graphs
Created by Erin Hodgess, Houston, Texas
Quicksort and selection
Geometry.
Getting to the bottom, fast
Data Plots, Graphic Analysis and Modeling
Sorting and selection Prof. Noah Snavely CS1114
Presentation transcript:

Lightstick orientation; line fitting Prof. Ramin Zabih http://cs100r.cs.cornell.edu

Administrivia Assignment 4 out, due next Friday Quiz 5 will be Thursday Oct 18 TA evals for Gurmeet and Devin Course midterm eval! Dense box algorithm, RDZ’s way

 Mean shift algorithm Mean shift: centroid minus midpoint Within a square

Gift-wrapping algorithm Convex hull: smallest convex polygon containing the points Gift-wrapping: Start at lowest point Find new point such that all the other points lie to the left of the line to it I.e., the largest angle Repeat Figure c/o Craig Gotsman

Computing orientation We have a convex shape Now what? We could fit the polygon with an ellipse Then use the major and minor axis Major axis would tell us orientation Small minor axis is a sanity check Ellipse fitting will be a guest lecture on 11/20

Polygon major/minor axis We can look for the pair of vertices that are the farthest from each other Call this the major axis Closest pair can be the minor axis Or perhaps the closest pair on opposite sides of the major axis?

Cross product leftness The area of a triangle is related to the cross product of the edge vectors http://geometryalgorithms.com/Archive/algorithm_0101/

A less smart test for leftness A pair of points defines a line y=mx+b With a slope m and intercept b Think of this as a way to predict a value of y given a value of x We call x the independent variable Example: x = date, y = DJIA If m is positive and finite, what can we say about the points to the left of the line? We have to be careful with directionality Also: non-positive/non-finite cases

New topic: robot speedometer Suppose that our robot can occasionally report how far it has traveled (mileage) How can we tell how fast it is going? This would be a really easy problem if: The robot never lied I.e., it’s mileage is always exactly correct The robot travels at the same speed Unfortunately, the real world is full of lying, accelerating robots We’re going to figure out how to handle them

The ideal robot

The real (lying) robot

Speedometer approach We are (as usual) going to solve a very general version of this problem And explore some cool algorithms Many of which you will need in future classes The velocity of the robot at a given time is the change in mileage w.r.t. time For our ideal robot, this is the slope of the line The line fits all our data exactly In general, if we know mileage as a function of time, velocity is the derivative The velocity at any point in time is the slope of the mileage function

Independent variable (time) Estimating velocity So all we need is the mileage function We have as input some measurements Mileage, at certain times A mileage function takes as input something we have no control over Input (time): independent variable Output (mileage): dependent variable Dependent variable (mileage) Independent variable (time)

Basic strategy Based on the data, find mileage function From this, we can compute: Velocity (1st derivative) Acceleration (2nd derivative) For a while, we will only think about mileage functions which are lines In other words, we assume lying, non-accelerating robots Lying, accelerating robots are much harder

Independent variable (time) Models and parameters A model predicts a dependent variable from an independent variable So, a mileage function is actually a model A model also has some internal variables that are usually called parameters  In our line example, parameters are m,b Parameters (m,b) Dependent variable (mileage) Independent variable (time)

How to find a mileage function We need to find the best mileage function I.e., the best model I.e., the best line (best m,b) We’re going to define a function Good(m,b) that measures how much we like this line, then find the best one I.e., the (m,b) that maximizes Good(m,b) Such a function Good(m,b) is called a figure of merit, or an objective function If you really want to impress your friends, you can tell them you’re doing parameter estimation

Figure of merit? What makes a line good versus bad? This is actually a very subtle question

Residual errors The difference between what the model predicts and what we observe is called a residual error (i.e., a left-over) Consider the data point (x,y) The model m,b predicts (x,mx+b) The residual is y – (mx + b) Residuals can be easily visualized Vertical distance to the line

LS fitting and residuals