Point cloud sequential transformation
显示 更早的评论
Hi everyone,
I'm trying to apply two transformations to a point cloud, a translation A and then a rotation B. My issue is that the transformation matrix I get when using pcregistericp seems to be the opposite of what I expected (I get A*B instead of B*A). I'm not sure what the issue is, or if I'm misunderstanding the order of transformations in linear algebra.
xyzPoints=[];
for x=0:0.1:1
for y=0:0.2:2
z=x^2+y^3;
xyzPoints=[xyzPoints;x y z];
end
end
ptCloud100 = pointCloud(xyzPoints);
%translation
A = [1 0 0 0; ...
0 1 0 0; ...
0 0 1 0; ...
2 4 5 1];
tform = affine3d(A);
ptCloudOuttrans = pctransform(ptCloud100,tform);
%rotation
theta=deg2rad(70);
B = [cos(theta) 0 sin(theta) 0; ...
0 1 0 0; ...
-sin(theta) 0 cos(theta) 0; ...
0 0 0 1];
tform = affine3d(B);
ptCloudOutrot = pctransform(ptCloudOuttrans,tform);
%ICP
[tform_inv,movingReg] = pcregistericp(ptCloudOutrot,ptCloud100,'Extrapolate',true,'MaxIterations',50);
t=invert(tform_inv);
disp(t.T);
%What I expected it to match
disp(B*A);
%what it matches
disp(A*B);
回答(1 个)
Sulaymon Eshkabilov
2021-5-19
The answer is simple. MATLAB's accuracy is not absolute and thus, you have gotten difference. You can test this exercise:
theta=deg2rad(90);
...
B*A
A*B
...
Good luck.
类别
在 帮助中心 和 File Exchange 中查找有关 Point Cloud Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
