pcfitcylinder giving different answers

10 visualizaciones (últimos 30 días)
Karen Kruger
Karen Kruger el 4 de Oct. de 2017
Comentada: Tim McKinley el 8 de Jul. de 2019
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.

Respuestas (2)

Jyotish Robin
Jyotish Robin el 9 de Oct. de 2017
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 comentario
Tim McKinley
Tim McKinley el 8 de Jul. de 2019
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

Iniciar sesión para comentar.


Daniel Fiole
Daniel Fiole el 18 de Mayo de 2018
Hi Karen,
Have you tried increasing the value of 'MaxNumTrials'?
Cheers, Daniel

Categorías

Más información sobre Point Cloud Processing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by