pcfitcylinder giving different answers
5 ビュー (過去 30 日間)
古いコメントを表示
I'm using pcfitcylinder to calculate a best fit cylinder to a point cloud. The code is giving me different solutions when I run the function for the same data. Is this a bug in the code? I need a function that will give me reliable answers.
0 件のコメント
回答 (2 件)
Jyotish Robin
2017 年 10 月 9 日
Hi Karen!
I understand that you are getting different results each time when you run the "pcfitcylinder" command. This behavior is due to the use of MSAC, a version or RANSAC algorithm. This algorithm is used inside the estimateEssentialMatrix that's part of the helperEstimateRelativePose.m file.
RANSAC uses a random process to initialize computation of a mathematical model, in this case an essential matrix, and to remove outliers from the data. This is expected behavior. It's the nature of this approach.
For debugging purpose, you can set the random seed before the "pcfitcylinder" command to get a deterministic result using the following command:
>> rng(0);
Hope this helps!
Regards ,
Jyotish
1 件のコメント
Tim McKinley
2019 年 7 月 8 日
Hi Jyotish,
I ran into the same problem as Karen and upon following your suggest I still seem to get various fits to the data. I read that RANSAC utilizes a random sample size as well and wondered if that would be causing the solution variability.
Are you aware of a way to fix the sample size RANSAC is using or how to fix additional variable that the solver is using (beside the few listed in the pcfitcylinder documentation) to force the exact same number of points and seed point?
Thanks
Daniel Fiole
2018 年 5 月 18 日
Hi Karen,
Have you tried increasing the value of 'MaxNumTrials'?
Cheers, Daniel
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Point Cloud Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!