La presentazione è in caricamento. Aspetta per favore

La presentazione è in caricamento. Aspetta per favore

Singular Value Decomposition Applications

Presentazioni simili


Presentazione sul tema: "Singular Value Decomposition Applications"— Transcript della presentazione:

1 Singular Value Decomposition Applications
Prof. Mariolino De Cecco, Ing. Luca Baglivo 1Department of Structural Mechanical Engineering, University of Trento

2 The environment can be represented in different ways
Two common representations are: a collection of ‘features’: in this case only a collection of interesting points is estimated. Those can be simply laser scan points or more significative features like edges, corners, lines, etc probabilistic occupancy grids: the environment is divided in cells and for each a probability of being occupied is assigned by means of proper measures (commonly laser and camera) Environment representation

3 Probabilistic occupancy grid
Laser scan points This local map can be incrementally built to estimate the global map while using it to localize the robot: SLAM significative features like edges, corners, lines Environment representation - collection of ‘features’

4 On the left the environment layout, on the right a POG estimation
Environment representation - probabilistic occupancy grids

5 To follow this example lets refer to a simulated collection of laser scan data.
Data available: two laser features collection collected in two distinct time instants The differential motion will be estimated. Iterations will lead to an incremental estimation of the whole trajectory Each differential motion of a rigid body can be divided in a translation component and a rotation. Translation can be estimated by the features centre of mass, rotation by means of the following algorithm A first application of SVD to motion estimation

6 Local view in the second pose
A first application of SVD to motion estimation

7 Therefore, after a rotation R, each point shall satisfy the following:
So we have a collection of points that, after a proper rotation, shall correspond: Therefore, after a rotation R, each point shall satisfy the following: Which can be expressed like a minimization problem to find R: A first application of SVD to motion estimation

8 To do so we can modify the cost function in the following way:
Unfortunately the unknown is a matrix. This means the SVD to find the pseudoinverse solution cannot be directly applied. To do so we can modify the cost function in the following way: This leads to reformulate the function in a form similar to “Ax - b” A first application of SVD to motion estimation

9 The following will be minimized as a function of the vector x = [r1 r2 r3]T
Than x can be again rearranged in a matrix form to give the ‘best’ estimate of the rotation matrix R’ A first application of SVD to motion estimation

10 … but this ‘best’ estimate of the rotation matrix R will be directly useful?
A first application of SVD to motion estimation

11 Actually not as far as this will not be a rotation matrix!!!
But we remember that the polar decomposition can be regarded as a generalization to matrices of the complex number Remembering that Q represents the phase that in matrix form is a rotation matrix (in this case A is square, i.e. n=m) We can use the fact that the nearest unitary matrix to A is Q which is the unitary factor of the polar decomposition A first application of SVD to motion estimation

12 These are the results after applying the inverse rotation to the points collected in the second time instant: Some noise was added to the points of the second scan A first application of SVD to motion estimation

13 Appendix - matlab code %%
% Esempi SVD per la soluzione della variazione di posa ricavata da matching di scansioni % e camera %% simulazione dati sperimentali: % punti visti dalla prima posa: % x prima riga, y seconda: P1 = [-1 0; -1 1; 1 1; 1 0; ; ; 0 1; 0.5 1; 1 0.5]' ; ss = size(P1) ; % matrice di rotazione tra le due pose (si suppone traslazione nulla, ovvero % di aver riportato tutto rispetto ai baricentri dei marker) % trasforma i punti visti nel sistema 2 nel sistema 1 alfa = 25 * pi / 180 ; % rotazione del secondo sistema di riferimento rispetto al primo R1_2 = [cos(alfa) -sin(alfa); sin(alfa) cos(alfa)] ; R2_1 = R1_2^-1 ; % da sistema 1 a sistema 2 % punti visti dalla seconda posa: P2 = R2_1 * P1 + normrnd(0,0.005,ss(1),ss(2)) ; Appendix - matlab code

14 %% definizione dati problema di ottimizzazione lineare
% trasformiamo il problema di determinare la matrice di rotazione R2_1 in un problema % di minimizzazione della relazione lineare |b - A*x| % dove: % in b vi sono i dati delle scansioni acquisite nella prima posa % in A vi sono i dati delle scansioni acquisite nella seconda posa % in x vi sono le componenti della matrice di rotazione % ricaviamo il vettore 'b': b = zeros(2*length(P1), 1) ; j = 1 ; for i = 2:2:2*length(P1) b(i-1) = P1(1,j) ; b(i) = P1(2,j) ; j = j + 1 ; end % ricaviamo la matrice 'A': A = zeros(2*length(P1), 3) ; j = 1; for i = 2:2:2*length(P2) A(i-1, 1) = P2(1,j) ; A(i-1, 3) = P2(2,j) ; A(i, 2) = P2(2,j) ; A(i, 3) = - P2(1,j) ; Appendix - matlab code

15 This is R’ estimated as a first trial:
% determiniamo 'x' mediante SVD e pseudoinversa: [U,S,V] = svd(A) ; Sinv = S ; for i = 1:3 Sinv(i,i) = S(i,i)^-1 ; end % calcola inversa della matrice dei valori singlolari % stima della matrice R1_2 r = V*Sinv'*U' * b ; R1_2est = [r(1) r(3); -r(3) r(2)] ; This is R’ estimated as a first trial: Appendix - matlab code

16 % POLAR DECOMPOSITION per approssimare la matrice di rotazione ad una ortonormale:
% R1_2est = Q * H , dove Q è la matrice ortonormale più vicina ad R1_2est [U,S,V] = svd(R1_2est) H = V * S(1:2,:) * V' Q = U(:,1:2)*V' % si prendono solo le prime due colonne in quanto il rango è 2 R1_2estPolar = Q ; % ricostruzione dei punti: P2_1est = R1_2estPolar * P2 ; We can use the fact that the nearest rotation matrix to R’ is Q which is the unitary factor of the polar decomposition: Appendix - matlab code

17 Appendix - matlab code


Scaricare ppt "Singular Value Decomposition Applications"

Presentazioni simili


Annunci Google