Rank: 3194 based on 40 downloads (last 30 days) and 1 file submitted
photo

Ehud Schreiber

E-mail
Company/University
Compugen Ltd.

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Ehud
Updated   File Tags Downloads
(last 30 days)
Comments Rating
09 Jul 2013 Kabsch algorithm Find the rigid transformation & Least Root Mean Square distance between two paired sets of points Author: Ehud Schreiber computational geometr... 40 2
  • 4.5
4.5 | 2 ratings
Comments and Ratings on Ehud's Files View all
Updated File Comment by Comments Rating
08 Jul 2013 Kabsch algorithm Find the rigid transformation & Least Root Mean Square distance between two paired sets of points Author: Ehud Schreiber Daniel

For large N most of the time is spent in the two for loops.
To remove them bsxfun is useful. Replace the lines in Kabsch.m:
------------------------------------
Pdm = zeros(D,N) ;
for i=1:N
Pdm(:,i) = m(i)*P(:,i) ;
end
C = Pdm*Q' ;
------------------------------------
by
------------------------------------
C = bsxfun(@times,m,P)*Q';
------------------------------------
and the lines
------------------------------------
lrms = 0 ;
for i=1:N
lrms = lrms + m(i)*Diff(:,i)'*Diff(:,i) ;
end
lrms = sqrt(lrms) ;
------------------------------------
by
------------------------------------
lrms = sqrt(sum(sum(bsxfun(@times,m,Diff).*Diff))) ;
------------------------------------
and the execution speed will be increased by ~70 for N=3'000'000

22 Oct 2012 Kabsch algorithm Find the rigid transformation & Least Root Mean Square distance between two paired sets of points Author: Ehud Schreiber Martin, Andreas

I found a little mistake that results in numerical jitter under some circumstances.
If you change the line:

"if (det(C) < 0)" into "if (det(W*V') < 0)"

all works fine.

Cheers, Andreas

Contact us