Yarroudh/segment-lidar

where to find raster.tif and labels.tif for pointcloud.las example

philosadelphos opened this issue · 4 comments

hi there Yarroudh,
Can you please help me understand where should I retrieve: raster.tif and labels.tif related to the pointcloud.las example given, in order to run one of the lines from the tutorial.
labels, *_ = model.segment(points=points, view=viewpoint, image_path="raster.tif", labels_path="labeled.tif")
model.write(points=points, segment_ids=labels, save_path="segmented.las")

thank you so much

@philosadelphos these are generated in the folder where you are excuting your python script

@philosadelphos these are generated in the folder where you are excuting your python script

Hi there @Yarroudh,
Thank you so much for taking time to reply to me!
There seems to be a problem in creating the path/directories needed to save the outputs. Please, take a look to the tutorial code runed on jupyter lab and the outputs (w/ error), here is the link to a print screen.

Further when I run the summarized code given in our tutorial page. I get a different type of error with "instance", please take a look to the print screen.

My folder structure where I run the code is this one.

Can you please help me solve this issue?
Thank you so much for your support.

Hi,

I also got the same error.

To solve it, I created a folder named test.
I edited the relevant line like this:
labels, *_ = model.segment(points=cloud, view=viewpoint, image_path="test/raster.tif", labels_path="test/labeled.tif")

@enisgetmez Thank you for the reply.
I've noticed that in the tutorial page is the following code:
labels, *_ = instance.segment(points=cloud, view=viewpoint, image_path="raster.tif", labels_path="labeled.tif")

It should be:
labels, *_ = model.segment(points=cloud, view=viewpoint, image_path="raster.tif", labels_path="labeled.tif")
Since instance is not defined.
I've used your very welcomed tip, I created a test folder and it went a little bit further (output):

Jupyter environment detected. Enabling Open3D WebVisualizer.
[Open3D INFO] WebRTC GUI backend enabled.
[Open3D INFO] WebRTCWindowSystem: HTTP handshake server disabled.
Reading pointcloud.las...

  • Classification value is not provided. Reading all points...
  • Reading RGB values...
    File reading is completed in 0.25 seconds. The point cloud contains 3402226 points.

Applying CSF algorithm...
[0] Configuring terrain...
[0] Configuring cloth...
[0] - width: 1839 height: 1178
[0] Rasterizing...
[0] Simulating...
CSF algorithm is completed in 72.92 seconds. The filtered non-ground cloud contains 3402226 points.

  • Generating raster image...
  • Saving raster image...
  • Applying segment-geospatial to raster image...
  • Saving segmented image...
  • Generating segment IDs...
    Segmentation is completed in 292.80 seconds. Number of instances: 96

Writing the segmented point cloud to segmented.las...
Writing is completed in 1.33 seconds.

Was this the expected output ?