Coder Social home page Coder Social logo

unclearness / vacancy Goto Github PK

View Code? Open in Web Editor NEW
60.0 2.0 10.0 423 KB

Vacancy: A Voxel Carving implementation in C++

License: BSD 3-Clause "New" or "Revised" License

CMake 3.95% C++ 95.80% Batchfile 0.25%
3d-reconstruction computer-vision shape-from-silhouette c-plus-plus marching-cubes

vacancy's Introduction

Vacancy: A Voxel Carving implementation in C++

Vacancy is a Voxel Carving (a.k.a. Visual Hull or Shape from Silhouette) implementaion in C++. Inputs are 2D silhouettes (binary mask) of target objects, corresponding camera parameters (both intrinsic and extrinsic) and 3D bounding box to roughly specify the position of the objects. Output is the reconstructed 3D model. In addition to naive one, supports KinectFusion like robust TSDF (Truncated Signed Distance Function) fusion.

Algorithm Overview

  • Initialize 3D voxels according to the input bounding box
  • Compute SDF (Signed Distance Function/Field) from silhouette in 2D
  • Volmetrically fuse 2D SDF values into the 3D voxels by using camera parameters
  • Extract explicit 3D mesh from implicit surface representation in the 3D voxels

Output mesh

Two mesh extraction methods are implemented: voxel and marching cubes. Marching cubes are much better in practice while voxel representation is suitable to understand how the algorithm works.

voxel marching cubes

Build

To build sample bunny executable, use cmake with CMakeLists.txt in the top directory. You can integrate Vacancy to your own projects as static library by cmake add_subdirectory() command.

Dependencies

Mandatory

Optional (can be disabled by cmake)

vacancy's People

Contributors

decrispell avatar example123 avatar unclearness 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

Watchers

 avatar  avatar

vacancy's Issues

Unable to compile with VACANCY_USE_STB_AS_STATIC_LIB=ON

Hello,

Thanks for the nice library!

I'm trying to compile with VACANCY_USE_STB_AS_STATIC_LIB=ON but no luck.

Steps to reproduce:

git clone https://github.com/unclearness/vacancy.git
cd vacancy
git submodule init
git submodule update
mkdir build
cd build
cmake .. -DVACANCY_USE_OPENMP=OFF -DVACANCY_USE_STB_AS_STATIC_LIB=ON
make

Error:

...

examples.cc:(.text.startup+0x35d): undefined reference to `stbi_write_png'
examples.cc:(.text.startup+0xbff): undefined reference to `stbi_load'

...

Environment:

  1. Ubuntu 18.04
  2. cmake version 3.10.2
  3. GNU Make 4.1
  4. gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0

PS

I temporarily fixed it by changing this

if (VACANCY_USE_STB)
  target_compile_definitions(${PUBLIC_LIB_NAME} PUBLIC -DVACANCY_USE_STB)
endif()

to this

if (VACANCY_USE_STB)
  target_compile_definitions(${STB_LIB_NAME} PUBLIC -DVACANCY_USE_STB)
  target_include_directories(${STB_LIB_NAME} PUBLIC third_party)
endif()

but not sure how correct it is.

Issue with getting results

Hello,
Could I get some help with an SDF issue? I'm new to the field but I'm trying to use my own data set, I can get SDF maps similar to the demo, but I'm unable to get passed that. All my "voxel.sdf" values are above 0 and get skipped over in the "ExtractVoxel" function in "extract_voxel.cc". What in my dataset could I do to avoid
mask_00001
sdf_00001
@unclearness

Thank you in advance!

bounding box

Hi,
Thank your hard work.
Is there a way to pre-compute the bounding box? If yes, how?
Thank you

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.