https://github.com/leomariga/pyransac-3d
A python tool for fitting primitives 3D shapes in point clouds using RANSAC algorithm
https://github.com/leomariga/pyransac-3d
3d-reconstruction cuboid cylinder open3d plane-detection planes point-cloud ransac ransac-algorithm segmentation
Last synced: 13 days ago
JSON representation
A python tool for fitting primitives 3D shapes in point clouds using RANSAC algorithm
- Host: GitHub
- URL: https://github.com/leomariga/pyransac-3d
- Owner: leomariga
- License: apache-2.0
- Created: 2020-08-15T21:45:10.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-11-15T19:23:21.000Z (over 1 year ago)
- Last Synced: 2025-04-02T00:38:11.595Z (20 days ago)
- Topics: 3d-reconstruction, cuboid, cylinder, open3d, plane-detection, planes, point-cloud, ransac, ransac-algorithm, segmentation
- Language: Python
- Homepage: https://leomariga.github.io/pyRANSAC-3D/
- Size: 49.9 MB
- Stars: 606
- Watchers: 7
- Forks: 73
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Citation: CITATION.cff
Awesome Lists containing this project
README
-----------------
[](https://zenodo.org/badge/latestdoi/287829485)
[](https://pypi.org/project/pyransac3d/)
[](https://github.com/leomariga/pyransac3d/blob/master/LICENSE)## What is pyRANSAC-3D?
**_pyRANSAC-3D_** is an open source implementation of Random sample consensus (RANSAC) method. It fits primitive shapes such as planes, cuboids and cylinder in a point cloud to many aplications: 3D slam, 3D reconstruction, object tracking and many others.
#### Features:
- [Plane](https://leomariga.github.io/pyRANSAC-3D/api-documentation/plane/)
- [Cylinder](https://leomariga.github.io/pyRANSAC-3D/api-documentation/cylinder/)
- [Cuboid](https://leomariga.github.io/pyRANSAC-3D/api-documentation/cuboid/)
- [Sphere](https://leomariga.github.io/pyRANSAC-3D/api-documentation/sphere/)
- [Line](https://leomariga.github.io/pyRANSAC-3D/api-documentation/line/)
- [Circle](https://leomariga.github.io/pyRANSAC-3D/api-documentation/circle/)
- [Point](https://leomariga.github.io/pyRANSAC-3D/api-documentation/point/)## Installation
Requirements: NumpyInstall with [Pypi](https://pypi.org/project/pyransac3d/):
```sh
pip3 install pyransac3d
```## Take a look:
### Example 1 - Planar RANSAC
``` python
import pyransac3d as pyrscpoints = load_points(.) # Load your point cloud as a numpy array (N, 3)
plane1 = pyrsc.Plane()
best_eq, best_inliers = plane1.fit(points, 0.01)```
Results in the plane equation Ax+By+Cz+D:
`[0.720, -0.253, 0.646, 1.100]`### Example 2 - Spherical RANSAC
Loading a noisy sphere's point cloud with r = 5 centered in 0 we can use the following code:
``` python
import pyransac3d as pyrscpoints = load_points(.) # Load your point cloud as a numpy array (N, 3)
sph = pyrsc.Sphere()
center, radius, inliers = sph.fit(points, thresh=0.4)```
Results:
``` python
center: [0.010462385575072288, -0.2855090643954039, 0.02867848979091283]
radius: 5.085218633039647
```
## Documentation & other links
- The [documentation is this Ṕage](https://leomariga.github.io/pyRANSAC-3D/).
- Source code in the [Github repository](https://github.com/leomariga/pyRANSAC-3D).
- [Pypi pakage installer](https://pypi.org/project/pyransac3d/)
- You can find the animations you see in the documentation on branch [Animations](https://github.com/leomariga/pyRANSAC-3D/tree/Animations). It needs [Open3D](https://github.com/intel-isl/Open3D) library to run. The Animation branch is not regularly maintained, it only exists to create some cool visualizations ;D## License
[Apache 2.0](https://github.com/leomariga/pyRANSAC-3D/blob/master/LICENSE)## Citation
Did this repository was useful for your work? =)```
@software{Mariga_pyRANSAC-3D_2022,
author = {Mariga, Leonardo},
doi = {10.5281/zenodo.7212567},
month = {10},
title = {{pyRANSAC-3D}},
url = {https://github.com/leomariga/pyRANSAC-3D},
version = {v0.6.0},
year = {2022}
}
```## Contributing is awesome!
See [CONTRIBUTING](https://github.com/leomariga/pyRANSAC-3D/blob/master/CONTRIBUTING.md)
## Contact
Developed with :heart: by the internet
Mainteiner: [Leonardo Mariga](https://github.com/leomariga)
Did you like it? Remember to click on :star2: button.