/voxel-carving

Voxel carving of Middlebury stereo 'Temple' dataset in Python with Open3D

Primary LanguagePython

Voxel Carving with Open3D in Python

Data

Plaster reproduction of Temple of the Dioskouroi from Middlebury Multi-View Stereo Dataset (312 views sampled on a hemisphere) (https://vision.middlebury.edu/mview/data/)

Images captured on a Stanford Spherical Gantry (http://graphics.stanford.edu/projects/gantry/) and camera intrinsic and extrinsic matricies accompany each shot.

Camera Calibration Parameters

We are given Matricies K containing info about the x and y focal length of the camera, along with the principal offset (x and y), R the rotation matrix, and t the translation vector along with our images.

Description of Camera Intrinsic Matricies: http://ksimek.github.io/2013/08/13/intrinsic/

Focal Length given by ,

Principal Point Offset given by ,

Description of Camera Extrinsic Matricies: http://ksimek.github.io/2012/08/22/extrinsic/

Rotational Matrix given by - Translational Vector given by

Note: We add a fourth row in our extrinsic matrix to make it a 4x4 matrix. The fourth row corresponds to the 4th row of a 4x4 identity matrix.

Open3D

We use Open3D to create a dense voxel grid using the create_dense function. We set the size of each voxel as follows...

So for us, we used a 2x2x2 cubic voxel dense, the images we were given were 640 x 480. so the size of each voxel was 2/640 = 0.003125.

We also used Open3D to do the carving. To implement the carving we created a silhouette and grabbed the camera parameters for each image, and passed them to the carve_silhouette method.

(Setting Camera Params- http://www.open3d.org/docs/release/python_api/open3d.camera.PinholeCameraParameters.html)

(Creating Voxel Dense and Carving- http://www.open3d.org/docs/0.8.0/python_api/open3d.geometry.VoxelGrid.html)

Finally we use draw_geometries to show the result of voxel carving.

(Displaying- http://www.open3d.org/docs/latest/python_api/open3d.visualization.html)

Note: draw_geometries did not work on Mac with pip install of Open3D, it worked on Debian Linux though.

Results

Alt Text