DLTnormalization

pyvsim.Utils.DLTnormalization(pointslist)[source]

This normalization procedure was suggested in:: “Multiple view geometry in computer vision” by Hartley and Zisserman, and is needed to make the problem of finding the direct linear transform converge better

The idea is transforming the set of points so that their average is zero and their distance to the origin is in average sqrt(nb. of coordinates).

Parameters :

pointslist: numpy.ndarray :

A matrix with the size \((N,C)\) where \(N\) is the number of points and \(C\) is the number of coordinates

Returns :

normalized_points: numpy.ndarray :

A matrix with the same size as the input with the normalized coordinates

T: numpy.array :

A matrix with the form \((C+1, C+1)\) representing the transformation to be used with homogeneous coordinates

Examples

>>> pointslist = np.array([[0,0],
...                        [0,1],
...                        [1,1],
...                        [1,0]])
>>> [normpoints, T] = DLTnormalization(pointslist)
>>> (np.mean(normpoints,0) == 0).all()
True
>>> homogeneouspoints = np.ones((4,3))       #must convert to homog. coords.
>>> homogeneouspoints[:,:-1] = normpoints
>>> np.dot(np.linalg.inv(T),homogeneouspoints.T).T[:,:-1] #inverse transform
array([[ 0.,  0.],
       [ 0.,  1.],
       [ 1.,  1.],
       [ 1.,  0.]])

This Page