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

Parameter tuning and validation #36

Closed QiaosiLi closed 4 months ago

QiaosiLi commented 4 months ago

Thanks for providing code and support on this work but sorry to trouble you.

  1. We use City3D and our airborne LiDAR data to construct the building LOD2 model. The point density of raw data ranges from 40-90 pt/m2. We conducted point cloud classification and generated the building footprint by ourselves. For small and simple structure building, we can acquire fine model with default parameter setting. For large buildings, I referred to the previous issues to tune parameters, but it still took very long time to return the result. I attached the point cloud (33707pts), footprint (1221m2), and result of a large building in a zip file as example 3515.zip The parameters were set as below: Reconstruction.cpp: int low_threshold = (3.0) 255 / (max_height - ht); or int low_threshold = (4.0) 255 / (max_height - ht); point_set_region_growing.cpp: const FT max_distance_to_plane = FT(15) / FT(100); const FT max_accepted_angle = FT(20);

If we try it in GUI, I set also number as 80 or 100, density is 0.3. We usually use command-line program in loop but I am not sure how to set number and density in code. It took nearly one day to construct the building. As shown below, I found there are too many faces in the model. image

I think our data is similar to DALES dataset you used in the experiment, could you share with us the parameter used for large building modelling in DALES data? Alternatively, do you have any suggestions for our case as we have plenty of such large buildings?

  1. We also would like to validate LOD2 model with lidar data. You have mentioned the validation process in the paper, and I am wondering if the validation code is available for us to use. Many thanks
LiangliangNan commented 4 months ago

I agree that your data might be similar to DALES, but the same parameters may still not apply. The complexity/runtime depends on the number of planes extracted from the point cloud. For the case in your snapshot, the building is more complex than most of the buildings in DALES. It takes very long to complete because (1) the building has complex structures; (2) there are many unnecessary planes extracted from the point cloud, e.g., some detailed structures.

It is hard to tell which parameter setting is best for you. But the general idea for improving the efficiency is to reduce the number of extracted planes (thus the number of variables in the optimization problem will be greatly reduced). This could be achieved by the following strategies:

QiaosiLi commented 4 months ago

Thank you very much for your reply. I think the 3 strategies make sense. I did read your paper closely to understand the framework of city3D, however, as I am not an expert or developer in CV and C++, it is a bit difficult to figure out how to use more demanding conditions for region growing, and what are the other parameters that can avoid detecting unnecessary minor/smaller planes. Could you suggest the specific file and parameters we can tune in your code, such as issue 4 and issue 18 replied by @yidahuang Thanks again.

LiangliangNan commented 4 months ago

First, grab the new code (I've removed some unnecessary parameters).

Some parameters are hard-coded in the City3D code in different files. The most important one controls the number of points per planar region, which can be found here. You can increase it to keep planes having numbers of points larger than the specified number. Internally the "detect(...)" function calls CGAL::Shape_detection::Region_growing::detect(...).

Some other related parameters are related to CGAL functions, which can be tuned here. These parameters are explained in the CGAL documentation.

LiangliangNan commented 4 months ago

Update: I indeed fixed a bug that may cause an infinite loop. cc0edd50f040dc86cf983ac599db0d2 The algorithm still tried to extract roofs even if the min_support had already been decreased to 0.

QiaosiLi commented 4 months ago

Thanks a lot for the help and update. We get some problems in installing dependencies and city3d in windows with VS2022. I guess the VS2022 doesn't connect to vcpkg as the same way before, so I still stick with the previous code and gcal version. Just would like to share some parameter tuning results. Here is the building points: image

Here are the parameters I used to test the same building. Method_global.cpp: double number_region_growing = 80 point_set_region_growing.cpp: const FT search_sphere_radius = FT(50) / FT(100); const FT max_distance_to_plane = FT(15) / FT(100); const FT max_accepted_angle = FT(20);

The output model has fewer faces (but still a lot of faces) and can keep the main feature of the rooftop. But the parameter won’t always work for other large buildings, so still need to try different parameters. 3515_change1

Method_global.cpp: double number_region_growing = 120 point_set_region_growing.cpp: const FT search_sphere_radius = FT(25) / FT(100); const FT max_distance_to_plane = FT(15) / FT(100); const FT max_accepted_angle = FT(20); Fewer faces but lose features of rooftop

3515_change2

LiangliangNan commented 4 months ago

The result already looks quite good (some parts are hard to observe due to the per-face coloring). To explore for better parameters, it is worth to further look into the individual planar regions to better understand the effect of each parameter (and tests these using a variety of buildings of different styles). But anyway, it is still remains unknown what the optimal parameters are that work well for all models. One can always find an example to fail an reconstruction algorithm.

We've never tested our code with vckpkg.

LiangliangNan commented 4 months ago

I believe this issue can be closed. Please feel free to post followup questions.