Direct linear transformation explained

Direct linear transformation (DLT) is an algorithm which solves a set of variables from a set of similarity relations:

xk\proptoAyk

  for

k=1,\ldots,N

where

xk

and

yk

are known vectors,

\propto

denotes equality up to an unknown scalar multiplication, and

A

is a matrix (or linear transformation) which contains the unknowns to be solved.

This type of relation appears frequently in projective geometry. Practical examples include the relation between 3D points in a scene and their projection onto the image plane of a pinhole camera,[1] and homographies.

Introduction

An ordinary system of linear equations

xk=Ayk

  for

k=1,\ldots,N

can be solved, for example, by rewriting it as a matrix equation

X=AY

where matrices

X

and

Y

contain the vectors

xk

and

yk

in their respective columns. Given that there exists a unique solution, it is given by

A=XYT(YYT)-1.

Solutions can also be described in the case that the equations are over or under determined.

What makes the direct linear transformation problem distinct from the above standard case is the fact that the left and right sides of the defining equation can differ by an unknown multiplicative factor which is dependent on k. As a consequence,

A

cannot be computed as in the standard case. Instead, the similarity relations are rewritten as proper linear homogeneous equations which then can be solved by a standard method. The combination of rewriting the similarity equations as homogeneous linear equations and solving them by standard methods is referred to as a direct linear transformation algorithm or DLT algorithm. DLT is attributed to Ivan Sutherland.

Example

Suppose that

k\in\{1,...,N\}

. Let

xk=(x1k,x2k)\inR2

and

yk=(y1k,y2k,y3k)\inR3

be two known vectors, and we want to find the

2 x 3

matrix

A

such that

\alphakxk=Ayk

where

\alphak0

is the unknown scalar factor related to equation k.

To get rid of the unknown scalars and obtain homogeneous equations, define the anti-symmetric matrix

H=\begin{pmatrix}0&-1\ 1&0\end{pmatrix}

and multiply both sides of the equation with

T
x
k

H

from the left
T
\begin{align} (x
k

H)\alphakxk&=

T
(x
k

H)Ayk\\ \alphak

T
x
k

Hxk&=

T
x
k

HAyk\end{align}

Since

T
x
k

Hxk=0,

the following homogeneous equations, which no longer contain the unknown scalars, are at hand
T
x
k

HAyk=0

In order to solve

A

from this set of equations, consider the elements of the vectors

xk

and

yk

and matrix

A

:

xk=\begin{pmatrix}x1k\x2k\end{pmatrix}

,  

yk=\begin{pmatrix}y1k\y2k\y3k\end{pmatrix}

,   and  

A=\begin{pmatrix}a11&a12&a13\a21&a22&a23\end{pmatrix}

and the above homogeneous equation becomes

0=a11x2ky1k-a21x1ky1k+a12x2ky2k-a22x1ky2k+a13x2ky3k-a23x1ky3k

  for

k=1,\ldots,N.

This can also be written in the matrix form:

0=

T
b
k

a

  for

k=1,\ldots,N

where

bk

and

a

both are 6-dimensional vectors defined as

bk=\begin{pmatrix}x2ky1k\ -x1ky1k\x2ky2k\ -x1ky2k\x2ky3k\ -x1ky3k\end{pmatrix}

  and  

a=\begin{pmatrix}a11\a21\a12\a22\a13\a23\end{pmatrix}.

So far, we have 1 equation and 6 unknowns. A set of homogeneous equations can be written in the matrix form

0=Ba

where

B

is a

N x 6

matrix which holds the known vectors

bk

in its rows. The unknown

a

can be determined, for example, by a singular value decomposition of

B

;

a

is a right singular vector of

B

corresponding to a singular value that equals zero. Once

a

has been determined, the elements of matrix

A

can rearranged from vector

a

. Notice that the scaling of

a

or

A

is not important (except that it must be non-zero) since the defining equations already allow for unknown scaling.

In practice the vectors

xk

and

yk

may contain noise which means that the similarity equations are only approximately valid. As a consequence, there may not be a vector

a

which solves the homogeneous equation

0=Ba

exactly. In these cases, a total least squares solution can be used by choosing

a

as a right singular vector corresponding to the smallest singular value of

B.

More general cases

The above example has

xk\inR2

and

yk\inR3

, but the general strategy for rewriting the similarity relations into homogeneous linear equations can be generalized to arbitrary dimensions for both

xk

and

yk.

If

xk\inR2

and

yk\inRq

the previous expressions can still lead to an equation

0=

T
x
k

HAyk

  for  

k=1,\ldots,N

where

A

now is

2 x q.

Each k provides one equation in the

2q

unknown elements of

A

and together these equations can be written

Ba=0

for the known

N x 2q

matrix

B

and unknown 2q-dimensional vector

a.

This vector can be found in a similar way as before.

In the most general case

xk\inRp

and

yk\inRq

. The main difference compared to previously is that the matrix

H

now is

p x p

and anti-symmetric. When

p>2

the space of such matrices is no longer one-dimensional, it is of dimension

M=

p(p-1)
2

.

This means that each value of k provides M homogeneous equations of the type

0=

T
x
k

HmAyk

  for  

m=1,\ldots,M

  and for

k=1,\ldots,N

where

Hm

is a M-dimensional basis of the space of

p x p

anti-symmetric matrices.

Example p = 3

In the case that p = 3 the following three matrices

Hm

can be chosen

H1=\begin{pmatrix}0&0&0\ 0&0&-1\ 0&1&0\end{pmatrix}

,  

H2=\begin{pmatrix}0&0&1\ 0&0&0\ -1&0&0\end{pmatrix}

,  

H3=\begin{pmatrix}0&-1&0\ 1&0&0\ 0&0&0\end{pmatrix}.

In this particular case, the homogeneous linear equations can be written as

0=[xk] x Ayk

  for  

k=1,\ldots,N

where

[xk] x

is the matrix representation of the vector cross product. Notice that this last equation is vector valued; the left hand side is the zero element in

R3

.

Each value of k provides three homogeneous linear equations in the unknown elements of

A

. However, since

[xk] x

has rank = 2, at most two equations are linearly independent. In practice, therefore, it is common to only use two of the three matrices

Hm

, for example, for m=1, 2. However, the linear dependency between the equations is dependent on

xk

, which means that in unlucky cases it would have been better to choose, for example, m=2,3. As a consequence, if the number of equations is not a concern, it may be better to use all three equations when the matrix

B

is constructed.

The linear dependence between the resulting homogeneous linear equations is a general concern for the case p > 2 and has to be dealt with either by reducing the set of anti-symmetric matrices

Hm

or by allowing

B

to become larger than necessary for determining

a.

References

External links

Notes and References

  1. Abdel-Aziz . Y.I. . Karara . H.M. . Direct Linear Transformation from Comparator Coordinates into Object Space Coordinates in Close-Range Photogrammetry . Photogrammetric Engineering & Remote Sensing . American Society for Photogrammetry and Remote Sensing . 81 . 2 . 2015-02-01 . 0099-1112 . 10.14358/pers.81.2.103 . 103–107. free .