Using algebraic geometry for solving polynomial problems in computer vision
This presentation is the property of its rightful owner.
Sponsored Links
1 / 283

Using Algebraic Geometry for Solving Polynomial Problems in Computer Vision PowerPoint PPT Presentation


  • 48 Views
  • Uploaded on
  • Presentation posted in: General

Using Algebraic Geometry for Solving Polynomial Problems in Computer Vision. David Nistér and Henrik Stew énius. Very Rough Outline. 14:00-15:30 “1 st Round", administered by David. - What is this Tutorial About? - Motivation, RANSAC, Example Problems - Gr ö bner Bases - Action Matrix

Download Presentation

Using Algebraic Geometry for Solving Polynomial Problems in Computer Vision

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Using algebraic geometry for solving polynomial problems in computer vision

Using Algebraic Geometry for Solving Polynomial Problems in Computer Vision

David Nistérand Henrik Stewénius


Very rough outline

Very Rough Outline

  • 14:00-15:30 “1st Round", administered by David.

  • - What is this Tutorial About?

  • - Motivation, RANSAC, Example Problems

  • - Gröbner Bases

  • - Action Matrix

  • -15:30-16:00 Coffee break

  • 16:00-18:00-“2nd Round“, administered by Henrik.

  • - Background Material

  • - Gröbner Bases

  • - Exercises in Macaulay2

  • - Q & A


What is this tutorial about

What is this Tutorial About?

  • If you are interested in solving polynomial equations, this tutorial is for you

  • This tutorial is a ‘real’ tutorial

  • The main focus will be on Gröbner bases and how the theory of Gröbner bases can be used to solve polynomial equations


History

History

  • Euclid (325BC-265 BC),

  • Apollonius (262 BC-190BC),

  • Descartes (1596-1650),

  • Fermat (1601-1655)

  • Bézout (1730-1783)

  • Hilbert’s (1862-1943) Nullstellensatz


Using algebraic geometry for solving polynomial problems in computer vision

RISC

Research

Institute for

Symbolic

Computation

Linz, Austria

Wolfgang Gröbner (1899-1980)

Bruno Buchberger

1966: Ph.D. in mathematics. University of Innsbruck,

Dept. of Mathematics, Austria.

Thesis: On Finding a Vector Space Basis of the Residue Class Ring

Modulo a Zero Dimensional Polynomial Ideal (German).

Thesis Advisor: Wolfgang Gröbner


Bezout s theorem

2x2=4

Bezout’s Theorem

With two variables,

a solution according to

the Bezout bound

can typically be

realized with resultants.

With three or more

variables, things

are less simple.

Mixed Volume, see for example [CLO 1998]

provides a generalization for non-general polynomials.


Resultants

Resultants

a1x2+a2y2+a3xy+a4x+a5y+a6

  • Provides Elimination of variables by taking a determinant

b1x2+b2y2+b3xy+b4x+b5y+b6

x3

x2

x

1

x3

x2

x

1

det

= det

= [4]


Various states of mind you may have i

Useful Theory

2st Quadrant

1st Quadrant

Difficult Theory

Easy Theory

3rd Quadrant

4th Quadrant

Useless Theory

Various States of Mind You May Have, I:

  • Skip the theory, what is this all about? –Answers from David

Useful and Easy

Super!

Useful but Hard

Algebraic Geometry and Gröbner Bases

Useless and impossible

to penetrate – Unfortunately

survives

Useless and Easy


Proofs of the power of gr bner bases

Proofs of the Power of Gröbner Bases

  • So far, approx. 600 publications and 10 textbooks have been devoted to Gröbner Bases.

  • Gröbner Bases are routinely available in current mathematical software systems like Mathematica, Maple, Derive, Magma, Axiom, etc.

  • Special software systems, like CoCoa, Macaulay, Singular, Plural, Risa-Asir etc. are, to a large extent, devoted to the applications of Gröbner Bases.

  • Gröbner Bases theory is an important section in all international conferences on computer algebra and symbolic computation.

  • Gröbner Bases allow, for the first time, algorithmic solutions to some of the most fundamental problems in algebraic geometry but are applied also in such diverse areas as functional analysis, statistics, optimization, coding theory, cryptography, automated theorem proving in geometry, graph theory, combinatorial identities, symbolic summation, special functions, etc.


Various states of mind you may have ii

Various States of Mind You May Have, II:

  • Stop the handwaving, what is the rigorous theory?

Answers from David and Henrik + books


Suggested literature

Suggested Literature

  • D. Cox, J. Little, D. O’Shea, Ideals, Varieties,

    and Algorithms, Second Edition, 1996.

  • D. Cox, J. Little, D. O’Shea, Using Algebraic Geometry, Springer 1998.

  • T. Becker and Weispfennig, Gröbner Bases, A Computational Approach to commutative Algebra, Springer 1993.


