Giter Site home page Giter Site logo

tudelft3d / adtree Goto Github PK

View Code? Open in Web Editor NEW
166.0 19.0 34.0 9.05 MB

Accurate, detailed, and automatic modelling of laser-scanned trees

License: GNU General Public License v3.0

CMake 4.35% C++ 76.25% GLSL 19.41%
point-clouds tree laser-scanning laser-scans urban-environment forestry 3d-model reconstruction modeling

adtree's Introduction




AdTree implements the tree reconstruction method described in the following paper:

Shenglan Du, Roderik Lindenbergh, Hugo Ledoux, Jantien Stoter, and Liangliang Nan.
AdTree: Accurate, Detailed, and Automatic Modelling of Laser-Scanned Trees.
Remote Sensing. 2019, 11(18), 2074.

3D tree models reconstructed from point clouds

Build and Run AdTree

Prebuilt executables (for macOS, Linux, and Windows) can be downloaded here.

AdTree depends on some third-party libraries and most dependencies are included in the distribution except Boost. So you will need to have Boost installed first.

Note: AdTree uses a stripped earlier version of Easy3D, which is not compatible with the latest version.

You need CMake and of course a compiler to build AdTree:

  • CMake >= 3.1
  • a compiler that supports >= C++11

AdTree has been tested on macOS (Xcode >= 8), Windows (MSVC >=2015), and Linux (GCC >= 4.8, Clang >= 3.3). Machines nowadays typically provide higher support, so you should be able to build AdTree on almost all platforms.

