02 – Object Modeling Overview Point Selection Bounding Box Line Equation Least Square Line Equation Conclusions.

Slides:



Advertisements
Similar presentations
Linear Least Squares Approximation By Kristen Bauer, Renee Metzger, Holly Soper, Amanda Unklesbay.
Advertisements

Hough Transforms CSE 6367 – Computer Vision Vassilis Athitsos University of Texas at Arlington.
Managerial Economics in a Global Economy
Statistical Techniques I EXST7005 Simple Linear Regression.
Uncertainty Representation. Gaussian Distribution variance Standard deviation.
Image Segmentation Region growing & Contour following Hyeun-gu Choi Advisor: Dr. Harvey Rhody Center for Imaging Science.
Motion Analysis Slides are from RPI Registration Class.
GG 313 Geological Data Analysis # 18 On Kilo Moana at sea October 25, 2005 Orthogonal Regression: Major axis and RMA Regression.
CS 376b Introduction to Computer Vision 04 / 11 / 2008 Instructor: Michael Eckmann.
Motion Analysis (contd.) Slides are from RPI Registration Class.
Linear fits You know how to use the solver to minimize the chi^2 to do linear fits… Where do the errors on the slope and intercept come from?
COMP322/S2000/L221 Relationship between part, camera, and robot (cont’d) the inverse perspective transformation which is dependent on the focal length.
Fitting a Model to Data Reading: 15.1,
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.
THE REAL NUMBERS College Algebra. Sets Set notation Union of sets Intersection of sets Subsets Combinations of three or more sets Applications.
Principles of Least Squares
Copyright © Cengage Learning. All rights reserved. 7.6 The Inverse of a Square Matrix.
כמה מהתעשייה? מבנה הקורס השתנה Computer vision.
Matrices Write and Augmented Matrix of a system of Linear Equations Write the system from the augmented matrix Solve Systems of Linear Equations using.
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.
Algebra Review. Polynomial Manipulation Combine like terms, multiply, FOIL, factor, etc.
FEATURE EXTRACTION FOR JAVA CHARACTER RECOGNITION Rudy Adipranata, Liliana, Meiliana Indrawijaya, Gregorius Satia Budhi Informatics Department, Petra Christian.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
Solving Systems of Equations and Inequalities Section 3.1A-B Two variable linear equations Section 3.1C Matrices Resolution of linear systems Section 3.1D.
CS 6825: Binary Image Processing – binary blob metrics
13.6 MATRIX SOLUTION OF A LINEAR SYSTEM.  Examine the matrix equation below.  How would you solve for X?  In order to solve this type of equation,
Rational Functions. To sketch the graph of a rational function: Determine if the function points of discontinuity for the.
Edges. Edge detection schemes can be grouped in three classes: –Gradient operators: Robert, Sobel, Prewitt, and Laplacian (3x3 and 5x5 masks) –Surface.
Motion Segmentation By Hadas Shahar (and John Y.A.Wang, and Edward H. Adelson, and Wikipedia and YouTube) 1.
Chapter 10, Part II Edge Linking and Boundary Detection The methods discussed in the previous section yield pixels lying only on edges. This section.
PROGRAM 6: Curve Fitting to fit a straight line to a given set of data points using Least Square Method If data is in terms of two variables x and y then.
CSE554SimplificationSlide 1 CSE 554 Lecture 7: Simplification Fall 2013.
CS654: Digital Image Analysis Lecture 25: Hough Transform Slide credits: Guillermo Sapiro, Mubarak Shah, Derek Hoiem.
Standard What is the y-intercept of the graph of 4x + 2y = 12
Introduction to Computer Graphics CS 445 / 645 Lecture 9 Chapter 4: Rasterization L. McMillan MIT notes (Fall ’98)
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.
Chapter 9: Image Segmentation
 Cross Multiply – used to solve simple rational equations  Can only be done when each side has a single rational expression.
Digital Image Processing Lecture 17: Segmentation: Canny Edge Detector & Hough Transform Prof. Charlene Tsai.
Topics 8: Quadratics. Table of Contents 1.Introduction to Solving Quadratics 2.Solving Quadratic Functions by Graphing 3.Transformation of Quadratic Functions.
Prof. Amr Goneid, AUC1 Analysis & Design of Algorithms (CSCE 321) Prof. Amr Goneid Department of Computer Science, AUC Part 3. Time Complexity Calculations.
Simple and multiple regression analysis in matrix form Least square Beta estimation Beta Simple linear regression Multiple regression with two predictors.
Grouping and Segmentation. Sometimes edge detectors find the boundary pretty well.
Coordinate Transformations
Regression lines A line of best fit should: Go through ( x , y )
Statistics 101 Chapter 3 Section 3.
The Inverse of a Square Matrix
Line Fitting James Hayes.
Detection of discontinuity using
Ch12.1 Simple Linear Regression
A special case of calibration
Fitting Curve Models to Edges
Histogram Histogram is a graph that shows frequency of anything. Histograms usually have bars that represent frequency of occuring of data. Histogram has.
Fitting.
Dongwook Kim, Beomjun Kim, Taeyoung Chung, and Kyongsu Yi
Image Processing, Lecture #8
CHAPTER- 17 CORRELATION AND REGRESSION
Image Processing, Lecture #8
Chapter 5.1 & 5.2 Quadratic Functions.
Fitting CS 678 Spring 2018.
5.2 Least-Squares Fit to a Straight Line
Grape Detection in Vineyards Introduction To Computational and Biological Vision final project Kobi Ruham Eli Izhak.
CSE 185 Introduction to Computer Vision
6.1.1 Deriving OLS OLS is obtained by minimizing the sum of the square errors. This is done using the partial derivative 6.
Calibration and homographies
Revision 4 CSMSC5711 Revision 4: CSMC5711 v.9a.
Introduction to Artificial Intelligence Lecture 22: Computer Vision II
Lecture 11: Image alignment, Part 2
: Chapter 7: Two Dimensional Image Transformation
Presentation transcript:

