필터 지우기
필터 지우기

Why am I getting an unexpected output using pcregistericp?

조회 수: 15 (최근 30일)
Matthew Blomquist
Matthew Blomquist 2023년 5월 22일
댓글: Matthew Blomquist 2023년 9월 29일
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
Matthew Blomquist
Matthew Blomquist 2023년 5월 25일
UPDATE: I wanted to follow up in case anyone comes across this in the future. I did some more digging on ICP code created on MATLAB file exchange and found that most of the limitations arise when the rotations and/or translations are very large, then the algorithm cannot solve well. So, using the code above, I changed the angles to be 44.9, 90+44.9, etc. and found that the algorithm worked perfectly. So, it seems like 45deg is too large of a rotation for this problem.
For my research, my plan is to try to align the two point clouds manually, and then use pcregistericp to fine tune the registration. Then the translations and rotations should be small enough for the algorithm to work. I'm happy to hear other suggestions, though!

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

채택된 답변

Karan Singh
Karan Singh 2023년 8월 29일
Hey Matthew, upon reviewing your code, it seems that you are using the “pcregistericp” function correctly. However, the behaviour you are observing is expected when using the iterative closest point (ICP) algorithm.
The ICP algorithm is primarily designed to estimate translations and rotations between two-point clouds. It assumes that the two-point clouds have a similar shape and differ only by translation and rotation. In your case, the two-point clouds have a different shape (one is a rotation of the other), which is not an ideal scenario for ICP.
Although as you have updated you have found the answer for it yourself only, I hope the explanation above serves as a suggestion reaffirming the same.
Hope it helps!

추가 답변 (0개)

카테고리

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

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by