Docsity

Linear Algebra for Computer Vision: Notation, Basics, and Applications - Prof. Ramalingam , Study notes of Computer Science

Toggle sidebar
bg1
1
Linear Algebra for Computer
Vision
Introduction
CMSC 828 D
Outline
• Notation and Basics
• Motivation
• Linear systems of equations
– Gauss Elimination, LU decomposition
• Linear Spaces and Operators
– Addition, scalar multiplication, scalar product,
transformation, operator, basis
• Eigenvalu es, Eigenvectors
• Solvability conditions (ā€œalternative theoremā€)
– Adjoint, null space, orthogonality
Outline
• Euclidean space R3
– distance, angles, rotations
• Metric Space
– Distance, angles, rotations
• Least Squares
• Singular Value Decomposition
• Other Matrix decompositions
Motivation
• Fundamental to representation and numerical
solution of almost all problems including those in
vision and computational statistics.
– Solving equations for calibration, stereo, tracking, …
• Geometry is fundamental to vision. However one
way of doing geometry is via algebra.
– Intersections of lines, points, planes. Determining
angles. Determining orthogonal projections …
• Modern computer vision is formulated in terms of
ā€œprojective geometryā€. Most results in projective
geometry are stated algebraically and require
knowledge of concepts such as rank, null space,
constraints
Applications
• Rectification of images
• Calibrating cameras
• Transforming color spaces
• Tracking motion of a rigid body
• Applying constraints from multiple views
• Parametrizing fundamental matrix and
trifocal tensor.
Vectors
• A vector xof dimension drepresents a point in a d
dimensional space
•Examples
– A point in 3D E uclidean space [x,y,z] or 2D image space [u,v]
– A point in a pr ojective space P3 [X,Y,Z,W] or in projective space
P2[U,V,W]
– Point in color space [r,g,b] or [y, u, v]
– Point in an infinite dimensional functional space on a Fourier
basis
– Vector of intrinsic param eters for a camera (focal length, skew
ratio, …)
• Essentially a short-hand notation to denote a grouping of
points
– No special structure yet
pf3
pf4
pf5

Partial preview of the text

Download Linear Algebra for Computer Vision: Notation, Basics, and Applications - Prof. Ramalingam and more Study notes Computer Science in PDF only on Docsity!

Linear Algebra for Computer

Vision

Introduction

CMSC 828 D

Outline

  • Notation and Basics
  • Motivation
  • Linear systems of equations
    • Gauss Elimination, LU decomposition
  • Linear Spaces and Operators
    • Addition, scalar multiplication, scalar product, transformation, operator, basis
  • Eigenvalues, Eigenvectors
  • Solvability conditions (ā€œalternative theoremā€)
    • Adjoint, null space, orthogonality

Outline

• Euclidean space R^3

  • distance, angles, rotations

• Metric Space

  • Distance, angles, rotations

• Least Squares

• Singular Value Decomposition

• Other Matrix decompositions

Motivation

  • Fundamental to representation and numerical

solution of almost all problems including those in

vision and computational statistics.

  • Solving equations for calibration, stereo, tracking, …
  • Geometry is fundamental to vision. However one

way of doing geometry is via algebra.

  • Intersections of lines, points, planes. Determining angles. Determining orthogonal projections …
  • Modern computer vision is formulated in terms of

ā€œprojective geometryā€. Most results in projective

geometry are stated algebraically and require

knowledge of concepts such as rank, null space,

constraints

Applications

• Rectification of images

• Calibrating cameras

• Transforming color spaces

• Tracking motion of a rigid body

• Applying constraints from multiple views

• Parametrizing fundamental matrix and

trifocal tensor.

Vectors

  • A vector x of dimension d represents a point in a d

dimensional space

  • Examples
    • A point in 3D Euclidean space [ x,y,z ] or 2D image space [ u,v ]
    • A point in a projective space P 3 [ X,Y,Z,W ] or in projective space P 2 [ U,V,W ]
    • Point in color space [ r,g,b ] or [ y, u, v ]
    • Point in an infinite dimensional functional space on a Fourier basis
    • Vector of intrinsic parameters for a camera (focal length, skew ratio, …)
  • Essentially a short-hand notation to denote a grouping of

points

  • No special structure yet

Vectors and Matrices

  • dƗn dimensional matrix M and its transpose M t
  • Transpose indicated

with a superscript t or a prime ′

  • d dimensional column vector x and its transpose

Determinant

  • Determinant of a 2x2 matrix m 11 m 22 -m 12 m 21
  • For a higher dimensional matrix we have a