Suggested literature1

Suggested Literature

  • B. Buchberger, F. Winkler (eds.) Gröbner Bases and ApplicationsCambridge University Press, 1998.

  • Henrik’s Thesis: H. Stewénius, Gröbner Basis Methods for Minimal Problems in Computer Vision, PhD Thesis, 2005

  • Planned scaffolding paper, keep a lookout on the tutorial web page


Various states of mind you may have iii

Various States of Mind You May Have, III:

  • Skip the theory, how do I use it? – Answers from Henrik, Exercises in Macaulay 2.


Using algebraic geometry for solving polynomial problems in computer vision

Robust

RANSAC

Least Squares

RANSAC- Random Sample Consensus


Using algebraic geometry for solving polynomial problems in computer vision

Robust

RANSAC- Random Sample Consensus

Line Hypotheses

Points


Using algebraic geometry for solving polynomial problems in computer vision

Observation

Likelihood

Hypothesis

Generator

RANSAC

?

Hypotheses

500

Observations

1000

500 x 1000 = 500.000


Using algebraic geometry for solving polynomial problems in computer vision

Preemptive RANSAC

Hypothesis Generation

Observed Tracks


Using algebraic geometry for solving polynomial problems in computer vision

Estimate or

posterior likelihood

output

Hypothesis

Generator

Probabilistic

Formulation

Precise

Formulation

Data Input


Using algebraic geometry for solving polynomial problems in computer vision

3D-3D 2D-2D

Absolute Orientation

2D-3D

Pose

2D-2D

Relative Orientation

Triangulation

Bundle Adjustment

Robust Statistics

Geometry Tools


For which problems did we use gr bner bases

3 View Triangulation

47

64

Generalized Relative Pose

For Which Problems Did We UseGröbner Bases?

No

Yes

Yes, you bet

The 5-Point Relative Pose Problem

Unknown Focal

Relative Pose

10

15

2048

The Generalized

3-Point Problem

Microphone-Speaker

Relative Orientation

8(4)

The 3 View 4-Point Problem

0 (or thousands)

8-38-150-344-??


Using algebraic geometry for solving polynomial problems in computer vision

The Generalized 3-Point Problem


Using algebraic geometry for solving polynomial problems in computer vision

The Generalized 3-Point Problem


Using algebraic geometry for solving polynomial problems in computer vision

Given five point correspondences,

The Five Point Problem

What is R,t ?


Using algebraic geometry for solving polynomial problems in computer vision

The 5-point algorithm (Nistér PAMI 04)

Sturm Sequences

for Bracketing

Root Polishing

by Bisection

R,t

E


Using algebraic geometry for solving polynomial problems in computer vision

The 5-point algorithm (Nistér PAMI 04)

Sturm Sequences

for Bracketing

Root Polishing

by Bisection

R,t

E


Using algebraic geometry for solving polynomial problems in computer vision

The 5-point algorithm (Stewénius et al)

10 x 10

Action Matrix

Eigen-Decomposition

R,t

E


Using algebraic geometry for solving polynomial problems in computer vision

Easy Conditions

Realistic Conditions

Correct Calibration


5 point matlab executable

5-Point Matlab Executable

Recent Developments on Direct Relative Orientation,Henrik Stewenius, Christopher Engels, David Nister, To appear in ISPRS Journal of Photogrammetry and Remote Sensing

www.vis.uky.edu/~dnister


Using algebraic geometry for solving polynomial problems in computer vision

Further Examples of Solved Problems

6-point generalized relative orientation (64 solutions) (Stewenius, Nistér, Oskarsson and Åström, Omnivis ICCV 2005)

6-point relative orientation with common but unknown focal length (15 solutions) (Stewenius, Nistér, Schaffalitzky and Kahl,

to appear at CVPR 2005)


Using algebraic geometry for solving polynomial problems in computer vision

Triangulation


Triangulation 2 views

Triangulation, 2 Views

  • One parameter family – Balance the error

  • Max-Norm -> Quartic (Closed form, Nistér)

  • L2-Norm -> Sextic (Hartley & Sturm)

  • Directional Error -> Quadratic (Oliensis)


Using algebraic geometry for solving polynomial problems in computer vision

Optimal 3 View Triangulation

work with Henrik Stewenius and Fred Schaffalitzky

ICCV 2005

47 Stationary Points


Using algebraic geometry for solving polynomial problems in computer vision

Microphone-Speaker Location

work with Henrik Stewenius


Using algebraic geometry for solving polynomial problems in computer vision

