Reputation: 31
I have a Source and target in the same coordinate system. There are 'n' points in the source and 'n' points in target(n>=3). Correspondences are also known. I would like to find optimal rigid transformation matrix(6 DOF or less in some cases).
I understand that this is solved by minimizing the squares of distances between source and target points.
I have two following questions.
1) What is the best solver in these cases? 2) In case of Levenberg–Marquardt algorithm with Quaternions representing rotations, what is the best way to calculate Jacobian matrix?
Upvotes: 0
Views: 1669
Reputation: 4431
Given points P[] and corresponding points Q[] we want to find a translation T and a rotation R to minimise
E = Sum{ <Q[i] - (R*P[i]+T)|Q[i] - (R*P[i]+T)>}
but this is
E = Sum{ <Q[i] - R*P[i] - T | Q[i] - R*P[i] - T>}
and given R, the value of T that minimises this is
T = mean { Q[i] - R*P[i]} = Qbar - R*Pbar
where Qbar is the mean of the Qs and Pbar of the Ps.
Plugging in this value of T we get
E = Sum{ <q[i] - R*p[i] | q[i] - R*p[i]>}
where q[i] = Q[i]-Qbar, p[i] = P[i]-Pbar
Finding R to minimise E is the orthogonal procrusetes problem. When this is solved for R we can compute T as above.
The modifications when wanting the solution for the weighted case are simple. First of all Pbar and Qbar should be weighted averages, and then we should use
q[i] = sqrt( weight[i]) * ( Q[i]-Qbar)
p[i] = sqrt( weight[i]) * ( P[i]-Pbar)
Upvotes: 1