02 – Object Modeling Overview Point Selection Bounding Box Line Equation Least Square Line Equation Conclusions

Overview Assume that we have an image of a table How can we create a mathematical model this geometric object?

Overview One option is to calculate the the 2D line equations for the visible edges

Overview Assume that we have calculated the (x,y) coordinates of the table top edge pixels XY

Point Selection How can we decide which points belong together on the same line? Trial and error point selection algorithm: –Take any two points at random (x 1,y 1 ), (x 2,y 2 ) –Calculate line equation Ax+By+C=0 where A=(y 1 -y 2 ), B=(x 2 -x 1 ), C=x 1 (y 2 -y 1 )+y 1 (x 1 -x 2 ) –Find all points (x i,y i ) that are close enough to the line by checking if Ax i +By i +C < threshold –Remove these points from the list and repeat until there are no points left to consider

Point Selection Select two points and calculate line equation Ax+By+C=0

Point Selection Set of points that are close to the first line equation

Point Selection Select two more points and calculate second line equation

Point Selection Set of points that are close to the second line equation

Point Selection Not all line equations will correspond to table top edges We must ignore these line equations and select two new points

Bounding Box Line Equation How can calculate the line equation for the set of points on one line? Simple bounding box based algorithm: –Examine the set of points and calculate the min_x, min_y, max_x, and max_y values –If (max_x-min_x) > (max_y-min_y) then calculate the line equation using min_x and max_x points –Otherwise calculate the line equation using the min_y and max_y points –This is robust for horizontal and vertical lines

Bounding Box Line Equation Calculate bounding box by finding min and max (x,y) values

Bounding Box Line Equation Define line equation using points with min_x and max_x

Bounding Box Line Equation void bounding_box_line(float x[], float y[], int count, float &A, float &B) { // Calculate min and max (x,y) values int min_x = 0, max_x = 0, min_y = 0, max_y = 0; for (int i=1; i<count; i++) { if (x[min_x] > x[i]) min_x = i; if (x[max_x] < x[i]) max_x = i; if (y[min_y] > y[i]) min_y = i; if (y[max_y] < y[i]) max_y = i; }

Bounding Box Line Equation // Calculate line equation float size_x = x[max_x] - x[min_x]; float size_y = y[max_y] - y[min_y]; if ((size_x > size_y) && (x[max_x] != x[min_x])) { B = (y[max_x] - y[min_x]) / (x[max_x] - x[min_x]); A = y[min_x] - B * x[min_x]; } else if (x[max_y] != x[min_y]) { B = (y[max_y] - y[min_y]) / (x[max_y] - x[min_y]); A = y[min_y] - B * x[min_y]; } }

Least Square Line Equation The goal of least square line fitting is to obtain a line equation that minimizes the square of the distances between the line and the points

Least Square Line Equation To simplify the analysis, we minimize the vertical offsets rather than the perpendicular offsets between the line and points

Least Square Line Equation The first step is to quantify vertical offsets using a basic line equation formula

Least Square Line Equation Then we take the partial derivatives with respect to the line parameters (a,b)

Least Square Line Equation Using S in place of summation, we can write the two equations in matrix form as follows

Least Square Line Equation To solve we calculate the 2x2 matrix inverse

Least Square Line Equation Multiplying we get expressions for (a,b)

Least Square Line Equation void least_square_line(float x[], float y[], int count, float &A, float&B) { // Calculate sums of (x,y) values float Sx = 0, Sy = 0, Sxx = 0, Sxy = 0; for (int i=0; i<count; i++) { Sx += x[i]; Sy += y[i]; Sxx += x[i] * x[i]; Sxy += x[i] * y[i]; }

Least Square Line Equation // Calculate line equation float denominator = count * Sxx - Sx * Sx; if (denominator != 0) { A = (Sxx * Sy - Sx * Sxy) / denominator; B = (-Sx * Sy + count * Sxy) / denominator; }

Least Square Line Equation For more information on least squares fitting see the Wolfram wiki page below: tml

Conclusions There are many other ways to detect edges in images and calculate line equations –Laplacian zero crossings –Canny edges –Hough transforms We will study these computer vision algorithms in more detail later in the class