danielTobon43 / iTree3DMap

3D Mapping of a tree for dendrometric feature estimation

Home Page:https://raw.githubusercontent.com/danielTobon43/iTree3DMap/master/example/tree.jpg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

3D Dendrometric feature estimation of an individual tree with OpenMVG-PMVS2

*Note:* This project is a photogrammetric system for dendrometric feature estimation of individual trees. The purpose of this project is to do a 3D reconstruction of an individual tree using Open Multiple View Geometry (openMVG) and get dendrometry estimation (diameter at breast height (DBH), tree crown height, total tree height, crown volume, morphic factor and percentage canopy missing) of a stem tree. For that, were used OpenMVG and PMVS for 3D Mapping, a circular pattern for scale factor estimation, PCL Library and DBScan for segmentation and Euclidean distance for dendrometric feature estimation.


Example



Build cmake

To build use CMake minimum required 3.5.1 : https://github.com/Kitware/CMake or:

$ sudo apt-get install cmake && cmake-gui && openssl && git -> This install cmake-3.5.1

PCD files

Ground Truth Data

Dependencies

  • Eigen3: http://eigen.tuxfamily.org/index.php?title=Main_Page

  • Glut (OpenGL):

      $ sudo apt-get install libglu1-mesa-dev
      $ sudo apt-get install freeglut3-dev
      $ sudo apt-get install mesa-common-dev
      
      if(OpenGL not found):
       OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
      	 OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLX.so
       OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so
    
  • Blas and Lapack:

      $ sudo apt-get install liblapack-dev && libblas-dev 
      $ sudo apt-get install libgoogle-glog-dev
    
  • OpenBLAS:

      $ sudo apt-get install libopenblas-dev
    
  • Boost:

      $ sudo apt-get install libboost-all-dev
    
  • Cereal:

      $ sudo apt-get install gcc-multilib g++-multilib
      $ Download the source code, compile and install: https://github.com/USCiLab/cereal
    
  • Flann:

      $ sudo apt-get install liblz4-dev
      $ sudo apt-get install libhdf5-dev
      $ sudo apt-get install libgtest-dev  
      (for gtest)
      
      cd /usr/src/gtest
      sudo cmake CMakeLists.txt
      sudo make
      cd /usr/src/gtest/lib
      sudo cp *.a /usr/lib
      create a gtest folder in usr/local/lib
      sudo ln -s /usr/lib/libgtest.a /usr/local/lib/gtest/libgtest.a
      sudo ln -s /usr/lib/libgtest_main.a /usr/local/lib/gtest/libgtest_main.a
      
      Edit CMakeLists.txt on flann/src/cpp/CMakeLists.txt and replace:
      add_library(flann_cpp SHARED "") -> add_library(flann_cpp SHARED "main.cpp")
      Create a main.cpp file at the samen directory
      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")		
      
      
      $ https://github.com/mariusmuja/flann -> compile and install
    
  • TinyXML2: https://github.com/leethomason/tinyxml2 -> compile and install

  • GTK2.0:

      $ sudo apt-get install libgtk2.0-dev
    
  • GTK 3.0:

      $ sudo apt-get install build-essential libgtk-3-dev
    
  • QT creator:

      $ sudo apt-get install qtcreator
    
      $ sudo apt-get install git build-essential qt5-default qtscript5-dev libssl-dev qttools5-dev qttools5-dev-tools 
        qtmultimedia5-dev libqt5svg5-dev libqt5webkit5-dev libsdl2-dev libasound2 libxmu-dev libxi-dev freeglut3-dev 
        libasound2-dev libjack-jackd2-dev libxrandr-dev libqt5xmlpatterns5-dev libqt5xmlpatterns5
        libqt5xmlpatterns5-private-dev
    
  • VTK:

      $ sudo apt-get install libxt-dev 
      $ sudo apt-get install xorg 
      $ sudo apt-get install qhull-bin
      $ sudo apt-get install libqhull-dev
      $ sudo apt-get install libxt-dev 
      https://github.com/Kitware/VTK
    
  • OpenMVG:https://github.com/openMVG/openMVG

  • CMVS-PMVS: https://github.com/pmoulon/CMVS-PMVS

Prerequisite (just compiled)

For this project it is necessary to have compiled the following libraries (it is not necessary to have installed):

Note: Just set the path to the build directory of each library in the principal CMakeList.txt

How to make

This project depends of openMVG, PCL, OpenCV, Qt and CMVS-PMVS, please compile the dependencies before.

  • Download the src code and Unpack .zip

/src:

iTree3DMap - include
	   - libraries
	   - src
	   - CMakeLists.txt
	   - main.cpp
  • Once OpenMVG was compiled, just set the path build directory in the CMakeList.txt
  • Edit the "SfM_SequentialPipeline.py" file in the project build directorie (ItreeMapper_Build) with your own OpenMVG path directorie.
  • If pmvs2 binary file is not working, download and compile the cmvs-pmvs library and replace the pmvs2 bin to /libraries folder of the package

Within build folder, compile with cmake:

cmake ../
make

Test

cd /build/bin
./itree_3dmap		

Note:

Just for OpenMVG compilation: If OpenMVG compiled without error and is not working; compile OpenMVG with this line:

cmake -DTARGET_ARCHITECTURE=generic ../src/

Extra packages:

About

3D Mapping of a tree for dendrometric feature estimation

https://raw.githubusercontent.com/danielTobon43/iTree3DMap/master/example/tree.jpg

License:GNU General Public License v3.0


Languages

Language:C++ 90.1%Language:CMake 7.2%Language:Python 2.7%