A python tool for fitting primitives 3D shapes in point clouds using RANSAC algorithm
Project description
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:
Installation
Requirements: Numpy
Install with Pypi:
pip3 install pyransac3d
Take a look:
Example 1 - Planar RANSAC
import pyransac3d as pyrsc
points = 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:
[1, 0.5, 2, 0]
Example 2 - Spherical RANSAC
Loading a noisy sphere's point cloud with r = 5 centered in 0 we can use the following code:
import pyransac3d as pyrsc
points = 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:
center: [0.010462385575072288, -0.2855090643954039, 0.02867848979091283]
radius: 5.085218633039647
Documentation & other links
- The documentation is this Ṕage.
- Source code in the Github repository.
- Pypi pakage installer
- You can find the animations you see in the documentation on branch Animations. It needs Open3D library to run. The Animation branch is not regularly maintained, it only exists to create some cool visualizations ;D
License
Contributing is awesome!
See CONTRIBUTING
Contact
Developed with :heart: by the internet
Mainteiner: Leonardo Mariga
Did you like it? Remember to click on :star2: button.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyransac3d-0.5.1.tar.gz
.
File metadata
- Download URL: pyransac3d-0.5.1.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/2.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd350e2f76a6622ce8345f68bdc2984efd1842f51a52b20c06ed35872a699e7c |
|
MD5 | 553097cf50553a1cbdc4df7996425f4d |
|
BLAKE2b-256 | 397510d54efc701555186d1ef603e9943fb7b1a7f6fca667185bd4dcaa6c7c7a |
File details
Details for the file pyransac3d-0.5.1-py3-none-any.whl
.
File metadata
- Download URL: pyransac3d-0.5.1-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/2.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6f9193ad9b4c3bfa224ad1d5695d155da377a550a5be22c788a6e1ef8b5b2b9 |
|
MD5 | 42d243f00cb9ea05e1f438e225680a03 |
|
BLAKE2b-256 | 1d3ddb67f98820e16c496a2dec1cfc687a99db9d8f1c1335e33507571d2f8a57 |