Ask Your Question

Revision history [back]

Hi, I'm trying to attempt voxel carving as well and I have the same problem as you described! I have based my code on the same source (https://github.com/subokita/Sandbox/tree/master/VoxelCarving/VoxelCarving and http://nghiaho.com/?p=2124).

After 19 carves, i get something like this: image description

The reprojection should work, since it projects a given 3D coordinate downto 2D space/image, and your projection matrix looks OK but that all depends on the intrinsic and extrinsic properties of your camera. Otherwise the code for the projection should be OK!

I'm not sure, but I suspect the problem could based on the "vector<double> depths"? However I haven't been able to figure out how :( The depths values comes from the scaling factor in the projection, which should be included when creating the visualization of the voxels..

Have you, or anybody, solved this problem or have any ideas?