Girish Mahajan (Editor)

Direct linear transformation

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

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

Contents

x k A y k   for k = 1 , , N

where x k and y k are known vectors, 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, and homographies.

Introduction

An ordinary linear equation

x k = A y k   for k = 1 , , N

can be solved, for example, by rewriting it as a matrix equation X = A Y where matrices X and Y contain the vectors x k and y k in their respective columns. Given that there exists a unique solution, it is given by

A = X Y T ( Y Y T ) 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

Let x k R 2 and y k R 3 be two sets of known vectors and the problem is to find 2 × 3 matrix A such that

α k x k = A y k   for k = 1 , , N

where α k 0 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 = ( 0 1 1 0 )

and multiply both sides of the equation with x k T H from the left

α k x k T H x k = x k T H A y k   for k = 1 , , N .

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

0 = x k T H A y k   for k = 1 , , N .

In order to solve A from this set of equations, consider the elements of the vectors x k and y k and matrix A :

x k = ( x 1 k x 2 k ) ,   y k = ( y 1 k y 2 k y 3 k ) ,   and   A = ( a 11 a 12 a 13 a 21 a 22 a 23 )

and the above homogeneous equation becomes

0 = a 11 x 2 k y 1 k a 21 x 1 k y 1 k + a 12 x 2 k y 2 k a 22 x 1 k y 2 k + a 13 x 2 k y 3 k a 23 x 1 k y 3 k   for k = 1 , , N .

This can also be written

0 = b k T a   for k = 1 , , N

where b k and a both are 6-dimensional vectors defined as

b k = ( x 2 k y 1 k x 1 k y 1 k x 2 k y 2 k x 1 k y 2 k x 2 k y 3 k x 1 k y 3 k )   and   a = ( a 11 a 21 a 12 a 22 a 13 a 23 ) .

This set of homogeneous equation can also be written in matrix form

0 = B a

where B is a N × 6 matrix which holds the vectors b k in its rows. This means that a lies in the null space of B and 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 A can be found by a simple rearrangement from a 6-dimensional vector to a 2 × 3 matrix. 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 x k and y k 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 = B a 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 x k R 2 and y k R 3 , but the general strategy for rewriting the similarity relations into homogeneous linear equations can be generalized to arbitrary dimensions for both x k and y k .

If x k R 2 and y k R q the previous expressions can still lead to an equation

0 = x k T H A y k   for   k = 1 , , N

where A now is 2 × q . Each k provides one equation in the 2 q unknown elements of A and together these equations can be written B a = 0 for the known N × 2 q matrix B and unknown 2q-dimensional vector a . This vector can be found in a similar way as before.

In the most general case x k R p and y k R q . The main difference compared to previously is that the matrix H now is p × 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 = x k T H m A y k   for   m = 1 , , M   and for k = 1 , , N

where H m is a M-dimensional basis of the space of p × p anti-symmetric matrices.

Example p = 3

In the case that p = 3 the following three matrices H m can be chosen

H 1 = ( 0 0 0 0 0 1 0 1 0 ) ,   H 2 = ( 0 0 1 0 0 0 1 0 0 ) ,   H 3 = ( 0 1 0 1 0 0 0 0 0 ) .

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

0 = [ x k ] × A y k   for   k = 1 , , N

where [ x k ] × 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 R 3 .

Each value of k provides three homogeneous linear equations in the unknown elements of A . However, since [ x k ] × has rank = 2, at most two equations are linearly independent. In practice, therefore, it is common to only use two of the three matrices H m , for example, for m=1, 2. However, the linear dependency between the equations is dependent on x k , 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 H m or by allowing B to become larger than necessary for determining a .

References

Direct linear transformation Wikipedia