The 3 View 4 Point Problem

Work with Frederik Schaffalitzky


Geometry algebra dualism

Hilbert’s Nullstellensatz

Geometry-Algebra ‘Dualism’


Using algebraic geometry for solving polynomial problems in computer vision

How Hard is this Problem?


Using algebraic geometry for solving polynomial problems in computer vision

Approximately This Hard


For which problems did we use gr bner bases1

3 View Triangulation

47

64

Generalized Relative Pose

For Which Problems Did We UseGröbner Bases?

No

Yes

Yes, you bet

The 5-Point Relative Pose Problem

Unknown Focal

Relative Pose

10

15

2048

The Generalized

3-Point Problem

Microphone-Speaker

Relative Orientation

8(4)

The 3 View 4-Point Problem

0 (or thousands)

8-38-150-344-??


Camera geometry

Camera Geometry

  • Often leads to polynomial formulations,

    or can at least very often be formulated in

    terms of polynomial equations


Polynomial formulation

Polynomial Formulation

  • p1(x) , … , pn(x)= A set of input polynomials (n polynomials in m variables)

    x=[y1 … ym]


Main point

Main Point

  • Gröbner Basis Gives Action Matrix

    (because it provides the ability to compute unique ‘smallest’ possible unique remainders)

  • Action Matrix Gives Solutions

Polynomial

Equations

Gröbner

Basis

Action

Matrix

Solutions

Intensively Studied


Algebraic ideal

Algebraic Ideal

  • I(p1 , … , pn)= The set of polynomials

    generated by the input polynomials

    (through additions and multiplications by a polynomial)

    p and q in I => p+q in I

    p in I => pq in I

The ideal I consists of ‘Almost’ all the polynomials implied

by the input polynomials

(More precisely, the radical of the ideal consists of all)


Basis for ideal

Basis (for Ideal)

  • A basis for the ideal J is a set of polynomials

    {p1 , … , pn} such that J=I(p1 , … , pn)


Algebraic variety

Algebraic Variety

  • The solution set

    (the vanishing set of the input polynomials)

V(I)={x:I(x)=0}

More precisely

p(x)=0 for all p in I


Quotient ring j i

Quotient Ring J/I

  • The set of equivalence classes of polynomials when only the values on V are considered (i.e. polynomials are equivalent iff p(V)=q(V))

p in J/I

V(I)


Action matrix

Action Matrix

  • For multiplication by polynomial on finite dimensional solution space

V(I)


Action matrix1

Action Matrix

Action Matrix

Transposed

Companion Matrix


An equivalence

An ‘Equivalence’

Compute Companion

Matrix

Finding the Eigenvalues

of a Matrix

Finding the Roots

of a Polynomial

Compute

Characteristic Polynomial

Requires

Gröbner

Basis for

Input Equations

Compute Action Matrix in Quotient Ring

(Polynomials modulo Input Equations)

Finding the Roots

of a Multiple

Polynomial Equations

Finding the Eigenvalues

of a Matrix

Compute

Characteristic Polynomial


Companion matrix

Companion Matrix

Multiplication by x modulo the seventh degree polynomial

x7+ a6x6 +a5x5+ a4x4+ a3x3+ a2x2+ a1x+a0

can be expressed as left-multiplication by the matrix

x6

x5

x4

x3

x2

x

1

-a6

-a5

-a4

-a3

-a2

-a1

-a0

1

1

1

1

1

1


Action matrix2

Action Matrix

I


Action matrix3

V(I)

Action Matrix

I


Action matrix4

V(I)

Action Matrix

p in J

I


Action matrix5

V(I)

Action Matrix

p in J

I

p in J/I


Action matrix6

Action Matrix

I

p in J/I


Action matrix7

Action Matrix

I

q in J/I

p in J/I


Action matrix8

Action Matrix

pq in J/I

I

q in J/I

p in J/I


Action matrix9

Action Matrix

Multiplication by a polynomial q is a linear operator Aq

(αp+βr)q=α(pq)+β(rq)

The matrix Aq is called the action matrix for multiplication by q


Action matrix10

b0

x0

b1

x1

b2

x2

Action Matrix

I


Action matrix11

q in J

b0

x0

b1

x1

b2

x2

Action Matrix

I


Action matrix12

q in J

q(x0)b0

q(x2)b2

q(x1)b1

Action Matrix

I


Action matrix13

q in J

q(x0)b0

q(x2)b2

q(x1)b1

Action Matrix

The values q(xi) of q at the solutions xi are the eigenvalues of the action matrix

I


Action matrix14

The values q(xi) of q at the solutions xi are the eigenvalues of the action matrixIf we choose q=y1 , the eigenvalues are the solutions for y1

