DLT

pyvsim.Utils.DLT(uvlist, xyzlist)[source]

This function calculates the direct linear transform matrix, which is the transform executed by a pinhole camera. This procedure was suggested in Wikipedia and some refinements are discussed in the book “Multiple View Geometry in computer vision” by Hartley and Zisserman.

Parameters :

uvlist : numpy.ndarray

A \((N,2)\) matrix containing points at the sensor coordinates

xyzlist: numpy.ndarray :

A \((N,3)\) matrix containing points at the world coordinates

Returns :

M : numpy.ndarray \((3,4)\)

A matrix with the transformation to be used with homogeneous coordinates. The matrix M is normalized by the norm of the elements M(2,0:3), because then the depth of points is automatically given as the third (the homogeneous) coordinate.

dMdX : numpy.ndarray

A matrix containing the factors to calculate the partial derivatives of the UV coordinates with respect to the XYZ coordinates. By multiplying dMdX * M * XYZ1, one gets the derivatives in the following order \(\left [ {\partial u \over \partial x} {\partial u \over \partial y} {\partial u \over \partial z} {\partial v \over \partial x} {\partial v \over \partial y} {\partial v \over \partial z} \right ]\) multiplied by \(w^2\) (which, for the normalized matrix \(M\), is the depth of the points)

detM : scalar

The determinant of the matrix formed by the first three columns of \(M\), if \(det(M[:,:3]) < 0\), it indicates that the mapping is done from a right-handed coordinate system to a left-handed one (or vice versa). This case happens when doing a mapping with a odd number of mirrors between camera and mapped region, and some derived quantities must be inverted in this case, e.g. the line-of-sight vector.

condition_number : double

The condition number stated in page 108 of Hartley and Zisseman, which is the ratio of the first and the second-last singular value (because the last should be zero, if the transform is perfect. According to Wikipedia, the \(log_{10}\) of the condition number gives roughly how many digits of accuracy are lost by transforming using the given matrix.

last_singular_value: double :

The smallest singular value. The finding of the DLT matrix is a minimization of the problem \(\left | Ax \right |\) with \(\left | x \right | = 1\). last_condition_number is exactly abs(A*x), and gives an idea of the precision of the matrix found (with \(0\) being perfect)

This Page