A simple PyTorch implementation of plane fitting with RANSAC. Some ideas are taken from: https://github.com/leomariga/pyRANSAC-3D.
In each (batched-)RANSAC iteration, a batch of triplets is sampled and assessed in parallel.
A cross-product is used to get plane equations from triplets.
The refinement, post identification of inliers, is done with an eigen decomposition of P.T @ P
where P
is the matrix of points in homogeneous coordinates.
Classicially, an SVD decomposition of P
is used but this can be slow and memory intensive with large number of points.
We thus opted for the eigen decomposition approach despite it being less numerically stable.