Action Matrix


Action matrix15

Action Matrix

b’=[r1… ro]

b’(x)Aqp=q(x)b’(x)p for all p in J/I and x in V(I)

b’(x)Aq=b’(x)q(x) b(x) is a left nullvector of Aq corresponding to eigenvalue q(x)


Monomial order

Monomial Order

  • Needed to define leading term of a polynomial

  • Grevlex (Graded reverse lexicographical) order usually most efficient

y_2

y_1


Gr bner basis

Gröbner Basis

  • A basis for ideal I that exposes the leading terms of I (hence unique well defined remainders)

  • Easily gives the action matrix for multiplication with any polynomial in the quotient ring

y_2

y_1


A reduced gr bner basis is a basis in the normal sense

A Reduced Gröbner Basis is a Basis in the normal sense

  • A polynomial in the ideal I can be written as a unique combination of the polynomials in a reduced Gröbner basis for I

  • The monic Gröbner basis for I is unique


Buchberger s algorithm

Buchberger’s Algorithm

Buchberger’s Algorithm

Euclid’s

Algorithm for the

GCD

Gaussian

Elimination


Using algebraic geometry for solving polynomial problems in computer vision

Gaussian Elimination

Exposes all the leading terms, which are simply

all the variables in the case of general linear equations

xn

x1


Remember row operations

Remember Row Operations:

  • Multiplying a row by a scalar

  • Subtracting a row from another

  • Swap rows

Add:

  • Multiplying a row by any polynomial


Using algebraic geometry for solving polynomial problems in computer vision

More General Elimination

With non-linear equations, there are relations between

the monomials that matter when multiplying

y2

xy

x2

y

x

Multiply by x

y2

xy

x2

y

x

y2

xy

x2

y

x

Multiply by y


Multiplying by a scalar

Multiplying by a Scalar

Transitions through zero remain

p(x)

3.8p(x)


Adding

Adding

Common transitions through zero remain

p1(x)

p2(x)

p1(x) + p2(x)


Multiplying

Multiplying

Transitions through zero remain

p(x)f(x)

f(x)

p(x)


Buchberger s algorithm1

Buchberger’s Algorithm

Compute remainders of S-polynomials until all remainders are zero


Buchberger s algorithm2

Buchberger’s Algorithm

Compute remainders of S-polynomials until all remainders are zero


Buchberger s algorithm3

Buchberger’s Algorithm

Compute remainders of S-polynomials until all remainders are zero


Buchberger s algorithm4

Buchberger’s Algorithm

Compute remainders of S-polynomials until all remainders are zero


Buchberger s algorithm5

Buchberger’s Algorithm

Compute remainders of S-polynomials until all remainders are zero


Buchberger s algorithm6

Buchberger’s Algorithm

Compute remainders of S-polynomials until all remainders are zero


Buchberger s algorithm7

Buchberger’s Algorithm

Compute remainders of S-polynomials until all remainders are zero


Buchberger s algorithm8

Buchberger’s Algorithm

Compute remainders of S-polynomials until all remainders are zero


Buchberger s algorithm9

Buchberger’s Algorithm

Compute remainders of S-polynomials until all remainders are zero


Buchberger s algorithm10

Buchberger’s Algorithm

Compute remainders of S-polynomials until all remainders are zero


Buchberger s algorithm11

Buchberger’s Algorithm

Compute remainders of S-polynomials until all remainders are zero


Using algebraic geometry for solving polynomial problems in computer vision

Approach

Begin (online)

Begin (offline)

Pose Problem over R

Pose Problem. Port to Zp

Compute Gröbner basis

Compute number of solutions

Elimination

Schedule

Compute Action Matrix

Build matrix based

Gröbner basis code

Solve Eigenproblem

Port to R

Backsubstitute

End

End


Prime field formulation

Prime Field Formulation

  • Reals => Cancellation unclear

  • Rationals => Grows unwieldy

  • Prime Field => Cancellation clear, size is limited, only small risk of incorrect cancellation if prime is large


Gaussian elimination

Gaussian Elimination

  • Expanding all polynomials up to a certain degree followed by Gaussian elimination allows pivoting


Unwanted solutions

Unwanted Solutions

Can be removed by ideal quotients, or more generally saturation


Elimination example

Elimination Example


Elimination example1

Elimination Example


Elimination example2

Elimination Example


Elimination example3

Elimination Example


Elimination example4

Elimination Example


Elimination example5

Elimination Example


Elimination example6

Elimination Example


Elimination example7

Elimination Example


Elimination example8

Elimination Example


Elimination example9

Elimination Example


Action matrix16

Action Matrix


  • Login