Rotating 3D cloud matrix data

조회 수: 9 (최근 30일)
Kelly
Kelly 2019년 6월 17일
편집: Jan 2019년 6월 17일
Hi,
I have a 3D cloud point matrix (x,y,z) (39600x3) and I am trying to rotate all the points by a few degrees clockwise. I have been attempting to use 'makeghtform' however I keep getting errors and I have been doing trial and error to try and work out how to complete this task however I seem to be failing. Can anyone please help me?
Thanks
  댓글 수: 1
Jan
Jan 2019년 6월 17일
Post the code and a copy of the error message.

댓글을 달려면 로그인하십시오.

답변 (2개)

Star Strider
Star Strider 2019년 6월 17일
The rotate function could be an option.

Jan
Jan 2019년 6월 17일
편집: Jan 2019년 6월 17일
Multiplacte the data with a rotation matrix, e.g. obtained by: https://www.mathworks.com/matlabcentral/fileexchange/66446-rotation-matrix
R = RotMatrix(alpha, axisOfRotation);
RotatedPoints = R * Points;
Or without this function:
% Normalized vector:
u = u(:);
u = u ./ sqrt(u.' * u);
% 3D rotation matrix:
x = u(1);
y = u(2);
z = u(3);
mc = 1 - c;
R = [c + x * x * mc, x * y * mc - z * s, x * z * mc + y * s; ...
x * y * mc + z * s, c + y * y * mc, y * z * mc - x * s; ...
x * z * mc - y * s, y * z * mc + x * s, c + z * z .* mc];

카테고리

Help CenterFile Exchange에서 Point Cloud Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by