RANSAC segmentation failed

Feel free to ask any question here
tsch_kl
Posts: 22
Joined: Tue Apr 25, 2023 8:39 am

RANSAC segmentation failed

Post 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
Attachments
Screenshot 2023-09-21 145207.png
Screenshot 2023-09-21 145207.png (19.33 KiB) Viewed 8217 times
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: RANSAC segmentation failed

Post 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?
Daniel, CloudCompare admin
tsch_kl
Posts: 22
Joined: Tue Apr 25, 2023 8:39 am

Re: RANSAC segmentation failed

Post 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.
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: RANSAC segmentation failed

Post 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.
Daniel, CloudCompare admin
MINORU NIIMURA
Posts: 4
Joined: Fri Jul 26, 2024 6:51 am

Re: RANSAC segmentation failed

Post 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 6132 times
Does anybody have an idea what is wrong with my settings?
I appreciate getting any hints.

Best regards,
MINORU NIIMURA, Tokyo, Japan
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: RANSAC segmentation failed

Post 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).
Daniel, CloudCompare admin
MINORU NIIMURA
Posts: 4
Joined: Fri Jul 26, 2024 6:51 am

Re: RANSAC segmentation failed

Post 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
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: RANSAC segmentation failed

Post 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.
Daniel, CloudCompare admin
MINORU NIIMURA
Posts: 4
Joined: Fri Jul 26, 2024 6:51 am

Re: RANSAC segmentation failed

Post 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
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: RANSAC segmentation failed

Post 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 6014 times
Daniel, CloudCompare admin
Post Reply