项目作者: scifiswapnil

项目描述 :
Open3d color texture classification
高级语言: C++
项目地址: git://github.com/scifiswapnil/Open3d.git
创建时间: 2020-03-17T15:58:17Z
项目社区:https://github.com/scifiswapnil/Open3d

开源协议:Other

下载




Open3D: A Modern Library for 3D Data Processing


open3d.org |
Documentation |
Quick Start |
Build from Source |
Python API |
C++ API |
Contribute |
Demo |
Forum

Open3D is an open-source library that supports rapid development of software that deals with 3D data. The Open3D frontend exposes a set of carefully selected data structures and algorithms in both C++ and Python. The backend is highly optimized and is set up for parallelization. We welcome contributions from the open-source community.


Home Work Assignments :

  • C++ function open3d::geometry::TriangleMesh::IdenticallyColoredConnectedComponents :heavy_check_mark:
  • Python binding foropen3d.geometry.TriangleMesh.identically_colored_connected_components :heavy_check_mark:
  • “Open3D/examples/Cpp/solution.cpp” :heavy_check_mark:
  • “Open3D/examples/Python/Basic/solution.py” :heavy_check_mark:
  • “results.txt” shall be formatted the same way as specified in the “Example triangle mesh” section :heavy_check_mark:
  • C++ and Python unit tests integrated with Open3D’s unit test system :heavy_check_mark:
  • Document your code, the algorithm used, how to build and run, and etc :heavy_check_mark:

Build steps

  • git clone --recursive https://github.com/scifiswapnil/Open3d-homeWork Open3d
  • cd Open3d
  • dependencies setup
    • for ubuntu : .util/scripts/install-deps-ubuntu.sh
    • for macOS : util/scripts/install-deps-os
  • mkdir build && cd build
  • cmake -DCMAKE_INSTALL_PREFIX=<open3d_install_directory> -DPYTHON_EXECUTABLE=<python_executable_directory> -DPYTHON_LIBRARIES=<python_library_directory> ..
  • make
    • for ubuntu : make-j$(nproc)
    • for macOS : make -j$(sysctl -n hw.physicalcpu)
  • sudo make install
  • For python-pip package use make install-pip-package

Function implementation, bindings and algorithm used

Algorithm used :

  1. - getConnectComponentSearch()
  2. - read the mesh file
  3. - check the size and color of vertices in mesh file
  4. - initialize an array 'visited' of size as same vertices in mesh file and set every element to false
  5. - traverse each element 'v' in the array and do :
  6. - if 'v' is not visited before, call DepthFirstSearchConnectedComponentSearch(v,vertex_color(v))
  7. - sort the results of DFSCCSearch(v,vertex_color(v)) and pushback to result
  8. - return result
  9. - DFSCCSearch(v,vertex_color(v))
  10. - Mark 'v' as visited.
  11. - pusback element to queue
  12. - get the adjacent elements
  13. - visit each adjacent elements and check the color as of root element
  14. - If adjacent elements is not visited, then recursively call DFSCCSearch(v,vertex_color(v))

Example solution usage

  • solution.cpp
    • Usage :
      1. - cd ~/Open3D/build/bin/examples
      2. - ./solution
      3. or
      4. - ./solution <input_mesh_file> <output_result_file>
  • solution.py
    • Usage :
      ```
      • cd ~/Open3D/examples/Python/Basic
      • python solution .py
        or
      • python solution .py

Note :

  • If you directly run the executable without any arguments the code fetchs the test_mesh.ply form ~/Open3d/examples/TestData and writes the results.txt in the same directory.
  • C++ solution code is added to build system, after build use the above steps to run the solution code for cpp and python.

Unit tests

  • C++ unit tests

    • unit tests are added to the build system and can be directly used once built
    • usage ./Open3d/build/bin/unitTests
  • python unit tests

    • usage pytest ~/Open3d/src/UnitTest/Python

Note :

  • C++ and python unit tests are added to the existing build system.
  • You need to set BUILD_UNIT_TESTS flag to true during the cmake for the build system to make the executables

Citation

Please cite our work if you use Open3D.

  1. @article{Zhou2018,
  2. author = {Qian-Yi Zhou and Jaesik Park and Vladlen Koltun},
  3. title = {{Open3D}: {A} Modern Library for {3D} Data Processing},
  4. journal = {arXiv:1801.09847},
  5. year = {2018},
  6. }