-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,32 +39,39 @@ If you are using `segment-lidar`, we highly recommend that you take the time to | |
|
||
## Basic tutorial | ||
|
||
A basic tutorial is available [here](https://yarroudh.gitbook.io/segment-lidar/tutorial/basic-usage). | ||
You can also refer to API for more information about different parameters. | ||
A basic tutorial is available [here](https://yarroudh.github.io/segment-lidar/tutorial.html). | ||
|
||
You can also refer to [API](https://yarroudh.github.io/segment-lidar/module.html) for more information about different parameters. | ||
|
||
### Without ground filtering | ||
|
||
```python | ||
from segment_lidar import samlidar | ||
from segment_lidar import samlidar, view | ||
|
||
viewpoint = view.TopView() | ||
|
||
model = samlidar.SamLidar(ckpt_path="sam_vit_h_4b8939.pth") | ||
points = model.read("pointcloud.las") | ||
labels, *_ = model.segment(points=points, image_path="raster.tif", labels_path="labeled.tif") | ||
labels, *_ = model.segment(points=points, view=view, image_path="raster.tif", labels_path="labeled.tif") | ||
model.write(points=points, segment_ids=labels, save_path="segmented.las") | ||
``` | ||
|
||
### With ground filtering | ||
|
||
```python | ||
from segment_lidar import samlidar | ||
from segment_lidar import samlidar, view | ||
|
||
viewpoint = view.TopView() | ||
|
||
model = samlidar.SamLidar(ckpt_path="sam_vit_h_4b8939.pth") | ||
points = model.read("pointcloud.las") | ||
cloud, non_ground, ground = model.csf(points) | ||
labels, *_ = model.segment(points=cloud, image_path="raster.tif", labels_path="labeled.tif") | ||
labels, *_ = model.segment(points=cloud, view=view, image_path="raster.tif", labels_path="labeled.tif") | ||
model.write(points=points, non_ground=non_ground, ground=ground, segment_ids=labels, save_path="segmented.las") | ||
``` | ||
|
||
**Note**: The latest version of `segment-lidar` supports defining a custom pinhole camera, with or without interactive visualization, and save the view as an image. Please, refer to the [documentation](https://yarroudh.github.io/segment-lidar/tutorial.html#interactive-mode) for more details. | ||
|
||
## Sample data | ||
|
||
For testing purposes, you can download a sample here: [pointcloud.las](https://drive.google.com/file/d/16EF2aRSvo8u0pXvwtaQ6sjhP5h0sWw3o/view?usp=sharing). | ||
|
@@ -154,4 +161,4 @@ For more detailed information please contact us via <[email protected]>, we ar | |
|
||
----- | ||
|
||
Copyright © 2023, [Geomatics Unit of ULiège](http://geomatics.ulg.ac.be/fr/home.php). Released under [BSD-3 Clause License](https://github.com/Yarroudh/segment-lidar/blob/main/LICENSE). | ||
Copyright © 2023, [Geomatics Unit of ULiège](http://geomatics.ulg.ac.be/fr/home.php). Released under [BSD-3 Clause License](https://github.com/Yarroudh/segment-lidar/blob/main/LICENSE). |