Plugin RANSAC crash problem

If you are allergic to bug trackers, you can post here any remarks, issues and potential bugs you encounter
Post Reply
fblue
Posts: 37
Joined: Thu Oct 25, 2018 9:00 am

Plugin RANSAC crash problem

Post by fblue »

Hello,
I have a crash problem sometimes when I use RANSAC in sphere detection. It doesn't happen everytime, maybe because it is a random-based algorithm and depending on the point cloud data.
According the debug information, it concerns the method Optimize() of the file "LowStretchSphereParametrization.h".
It crashed on the line 137 in the file ( float maxGap = vangles.front() + 2 * float(M_PI) - vangles.back(); ), when "vangles" is empty.

I don't know if it's normal that "vangles" can happen to be empty, so I'd like to remark it here. Since my plugin uses RANSAC lib, it will be greatly appreciated that if it can be fixed.

Ps:
CC Version: 2.10.2 (Zephyrus).
For now, my solution is adding a line before that to verify"vangles" like:
if (vangles.size() < 2) return;

Thanks
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Plugin RANSAC crash problem

Post by daniel »

Frankly, this code is the original code provided by the author of the RansacSD library (in 2008!)

So feel free to debug it ;)
Daniel, CloudCompare admin
fblue
Posts: 37
Joined: Thu Oct 25, 2018 9:00 am

Re: Plugin RANSAC crash problem

Post by fblue »

I tried to contact the author, but I don't succeed.
So, if I modify the codes for the bug in RANSAC, is it possible to ask you to verify and publish it on CC?
What's your way in general for fixing the bugs?

Thanks
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Plugin RANSAC crash problem

Post by daniel »

Oh yes of course. You can make a Pull Request (PR) on github and we'll happily review it and merge it.
Daniel, CloudCompare admin
Post Reply