recursive definition

Determinant: Remarks

• Determinant determines ā€œmagnitudeā€ of

matrix. Matrix with determinant =0 is called

singular.

• Determinant is important in theorems

• Practically the way to compute the

determinant is not this way.

• Homework problem -- determine number of

operations for recursive algorithm.

Matrix basics

  • Square matrix: number of rows = number of columns
  • Symmetric matrix A (^) ij=A (^) ji.
  • Skew symmetric matrix A (^) ij=-A (^) ji.
  • Identity I (^) ij= Ī“ ij
    • Kronecker delta Ī“ ij=0 if i ≠ j Ī“ ij=1 if i=j
  • Lower triangular Upper triangular 0 0 0 0 0 0

a a c d c b b e f g d d

" " % # % #

" % # % %

" "

Matrix vector product

• m Ɨ n dimensional matrix M multiplies by a

n dimensional vector x to produce a m

dimensional vector

Linear systems of equations

  • Systems of equations
  • Can be written as a

matrix vector product

  • Can change or scale rows
  • Solved via Gauss

elimination

  • Reduce system to product of lower or upper triangular matrix and x
  • O(N) operations to solve triangular system
  • O(N 3 ) operations to perform Gauss elimination

11 1 12 2 13 3 1

21 1 22 2 23 3 2

31 1 32 2 33 3 3

a x a x a x b

a x a x a x b

a x a x a x b

11 12 13 1 1

21 22 23 2 2

31 32 33 3 3

a a a x b

a a a x b

a a a x b

Ax b

A x b

  • Dot product of two vectors with same dimension

< x , y > =

  • Dot product space behaves like Euclidean R 3
  • Dot product defines a norm and a metric.
  • Parallelogram law

|| u + v ||^2 +|| u - v ||^2 = 2|| u ||^2 + 2 || v ||^2

  • Orthogonal vectors < u , v >=
  • Angle between vectors

cos Īø=< x , y >/||x|| ||y||

  • Orthonormal basis -- elements have norm 1 and are perpendicular to each other
  • Other distances and products can also define a space:
    • Mahalnobis distance

Dot Product Matrices as operators

• Matrix is an operator that takes a vector to

another vector.

  • Square matrix takes it to a vector in the space of

the same dimension.

• Dot product provides a tool to examine

matrix properties

  • Adjoint matrix < Au , v > = < u , A * v >
  • Square Matrix fully defined as result of its

operation on members of a basis.

A ij = < Ab j, b i>

Eigenvalues and Eigenvectors

  • Square matrix possesses its own natural basis.
  • Eigen relation

Au =Ī» u

  • Matrix A acts on vector u and produces a scaled version of the vector.
  • Eigen is a German word meaning ā€œproperā€ or ā€œspecificā€
  • u is the eigenvector while Ī» is the eigenvalue.
    • If u is an eigenvector so is α u
    • If ||u||= 1 then we call it a normal eigenvector
    • Ī» is like a measure of the ā€œstrengthā€ of A in the direction of u
  • Set of all eigenvalues and eigenvectors of A is called the ā€œspectrum of Aā€

Motivation: Stereo

• Point (x,y) on the image plane lies on a line

in the world that passes

through the image point

and center of

projection C

Scene point (xs , ys , zs )

(x (^) i , yi , 0 )

x

z

y

f

O

•Image of this

line in the world will

form a line in another

camera

Epipolar Constraint

• Point in one image lies on the ā€œepipolar

lineā€ in the other image

• Algebraic statement of geometry

  • Equation of line in the other image is Fm
  • Condition that the point m ′ lies on this line is

m ′ ā‹… Fm =

• F is the ā€œfundamental matrixā€

• Estimating the fundamental matrix is an

important problem in vision

Eight point algorithm: Determining the

Fundamental matrix

• Given a set of matching points in the

images, Determine F

āˆ‘ m m Fi j ij = 0

[ ]

1 0 1

1 0

11 12 13

21 22 23

u u v v

u f u f v f v f u f v f f f

f f f

f f f

f f

          ′ ′ (^)    =          ′ + + + ′ + + + + + =

Determining F

  • Write expression as an equation in the unknown

elements.

  • If we have eight points we can solve

for elements of F, (e.g. via LU)

  • If we have more than eight points

we can use a least squares

formulation

[ ] [ ]

11

12 13

21

22

23 31

32

f

f

f f u u u v u v u v v v f

f

f f

′ ′ ′ ′ ′ ′ ^ = āˆ’