There are many options to build AdTree. Choose one of the following (or whatever you are familiar with):

  • Option 1: Use any IDE that can directly handle CMakeLists files to open the CMakeLists.txt in the root directory of AdTree. Then you should have obtained a usable project and just build. I recommend using CLion or QtCreator. For Windows users: your IDE must be set for x64.

  • Option 2: Use CMake to generate project files for your IDE. Then load the project to your IDE and build. For Windows users: your IDE must be set for x64.

  • Option 3: Use CMake to generate Makefiles and then build (purely command line).

    • on Linux or macOS:
      $ cd path-to-root-dir-of-AdTree 
      $ mkdir Release
      $ cd Release
      $ cmake -DCMAKE_BUILD_TYPE=Release ..
      $ make
      
    • on Windows with Microsoft Visual Studio, use the x64 Native Tools Command Prompt for VS XXXX (don't use the x86 one), then
      $ cd path-to-root-dir-of-AdTree 
      $ mkdir Release
      $ cd Release
      $ cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release ..
      $ nmake
      

Don't have any experience with C/C++ programming? Have a look at How to build AdTree step by step.

After obtaining the executable, AdTree can be run in three modes, which can be selected based on arguments.

  • GUI mode. It provides a user interface with menus. You can double-click the app or run it from the commandline

    ./AdTree
    
  • Commandline single processing mode (i.e., processing a single point cloud file).

    ./AdTree  <xyz_file_path>  <output_directory>  [-s|-skeleton]
    
    • <xyz_file_path>: a mandatory argument specifying the path to the input point cloud file
    • <output_directory>: a mandatory argument specifying where to save the results
    • [-s] or [-skeleton]: also export the skeletons (omit this argument it if you don't need skeletons)
  • Commandline batch processing mode (i.e., all *.xyz files in an input directory will be processed).

    ./AdTree  <xyz_files_directory>  <output_directory>  [-s|-skeleton]
    
    • <xyz_files_directory>: a mandatory argument specifying the directory containing the input point cloud files
    • <output_directory>: a mandatory argument specifying where to save the results
    • [-s] or [-skeleton]: also export the skeletons (omit this argument it if you don't need skeletons)


Data

Some test tree point clouds are provided in the 'data' folder.

Note: When testing on your point clouds, please make sure that:

  • your point cloud represents a single tree (i.e., the tree is segmented out from the background; no ground, no fence...);
  • the tree has an upright orientation (i.e., with Z-axis pointing up).

About the output

AdTree outputs 3D models of the reconstructed branches (and also leaves) as triangle meshes in the OBJ format.

It also supports to output the reconstructed skeletons as generalized cylinders (i.e., the two endpoints of an edge have different radii) in the PLY format. In this format, each branch is represented by a sequence of generalized cylinders, and each vertex is associated with a `radius' property. Please note that most tools (like CloudCompare and MeshLab) do not support this format. You can use Mapple (or one of the example viewers in Easy3D) to visualize the exported skeletons (see an example visualization here).


Citation

If you use the code/program (or part) of AdTree in scientific work, please cite our paper:

@article{du2019adtree,
  title={AdTree: Accurate, detailed, and automatic modelling of laser-scanned trees},
  author={Du, Shenglan and Lindenbergh, Roderik and Ledoux, Hugo and Stoter, Jantien and Nan, Liangliang},
  journal={Remote Sensing},
  volume={11},
  number={18},
  pages={2074},
  year={2019}
}

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License or (at your option) any later version. The full text of the license can be found in the accompanying LICENSE file.


Should you have any questions, comments, or suggestions, please contact us at [email protected]

3D Geoinformation Research Group, TU Delft,

https://3d.bk.tudelft.nl,

Dec. 1, 2019

adtree's People

Contributors

liangliangnan avatar shenglandu avatar tofull avatar zexinyang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adtree's Issues

编译报错

您好!

我在Windows10 vscode 下编译代码出现错误:
Snipaste_2024-02-01_17-13-10

请问如何解决

Prebuild Usecase

Hello,

first of all thank you for providing your software.
Since I unfortunately have no idea of programming, but still would like to try your application, a question:

Since you provided a prebuild for version 1.1.0, can I just run it like a normal application on Windows? Could I thus process a point cloud and transfer it as a 3D object for further processing in e.g. Rhino3D?

For version 1.1.1 you have only provided the source code. Unfortunately I have absolutely no idea how I could build this manually (despite instructions).

Would version 1.1.0 be sufficient for my purposes to use trees as 3D objects for further processing in Rhino 3D, or are programming skills required even here?
And what kind of point cloud data is reqired for AdTree?

Greetings,
Ludwig

Support export manifold mesh

Thanks a lot for making such a good tool to extract the tree skeleton and mesh, it works perfect on our data.

But when analyzing the mesh, I found there are several inner and intersections among each branches. This is not convenicence for the Volume calculation.

I have tried several tools like Blender and CloudCompare to fixing this "non-manifold" problem but failed. I am wondering if it can be fixed at the data source, whether AdTree can export the clean up meshes directly.

PS: the manifold mesh means, the mesh model only has the skin surface without holes or any faces inside the object.

Chinese cannot be displayed

Hello!

Firstly, I would like to express my sincere apologies for not responding to you in a timely manner due to personal reasons recently.
The code and running results that were not displayed last time are as follows:

pic1
pic2
I have modified the code according to your suggestion. The font has been changed but still cannot display Chinese. Could you please give me some more suggestions? Thank you very much!

change the leaves

Thanks to the author for sharing this software, which is very useful. Right now, it seems all the trees use the same type of leaf. I am wondering if the author can add the feature to change the leaves, e.g., the density of the leaves, the shape of the leaves etc.

compile error

when i use cmake to generate this project i get this:
In file included from /home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/viewer/viewer.cpp:62:0:
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h: In lambda function:
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h:192:37: error: parameter packs not expanded with ‘...’:
func(std::forward(args)...);
^
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h:192:37: note: ‘args’
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h: In lambda function:
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h:206:68: error: parameter packs not expanded with ‘...’:
auto f = std::bind(func, owner, std::forward(args)...);
^
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h:206:68: note: ‘args’
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h: In lambda function:
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h:221:37: error: parameter packs not expanded with ‘...’:
func(std::forward(args)...);
^
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h:221:37: note: ‘args’
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h: In lambda function:
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h:238:64: error: parameter packs not expanded with ‘...’:
auto f = std::bind(func, owner, std::forward(args)...);
^
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h:238:64: note: ‘args’
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h: In lambda function:
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h:254:41: error: parameter packs not expanded with ‘...’:
func(std::forward(args)...);
^
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h:254:41: note: ‘args’
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h: In lambda function:
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h:273:68: error: parameter packs not expanded with ‘...’:
auto f = std::bind(func, owner, std::forward(args)...);
^
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h:273:68: note: ‘args’
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h: In instantiation of ‘struct easy3d::Timer::single_shot(int, Function&&, Args&& ...) [with Function = easy3d::Viewer::mouse_press_event(int, int, int, int)::__lambda16; Args = {}]::__lambda0’:
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h:193:10: required from ‘static void easy3d::Timer::single_shot(int, Function&&, Args&& ...) [with Function = easy3d::Viewer::mouse_press_event(int, int, int, int)::__lambda16; Args = {}]’
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/viewer/viewer.cpp:515:18: required from here
/home/rthpc/anaconda3/envs/code/ADTree/3rd_party/easy3d/util/timer.h:192:37: error: using invalid field ‘easy3d::Timer::single_shot(int, Function&&, Args&& ...)::__lambda0::__args’
func(std::forward(args)...);
^
make[2]: *** [3rd_party/easy3d/viewer/CMakeFiles/viewer.dir/viewer.cpp.o] 错误 1
make[1]: *** [3rd_party/easy3d/viewer/CMakeFiles/viewer.dir/all] 错误 2
make: *** [all] 错误 2

could you tell me how to fix it? thank you :)

Airborne point clouds

Hello, please may I know if I can use AdTree to model airborne point clouds (vegetation) or do I need to have a terrestrial point cloud? Thank you in advance.

Cannot Open Input File

Hello,
I have a problem when I run the project with Microsoft Visual Studio 2019,it shows that cannot open input file "3rd_imgui.lib". But I don't find any ".lib" file in the project.
could you tell me how to fix it? thank you!

How to add leaves model?

Hello,
If I want to add a ply/obj file as the leaves model, which part of codes should I modify?
Thank you!

How to build AdTree using CMake?

Hello,
I'm sorry I forgot to upload the picture last week.
First, I configured and generated the project with cmake-gui, as shown in the picture named "cmake". Then I opened the project and ran it with VS2019. As a result I got a problem, it showed that cannot open input file "3rd_imgui.lib", as shown in the picture named "problem". And I didn't modify the linker's additional library directory in the project properties because I didn't find any “.libs” files.
could you tell me how to fix it? thank you!
cmake
problem

Code running problems in WLS

Hi Liang,

Let you after I successfully compailed Adtree in my window linux subsystem, I run the code as you mentioned in the read.me file.

I get the error like this, do you know any solutions for this problem?
error

best,
Tao

void TreeViewer::export_skeleton()

hi, the software was very good for extracting skeleton from point cloud.
Is there anyway to export the skeleton result?

The void TreeViewer::export_skeleton() , const std::string& initial_name = file_system::base_name(cloud()->name()) + "_skeleton.ply"
only return and write a down sampled point cloud, is it possible to get a connected graph output?

Unable to run the prebuilt windows Adtree.exe v1.12

image
image

Hi.

I'm really amazed by what your program can do, however i can't seem to get the (prebuilt) Adtree.exe (v1.12 for windows) to work.
I've tried to install the VC-redist.x64.exe but i get an error message saying i'v allready got a newer version installed.

Any idea's to what i can try to make the prebuilt exe work?

Kind regards,
Robin

Input file

Dear Developers.
I have my own skeleton file and information about the diameters at different locations, and I would like to use this software to generate him as a tree without leaves. In fact, I am trying to develop an airway model, which is actually very much like a tree. I have calculated its skeleton and its width at different locations. But I am not very good at programming and I need your help.
image
All the best,
GuoWeiqi

Chinese cannot be displayed

Hello!

The code in the picture comes from the file "viewer_imgui.cpp". I tried to modify the content in Text to Chinese, but what was displayed “?”, Chinese cannot be displayed. Can you provide me with a solution? Thank you!
picture

How to get edge information?

This is just a question, not exactly an issue. The linux executable is great, and ran immediately. When I look at the saved skeleton output though, it appears to be a pointcloud only (image below). One of the important parts of a skeleton is the connectivity information between various points. Is it possible to view/access that connectivity information somehow?

Here's the tree I'm starting with:

Screenshot from 2023-01-29 17-46-11

And the resulting ply file from "Export skeleton" visualized in CloudCompare:

Screenshot from 2023-01-29 17-49-32

Output list of cylinder fits with cylinder dimensions and connectivity

Hello, I am interested in analyzing the fine-scale structure of tree branches with your application. However, there is no way to extract individual cylinders from the output model. All of the cylinders are fused together as a giant mesh. Is there a way to break apart the mesh, or add a flag to export all the cylinders in a row-based format like .csv? Thanks in advance, the outputs of your application are impressive and I'm interested in analyzing trees using it

Error in density calculation.

In skeleton.cpp on line 837:

dendiff = abs(currentDensity - ptDensity);

Shouldn't this be:

dendiff += abs(currentDensity - ptDensity);

As with the current implementation you are only look at the density of the point last iterated in the loop, rather than the neighborhood average?
Or is my understanding of the code wrong?

Cheers,
Harry

Batch Skeleton Export [Feature Request]

Hi there,

The batch processing is very useful - thanks for adding. I was just wondering would it be possible that this could also support the exporting of the skeletons? Rather than just the meshes?

Cheers,
Harry

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.