Page 1 of 2

RANSAC segmentation failed

Posted: Thu Sep 21, 2023 12:54 pm
by tsch_kl
Hello Daniel,
i wanted to run RANSAC with following information. Unfortuentely I get the message "[qRansacSD] Segmentation failed..."
What is the problem here? It ditd work with 15 mio points, but not with 22 mio points. Why?
Would it be possible to define smaller sampling resolutions like 0,0014950m?

Regards ands thanks in advance!
Thomas

Re: RANSAC segmentation failed

Posted: Sat Sep 23, 2023 8:41 am
by daniel
Generally it's related to the 'minimum number of points per primitive'. If it's too high, it's likely that the algorithm failed to find a set of that many points that respect the other constraints. Can you try with a lower number of points?

Re: RANSAC segmentation failed

Posted: Mon Sep 25, 2023 4:48 am
by tsch_kl
I am using the RANSAC algorithm in my research. In the research, I am investigating different sets of support points (0.01, 0.1, 1, 5, 10, 20, 35, 50, 65, 80, 95) with the question of which % are enough to find the primitive of a plane. By 50% the algorithm fails.

Would you agree to the following:
  • Decreased Robustness: RANSAC is usually robust because it randomly samples data points to estimate the primitive. However, when I demand a high minimum number of inliers to declare a hypothesis (my plane to be found) as valid, it reduces the algorithm's robustness. It's more likely that no subset of points will meet this stringent criterion.
  • Trade-off with Data Density: The required percentage of points for support directly depends on the density of my data. I do have a sampling resolution of 0.0015m/pix. In sparse data regions (which I do not really have), it can be challenging to find enough points to satisfy the minimum requirement, leading to algorithm failure.
  • Underlying Complexity: The RANSAC algorithm assumes that the data can be described by a particular model (in my case, a plane). If I set a high minimum number of points per primitive, it means I am assuming that the underlying data can be well-described by a complex model (one that requires a large number of points to define). But it does not work with other 50%.
So why does the algorithm fail in your opinion? I do not see any problem with the other constraints. The point cloud has a sampling resolution of 0.001495m/pixel, I do use 0.001 as smallest number. The max distance to primitive is 1.00m, but the cloud of the plane is actually only ~0.20m wide.

Re: RANSAC segmentation failed

Posted: Mon Sep 25, 2023 7:56 pm
by daniel
Hard to say without looking at the data... I managed in the past to get a result with much more than 50% of supporting points (but of course, that would be on a cylindrical cloud when looking for a cylinder for instance). Most of the points must be part of the primitive that you look for.

Re: RANSAC segmentation failed

Posted: Fri Jul 26, 2024 7:09 am
by MINORU NIIMURA
Hi,

I am MINORU NIIMURA, working on 3D data measurement and analysis.
I have been using CloudCompare for more than 10 years now.

I tried to generate a torus to match with the measured elbow (part of pipe).
I got an error message "segmentation failed".

This error message appears for any other shaped that I tried.
segmentation failed  for torus.png
segmentation failed for torus.png (164.54 KiB) Viewed 6227 times
Does anybody have an idea what is wrong with my settings?
I appreciate getting any hints.

Best regards,
MINORU NIIMURA, Tokyo, Japan

Re: RANSAC segmentation failed

Posted: Fri Jul 26, 2024 11:52 am
by daniel
Hi,

Do you have enough vertices/points in the selected cloud? Because a minimum of 500 points may be too much compared to the total number of points?

Otherwise, don't hesitate to send me the cloud (to admin@cloudcompare.org).

Re: RANSAC segmentation failed

Posted: Fri Jul 26, 2024 12:57 pm
by MINORU NIIMURA
Hi Daniel,

I will send you the 3D data (PLY format).
Thank you very much for your assistance.

By the way, I tried many different 3D data (PLY format) but all of them had failed, so your information.

Best regards,
Minoru Niimura

Re: RANSAC segmentation failed

Posted: Fri Jul 26, 2024 3:37 pm
by daniel
Thanks for the data.

I can confirm that it fails on my side as well when trying to detect a torus... I'll have to look at what happens at a lower level in the code. It may take some time.

Re: RANSAC segmentation failed

Posted: Sat Jul 27, 2024 1:22 am
by MINORU NIIMURA
Hi Daniel,

Thanks for your confirmation and efffort to try to solve at low level programming.
I look forward to getting a solution.

Best regards,
Minoru Niimura, Tokyo, Japan

Re: RANSAC segmentation failed

Posted: Sat Jul 27, 2024 11:28 am
by daniel
So it seems that one has to set the min and max radius parameters to be able to extract torus shapes... I'll try to fix this in a future release.

Meanwhile, just make sure you specify some realistic values:
ransac_torus_extract.JPG
ransac_torus_extract.JPG (55.64 KiB) Viewed 6109 times