Clear Filters
Clear Filters

force to estimate with pcregistericp only the rotation

8 views (last 30 days)
Hi,
I have the use case that I would like to us the G-ICP with plane to plane (as provided in pcregistericp) to estimate just the rotation. I know that the translation cannot change.
However I don't find a way to force just the rotation been estimated. Any ideas?
providing an initial translation didn't help.

Answers (1)

Venkat Siddarth Reddy
Venkat Siddarth Reddy on 12 Dec 2023
I understand that you are trying to estimate just the rotation of the point cloud, using G-ICP with plane to plane algorithm.
To achieve this, you can use the object returned by "pcregistericp" function, which is a rigidtform3d object.
Please refer to the following documentation to learn more about pcregistericp function:
This object has a property called "R" which can be used to extract only the rotation matrix of the rigid transformation
Here is an example code for your reference on how to use "R" property of the rigidtform3d object .
ld = load("livingRoom.mat");
moving = ld.livingRoomData{1};
fixed = ld.livingRoomData{2};
Visualize the point cloud and set the direction to display the y-axis.
figure
pcshowpair(moving,fixed,VerticalAxis="Y",VerticalAxisDir="Down")
Downsample the point clouds using nonuniformGridSample method to improve the efficiency and accuracy of registration.
maxNumPoints = 12;
fixedDownsampled = pcdownsample(fixed,"nonuniformGridSample",maxNumPoints);
movingDownsampled = pcdownsample(moving,"nonuniformGridSample",maxNumPoints);
Align the point clouds using plane-to-plane (Generalized-ICP) registration.
tform = pcregistericp(movingDownsampled,fixedDownsampled,Metric="planeToPlane");
rotmatrix=tform.R %Rotation Matrix of the transformation
rotmatrix = 3×3
0.9948 0.0288 -0.0976 -0.0288 0.9996 0.0020 0.0976 0.0008 0.9952
%Conversion of rotation matrix to euler angles
rotm2eul(rotmatrix)
ans = 1×3
-0.0289 -0.0978 0.0008
Refer to the following documentation to learn more about rigidtform3d,rot2mul functions and the example code used here:
I hope this resolves your query.
Regards
Venkat Siddarth V
  1 Comment
canadarunner
canadarunner on 12 Dec 2023
Thank you for your extensive answer.
Unfortuntately it is not what I meant, as you just extract the rotations from the 4x4 matrix, but the tranlsations are still estimated. The translation are therefore =/= 0
It would need to be possible on the ICP level to "lock" the translation to 0, which is not possible as I don't have access to the source code.
Thx.

Sign in to comment.

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!