Voxel Carving


Here’s an example of voxel carving to create 3D point cloud from a set of photographs.

Based on Nghia Ho’s implementation of voxel carving [1] , I decided to port the voxel carving code, so that I can test out whether my three.cpp could show point cloud correctly.

The 3D photography dataset is obtained from [2], it provides photographs of a model from numerous point of views, along with camera projection matrices and other intrinsic parameters.

Basically we start by initialising a 3D voxel grids, and start carving by checking if the projected pixels from each camera viewpoint is valid, if it’s valid, we store it, else discard it. Repeat for the entire image set, and the program will output a PLY model file, which you can use a 3D viewer to show the point cloud.

I used my own three.cpp as the viewer.

You can check out the code for Voxel Carving in C++ and OpenCV here: https://github.com/subokita/Sandbox/tree/master/VoxelCarving/VoxelCarving

And the code for my three.cpp viewer can be seen here: https://github.com/subokita/Three.cpp-Rev-2/blob/master/Three.cpp%20Rev.2/examples/Ex_007_PointCloudTest.cpp

[1] http://nghiaho.com/?p=2124

[2] http://www.cs.wustl.edu/~furukawa/research/mview/index.html


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s