linefit ground segmentation algorithm Python bindings
Project description
linefit
linefit is a ground segmentation algorithm for 3D point clouds. This repo we setup a python binding for the original C++ code and push to pypi for easy installation through pip install linefit
.
Author: C++ code from Lorenz Wellhausen, nanobind by Qingwen Zhang.
Running on macOS, Windows and Linux, with Python Version >= 3.8.
0. Setup
Choose one of the following options to install the package (recommended to use Option A pip install linefit
):
Option A: Install from pypi pip install linefit
Option B: Clone this repo and run following to build:
cmake -B build && cmake --build build
pip install .
python3 -c 'import linefit; print("success")'
1. Run the example
After installation, you can run the example by, it will directly show a default effect of demo data.
python example.py
A window will pop up and show the ground segmentation result.
Parameter description
TL;DR: tune the sensor_height
to offset the ground point z to 0
. Others are optional for better performance. If you are interested in the details, please read the following.
Parameters are set in assets/config.toml
This algorithm works on the assumption that you known the height of the sensor above ground.
Therefore, you have to adjust the sensor_height
to your robot specifications, otherwise, it will not work.
The default parameters should work on the KITTI dataset.
Ground Condition
- sensor_height Sensor height above ground.
- max_dist_to_line maximum vertical distance of point to line to be considered ground.
- max_slope Maximum slope of a line.
- min_slope Minimum slope of a line.
- max_fit_error Maximum error a point is allowed to have in a line fit.
- max_start_height Maximum height difference between new point and estimated ground height to start a new line.
- long_threshold Distance after which the max_height condition is applied.
- max_height Maximum height difference between line points when they are farther apart than long_threshold.
- line_search_angle How far to search in angular direction to find a line. A higher angle helps fill "holes" in the ground segmentation.
Segmentation
- r_min Distance at which segmentation starts.
- r_max Distance at which segmentation ends.
- n_bins Number of radial bins.
- n_segments Number of angular segments.
Other
- n_threads Number of threads to use.
Acknowledgement & Citation
The original C++ code is from the repo we forked: lorenwel/linefit_ground_segmentation.
The original methods are described in the following paper:
@inproceedings{himmelsbach2010fast,
title={Fast segmentation of 3d point clouds for ground vehicles},
author={Himmelsbach, Michael and Hundelshausen, Felix V and Wuensche, H-J},
booktitle={Intelligent Vehicles Symposium (IV), 2010 IEEE},
pages={560--565},
year={2010},
organization={IEEE}
}
More python binding examples can be found in our other project:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for linefit-0.2.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cdb1cfc2616c701f054673d27c4c1fe9190d5a9344c1390d7cdc6195475f4d9 |
|
MD5 | 844df8d38486398602b8e4a1fa8b6b71 |
|
BLAKE2b-256 | 784b9dbf8f2621b29d3999cb1b52f7c5024d0b40e528dc2553235065cc427e2c |
Hashes for linefit-0.2.3-pp39-pypy39_pp73-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7872824db65b1dc4839870e2a4d6c03970e13b55206ac6019e77aaf99711e4f |
|
MD5 | f391c817b8956b53dc89509c89c2711c |
|
BLAKE2b-256 | 559a2f29825c672519a54825acb86c6672a4815f969cd4358db3ec39ffeefb09 |
Hashes for linefit-0.2.3-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2ef7233944bb1c5f1ece85c3a67e8327541581da1ca751190b60f45ec8517f2 |
|
MD5 | 2f11811e271f54f7cebec711315b6d02 |
|
BLAKE2b-256 | 36aa2e1516969edc8460950d731a5f61743607b598f38ca6cf8999d79acb6a1b |
Hashes for linefit-0.2.3-pp38-pypy38_pp73-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edc3c8a7d4a7bda8d7069c9027f54bdb1ec470ce8865005ef7344859504bd111 |
|
MD5 | 45d0c9ee58924d0c08bed004493d4c54 |
|
BLAKE2b-256 | 059badde8784f6450010bf797cccab64ccd853881debdf49e01a0bdab457dc3f |
Hashes for linefit-0.2.3-cp312-abi3-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d5efade567e7377c7fc8566a4b2a0de0a9ef257aa1bd9aff7738e4b245306be |
|
MD5 | 00148b1df80711de27dbb7080b26d54e |
|
BLAKE2b-256 | 05657072921a29bdc18167040c8803e162a638e60c81318c60ae938ee4349d0a |
Hashes for linefit-0.2.3-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3c0c7709a2873d43c6bb925fcf102209b8b4712e92503ad92dcf60f93c5100c |
|
MD5 | 67664b2f525c4f135014346ce5b69ee4 |
|
BLAKE2b-256 | b0a16410bf95b83daf7e1d12dd67667c9bd25bac0efbede6e1ee34ad6bdbf6c5 |
Hashes for linefit-0.2.3-cp312-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75b0ba4b97ae42394d2c74384936efc674beee00a55a180514e8642618192fdf |
|
MD5 | 888b5396fa68ddb6bcba796b674d634c |
|
BLAKE2b-256 | 1fd76dffb70e18c782782eed6586a6e2e89f91bbf11d6a8c9454de4173803c3e |
Hashes for linefit-0.2.3-cp312-abi3-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 752782e3892febc60f4dadde4e8068f4773168160c128fce3a470896c6ffbc44 |
|
MD5 | 227e14b367f374cb35f2e2a288e1302c |
|
BLAKE2b-256 | 4f04bfdf24e9b39df285dcce265a119f29cf7188390acfb2308bddd102a34415 |
Hashes for linefit-0.2.3-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3387c8bb22fb25bf9ede68844630280612ea678a252235dd1ff533d2c533f23 |
|
MD5 | 993ea5f655f184bd7a5008e8f00d0add |
|
BLAKE2b-256 | 982dae36150d84a5c359b5d5f4c1342e3f97e0c4c7342615299898bc2cdf6d45 |
Hashes for linefit-0.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b843938eaf61dd2b2597983a94c4a3016ce891ffd5114d2acf81e310a4aec96 |
|
MD5 | c2c83211e63f8e635610f187c8323fa2 |
|
BLAKE2b-256 | 46108fb7de70c5e9f30bee94f4339cabfe430973271c9991deecd55fb5c8e0f9 |
Hashes for linefit-0.2.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c34018e11337a43bd926a90595dea2375a9c60ca182a8edc9532878cd0bfd292 |
|
MD5 | 970842146ba5255bc134588a5f3a9a0f |
|
BLAKE2b-256 | a8d2bce3932f4dce870e9da42b86c943056df9736a369f9ad9863669b2a2df78 |
Hashes for linefit-0.2.3-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aaac1427e0ca30a83f92036d8602e7172e89507e52868d88902bc13a5ed0a201 |
|
MD5 | c1d79c162e60019f0ffaf14c3fa35693 |
|
BLAKE2b-256 | e9c103b7cfd98540a61b0eb4e8f8ee7d02d5b2796fbeb1eb94611704db500890 |
Hashes for linefit-0.2.3-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 301cb6a865c60c249ff1ede4af7fe4f5cf22b1908e273bbddd2cc482b60746c8 |
|
MD5 | a43a2de3c4143fb8c155e4a78a66ea13 |
|
BLAKE2b-256 | cdeb39d041ee9ced6f79cde3a899ab7358acd48e7582710d2c673b1e3977f535 |
Hashes for linefit-0.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 652f27c9180509c4ea64d4beac4422a388735aa8ad3d0cc2852c4f1a7b381b59 |
|
MD5 | f25f0170c3f4842232ece26e02b14c47 |
|
BLAKE2b-256 | 56fc42d61084e28f13878be11578d3a0d1b3cbe173fa043b1bf9b8510f8b21ac |
Hashes for linefit-0.2.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ded8c42788b4b72106a856cfa0ce5a3f20d76e35f1c86b0b68aca3314913ec35 |
|
MD5 | 8cb77763f9fe8414c4d58c3143310dfc |
|
BLAKE2b-256 | 72f2ad3d1b1fdadaf0fbac52105ff3062295054b7c3535c429801379b18a444f |
Hashes for linefit-0.2.3-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 784b48f9252db478c94978a0e15c9bd152e191b5572029ca00ee0268b0405231 |
|
MD5 | 6dc03bfc71bb65f73a8900642e2045ce |
|
BLAKE2b-256 | ef86880d43a547104da181159098ee5686d90f8adfb1a19c84fd8068451d8d4a |
Hashes for linefit-0.2.3-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2b0bf5a2cbf028e46e0d5e7126c73a38f28b685c5febbd731134311ea3e6c41 |
|
MD5 | 0a0ecbd111d081a4fa6005e90a9964e3 |
|
BLAKE2b-256 | a6c84cdb8ca1dd5aa9378e31ecb1d48082693b82c7a70444babfcbe86ce60d00 |
Hashes for linefit-0.2.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a57fad9b78916c27149515da6a1b518ca32eb02e69460dd2629253caf177c39 |
|
MD5 | 57472e2cf40028114dc429ba869512c1 |
|
BLAKE2b-256 | 094600198849fcb7dc32d3fc1bbc580db58526153498b3a9166c4bda40d97fe6 |
Hashes for linefit-0.2.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fe47ea6e2293e6a2824826d2db31160efb8d49d7adbf1178f454e983487d4a2 |
|
MD5 | 14a2f75461064bcd5132ae9770370c29 |
|
BLAKE2b-256 | dec1acdbd078305a04232e575f176ad54f31a3e9afab875c5ebeaf5e32511c47 |
Hashes for linefit-0.2.3-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 299ae5ac00bc05ca32bfc8e6c6035058491587f454419ca6fb77ae2afe841ab6 |
|
MD5 | a8cf63b505485ae96cf6dec7643e25da |
|
BLAKE2b-256 | a05b280c57c689268bce66b842914de6b23b10dc4224fe646b30fd8cdec11750 |
Hashes for linefit-0.2.3-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 477cd948d61b61d84eea2de59872c056046ec5b87aeec316eae3837b56717371 |
|
MD5 | f6de3dbfe04a9c1ea1ef38780a24ee33 |
|
BLAKE2b-256 | 0350c34b0a79ff446634eb2a2fbf8e2cdbfa2dc71d2cb3c2ccf14b9dddb8bffe |
Hashes for linefit-0.2.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e28227c225bada22873d8f83f5b88b1558396622a40ec0cc966afea9ee906f05 |
|
MD5 | da5331042914bc7c6ca827c59d1004aa |
|
BLAKE2b-256 | a206314a8e8440dd98eca7217e03fb9d5376fc1c3c4406d05087e04ffd73fe3e |
Hashes for linefit-0.2.3-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86e34bc4c70e8ffea7f50a73d29f51205c32d7e6279076013c689cd271e210fe |
|
MD5 | 33af8948d781ad96f0f11f77c1416eaf |
|
BLAKE2b-256 | 7ef4e05c9a2e2da4c8ada052b99d0ec72a684182521094e88c08cd5000233e68 |
Hashes for linefit-0.2.3-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40abedd3e29e1418253d30d9593cc9a9157cf7be434e3db2039b0d4f8a74cc31 |
|
MD5 | a56743c04663d8fc056fa080ad2ac98f |
|
BLAKE2b-256 | 29e82b8ad89f50d9328421fab7fb0143b8a00fc6f5d987159a0b7bebd4c9ccc4 |