Why am I getting an unexpected output using pcregistericp?
Show older comments
Hello,
I am hoping to use the function pcregistericp in my research, so I created a simple test to try to understand the code better. I created two sets of points, one rotating 45deg counterclockwise relative to the first set of points. However, the output point cloud only translates instead of rotates, which shouldn't be correct.
Are you able to look at my code to see if I'm using pcregistericp incorrectly? Or is this just a limitation of using the iterative closest point algorithm? Thank you very much for your help. The code is inserted below:
% Moving
m1 = [ 1 , 0 , 0 ; 0 , 1 , 0 ; -1 , 0 , 0 ; 0 , -1 , 0 ; 0 , 0 , 0 ] ;
% Fixed
f1 = [ cosd(45) , sind(45) , 0 ; cosd(135) , sind(135) , 0 ; cosd(225) , sind(225) , 0 ; cosd(315) , sind(315) , 0 ; 0 , 0 , 0 ] ;
% Use pcregistericp after converting to point clouds
[ Tform , mNew , rmse ] = pcregistericp( pointCloud( m1 ) , pointCloud( f1 ) ) ;
% Plot point cloud locations
figure() ; hold on ; title( [ 'RMSE = ' , num2str(rmse) ] )
scatter3( m1(:,1) , m1(:,2) , m1(:,3) , 'r' , 'filled' )
scatter3( f1(:,1) , f1(:,2) , f1(:,3) , 'b' , 'filled' )
scatter3( mNew.Location(:,1) , mNew.Location(:,2) , mNew.Location(:,3) , 'g' )
legend( 'Moving' , 'Fixed' , 'New moving' )

1 Comment
Matthew Blomquist
on 25 May 2023
Accepted Answer
More Answers (0)
Categories
Find more on Point Cloud Processing 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!