Page 1 of 1

Plugin RANSAC crash problem

Posted: Wed Jul 10, 2019 8:44 am
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

Re: Plugin RANSAC crash problem

Posted: Thu Jul 11, 2019 8:30 pm
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 ;)

Re: Plugin RANSAC crash problem

Posted: Fri Aug 02, 2019 2:59 pm
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

Re: Plugin RANSAC crash problem

Posted: Sat Aug 03, 2019 7:29 am
by daniel
Oh yes of course. You can make a Pull Request (PR) on github and we'll happily review it and merge it.