tudelft3d / City3D

Large-scale LoD2 Building Reconstruction from Airborne LiDAR Point Clouds
https://github.com/tudelft3d/City3D
GNU General Public License v3.0
223 stars 36 forks source link

Point cloud size limitation #13

Closed wimdes5 closed 1 year ago

wimdes5 commented 1 year ago

It seems the limit that can be segmented is a 1M points file (1024^2), on larger files the application crashes without error. This happens both on systems with 16 and 32GB of ram (GUI application on Windows) Is there a way to segment larger files?

yidahuang commented 1 year ago

Hi, thanks for your feedback, can you share the data you tested? You can also use CLI_Example1 to run your data without GUI.

wimdes5 commented 1 year ago

file1.zip file2.zip

File1 segments ok, file2 is slightly larger and fails. Both are the same but file1 is slightly more cropped. Source = geopunt.be DHMVII

I'm not sure what is the best way to use CLI, it doesn't seem to accept arguments? When I drop the .ply files in building_instances, CLI_Example2 also properly processes file1, crashes on file2

LiangliangNan commented 1 year ago

file1.zip file2.zip

File1 segments ok, file2 is slightly larger and fails. Both are the same but file1 is slightly more cropped. Source = geopunt.be DHMVII

I'm not sure what is the best way to use CLI, it doesn't seem to accept arguments? When I drop the .ply files in building_instances, CLI_Example2 also properly processes file1, crashes on file2

Dropping a file won't work. As you can see from the source code here: https://github.com/tudelft3d/City3D/blob/main/code/CLI_Example_1/main.cpp the file names are hard-coded in the code. So you will have to modify the code to run it on your data.

wimdes5 commented 1 year ago

The problem is during footprint generation, I now realized footprint doesn't look correct, just 1 large rectangle the size of the points tile, this looks the same both in GUI and CLI. So segmentation does not really happen.

When I put files in the building_instances folder CLI_2 does find *.ply, starts generating footprint & the next steps, but on larger files it crashes before the footprint file appears (on smaller files it would hang during reconstruction)

Also on the included data footprint generation doesn't work. Using the included footprints everything works, including reconstruction.

Another example (smaller file) with bad footprint: file3.zip

yidahuang commented 1 year ago

To use CLI_2, you need to provide the individual buidling instances, not the full scan of the urban scene, the same case with #8 . In overall, currently, if you want to run our code with your data, Example_1: use both point cloud and accurate footprint as input. Example_2: use the the point clouds of pre-segmented buildings as input. The individual buildings should be segmented and each building is stored as a separate point cloud file.

wimdes5 commented 1 year ago

Footprint generation & segmenting is not supposed to be working in GUI either?

yidahuang commented 1 year ago

It works, but you need to provide demanded input. GUI is just used to visualize the data, the basic method part is the same as the command line mode. So, if no footprint provided, you need to extract the point clouds of individual buildings from the raw data.

wimdes5 commented 1 year ago

Ok thank you for clarifying this. What way would you recommend to create footprints, to avoid manual building extraction?

yidahuang commented 1 year ago

Creating footprints and building instance extraction are actually two different tasks. It depends on the data you have.

For footprint generation, if you also have aerial images of the urban scene, it's possible to use some deep learning or geometry optimization methods to get the contours, like, Li M, Lafarge F, Marlet R. Approximating shapes in images with low-complexity polygons[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2020: 8633-8641.

For building instance segmentation, you can also use some existing deep learning or geometry optimization methods, like, Zhang Y, Yang W, Liu X, et al. Unsupervised building instance segmentation of airborne LiDAR point clouds for parallel reconstruction analysis[J]. Remote Sensing, 2021, 13(6): 1136.

You can also look into the CGAL GIS to find some useful packages.

wimdes5 commented 1 year ago

We do have building footprints available in Belgium as shapefiles (and .kml) but I cannot convert them into .obj (or .geojson) files that City3D will process as expected. Same issue when creating footprints using Lasboundary. Any advice here would be greatly appreciated!

hugoledoux commented 1 year ago

with .shp files you can use qgis.org to convert: open them, and then you can right-click on a layer and save as and choose geojson

wimdes5 commented 1 year ago

That works better indeed, but still not all the way. Point cloud segmentation & roof extraction look good, but reconstruction fails with: - Warning: encountered 2 non-simple foot print polygons. Also when opening the .geojson there's always a warning: - Warning: I can handle only simple GeoJSON format!

What is the exact format needed from the geojson? I tried opening, editing & saving the .geojson in Mapple, with same result. City3D likes .obj exported from Mapple even less.

test files: 2huizen.zip