pcfitcylinder giving different answers

조회 수: 1 (최근 30일)
Karen Kruger
Karen Kruger 2017년 10월 4일
댓글: Tim McKinley 2019년 7월 8일
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.

답변 (2개)

Jyotish Robin
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
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
Daniel Fiole 2018년 5월 18일
Hi Karen,
Have you tried increasing the value of 'MaxNumTrials'?
Cheers, Daniel

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by