Limiting Degrees of Freedom in 3D SVD

3 views (last 30 days)
Collin
Collin on 8 Mar 2013
Hi There,
Wondering if I might get some help in my application of a 3D best fitting algorithm. I am using an algorithm provided by T.S. Huang to register two 3d surfaces. This works very well for my application but now I am wanting to limit the degrees of freedom in this fit. Right now, there are 6:translation in x,y,z and rotations about each axis. I would like to limit translation to only one or two axes and the same with rotation.
I believe rotation can be limited by changing the co-variance matrix, H to eliminate dot products not in the desired rotation planes. I have found this works for limiting to one axis of rotation but have not yet tried two.
My major challenge is how to eliminate translation in a certain direction. Could I just remove that coordinate and proceed? Removing just the coordinate from the translation matrix does not work.
Hoping someone may be able to help, my code is below. pi and ppi are 1x3xN matrices of [x;y;z] data points.
p=mean(pi,3);
pp=mean(ppi,3);
qi=bsxfun(@minus,pi(:,1,:),p);
qpi=bsxfun(@minus,ppi(:,1,:),pp);
H=0;
for i=1:size(qi,3)
H=H+qi(:,1,i)*qpi(:,1,i)';
end
[U,S,V]=svd(H);
X=V*U';
if det(X)~=-1
R=X;
else
V(:,3)=-V(:,3);
R=V*U';
end
T=pp-R*p;
Thank You!

Answers (0)

Categories

Find more on Eigenvalues in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!