Direct linear transformation

From testwiki
Jump to navigation Jump to search

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

𝐱k𝐀𝐲k   for k=1,,N

where 𝐱k and 𝐲k are known vectors, denotes equality up to an unknown scalar multiplication, and 𝐀 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

𝐱k=𝐀𝐲k   for k=1,,N

can be solved, for example, by rewriting it as a matrix equation 𝐗=π€π˜ where matrices 𝐗 and 𝐘 contain the vectors 𝐱k and 𝐲k in their respective columns. Given that there exists a unique solution, it is given by

𝐀=π—π˜T(𝐘𝐘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, 𝐀 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. [2]

Example

Suppose that k{1,...,N}. Let 𝐱k=(x1k,x2k)ℝ2 and 𝐲k=(y1k,y2k,y3k)ℝ3 be two known vectors, and we want to find the 2×3 matrix 𝐀 such that

αk𝐱k=𝐀𝐲k

where αk0 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

𝐇=(0110)

and multiply both sides of the equation with 𝐱kT𝐇 from the left

(𝐱kT𝐇)αk𝐱k=(𝐱kT𝐇)𝐀𝐲kαk𝐱kT𝐇𝐱k=𝐱kT𝐇𝐀𝐲k

Since 𝐱kT𝐇𝐱k=0, the following homogeneous equations, which no longer contain the unknown scalars, are at hand

𝐱kT𝐇𝐀𝐲k=0

In order to solve 𝐀 from this set of equations, consider the elements of the vectors 𝐱k and 𝐲k and matrix 𝐀:

𝐱k=(x1kx2k),   𝐲k=(y1ky2ky3k),   and   𝐀=(a11a12a13a21a22a23)

and the above homogeneous equation becomes

0=a11x2ky1ka21x1ky1k+a12x2ky2ka22x1ky2k+a13x2ky3ka23x1ky3k   for k=1,,N.

This can also be written in the matrix form:

0=𝐛kT𝐚   for k=1,,N

where 𝐛k and 𝐚 both are 6-dimensional vectors defined as

𝐛k=(x2ky1kx1ky1kx2ky2kx1ky2kx2ky3kx1ky3k)   and   𝐚=(a11a21a12a22a13a23).

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

𝟎=𝐁𝐚

where 𝐁 is a N×6 matrix which holds the known vectors 𝐛k in its rows. The unknown 𝐚 can be determined, for example, by a singular value decomposition of 𝐁; 𝐚 is a right singular vector of 𝐁 corresponding to a singular value that equals zero. Once 𝐚 has been determined, the elements of matrix 𝐀 can rearranged from vector 𝐚. Notice that the scaling of 𝐚 or 𝐀 is not important (except that it must be non-zero) since the defining equations already allow for unknown scaling.

In practice the vectors 𝐱k and 𝐲k may contain noise which means that the similarity equations are only approximately valid. As a consequence, there may not be a vector 𝐚 which solves the homogeneous equation 𝟎=𝐁𝐚 exactly. In these cases, a total least squares solution can be used by choosing 𝐚 as a right singular vector corresponding to the smallest singular value of 𝐁.

More general cases

The above example has 𝐱kℝ2 and 𝐲kℝ3, but the general strategy for rewriting the similarity relations into homogeneous linear equations can be generalized to arbitrary dimensions for both 𝐱k and 𝐲k.

If 𝐱kℝ2 and 𝐲kℝq the previous expressions can still lead to an equation

0=𝐱kT𝐇𝐀𝐲k   for   k=1,,N

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

In the most general case 𝐱kℝp and 𝐲kℝq. The main difference compared to previously is that the matrix 𝐇 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(p1)2.

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

0=𝐱kT𝐇m𝐀𝐲k   for   m=1,,M   and for k=1,,N

where 𝐇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 𝐇m can be chosen

𝐇1=(000001010),   𝐇2=(001000100),   𝐇3=(010100000).

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

𝟎=[𝐱k]×𝐀𝐲k   for   k=1,,N

where [𝐱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 ℝ3.

Each value of k provides three homogeneous linear equations in the unknown elements of 𝐀. However, since [𝐱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 𝐇m, for example, for m=1, 2. However, the linear dependency between the equations is dependent on 𝐱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 𝐁 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 𝐇m or by allowing 𝐁 to become larger than necessary for determining 𝐚.

References

Template:Reflist