フィルターのクリア

'Iterations stopped. The solution didn't converge due to ill conditioned or non finite matrix computation.' when use function 'pcregistercpd'.

2 ビュー (過去 30 日間)
This is my code, it's about 2D point set registration. And I want to use the function 'pcregistercpd'. When I run it, the answer always be 'Iterations stopped. The solution didn't converge due to ill conditioned or non finite matrix computation.'. And the rotation matrix always be unit matrix. The input data is generated easily and format is pointCloud. I have no idea where is the problem.
clc;clear;close all
noise_level=0;
num_all=50;
outlier_rate=0;
num_inlier=round(num_all*(1-outlier_rate));
num_outlier=round(num_all-num_inlier);
[data_x,data_y,theta_gt,t_gt]=gen_noise_data(num_inlier,num_outlier,noise_level);
data_x(:,3)=1;
data_y(:,3)=0;
dx = pointCloud(data_x);
dy = pointCloud(data_y);
tic
[tform,rmse] = pcregistercpd(dx,dy,'Transform','Rigid','Verbose',true);%%'Tolerance',1e-6,'OutlierRatio',0,'MaxIterations',50,
Tim=toc;

回答 (1 件)

Zuber Khan
Zuber Khan 2024 年 5 月 7 日
Hi,
The issue that you are encountering with the use of "pcregistercpd" i.e. solution not converging and always returning a unit matrix for the rotation part of the transformation might be due to several reasons.
  • The Coherent Point Drift (CPD) algorithm relies on the statistical alignment of point sets, and if the points are too sparse or not distributed in a way that represents the shapes to be aligned, the algorithm may struggle to find a meaningful alignment. Kindly ensure that your data points in "data_x" and "data_y" have sufficient variability and are not too sparse.
  • The CPD algorithm is robust to noise, outlier and missing points, at the expense of speed. Consider downsampling point clouds using "pcdownsample" before using "pcregistercpd" to improve the efficiency of registration.
  • Given that outliers can skew the alignment process, fine-tuning the 'OutlierRatio' parameter to reflect the actual proportion of outliers in your data might be necessary. Kindly note that you have not substituted the value of 'OutlierRatio' arguement in "pcregistercpd" function. Rather, it is added as a comment. Try to observe the output by substituting this value.
  • By default, the 'MaxIterations' arguement is equal to 20, while you might need it to be 50. Again, since you have not specified this value inside the "pcregistercpd" function, it assumes it be 20. Similarly, you have not specified 'Tolerance' value. I would suggest you to consider playing with these arguements and see if the solution converges.
  • Lastly, the "pointCloud" object creates point cloud data from a set of points in 3-D coordinate system. Given that you are adding a third column to your "data_x" and "data_y" matrices, with data_x(:,3)=1 and data_y(:,3)=0, it seems like you are trying to work with 2D point sets but are manually setting the z-coordinates to constants. This approach is unusual and might be contributing to the issue, since "pcregistercpd" is designed to work with 3D point clouds.
Since you have not provided the code defining "gen_noise_data" method, it is not possible to debug the given code and reproduce this issue . However, I have provided a generic response based on my set of observations from the given information.
I hope this will help you to resolve the issue.
Regards,
Zuber

Community Treasure Hunt

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

Start Hunting!

Translated by