opencv / opencv_contrib

Repository for OpenCV's extra modules
Apache License 2.0
9.37k stars 5.75k forks source link

dynamic fusion running error! #2521

Open achao2013 opened 4 years ago

achao2013 commented 4 years ago

I run the dynamicfusion code for test, but the program is not excuted rightly, so i rendered the reconstructed 3d points to depth image to check the problem, i find the rendered depth image is strange, only top left conner is rendered rightly.(see left in the follow picture)

if i modify code glViewport(0, 0, params.frameSize.width, params.frameSize.height) to glViewport(0, 0, params.frameSize.width/2, params.frameSize.height/2), the object is rendered fully in the left top conner, but it should be rendered in the hole image.(see right in the follow picture)

image

alalek commented 4 years ago

/cc @savuor

achao2013 commented 4 years ago

I have found the problem. the opencv resizewindow cannot set renderwindow to 640x480, so the default value is set to 320x240. But my data is also failed, the wapfiled cannot be solverd directly, can you provide your offline test data which can reconstruct successfully? In addition, I think the speed is too slow. The opencl speedup is not implemented in the volume intergrate and gaussian-newdon solvers which are the bottleneck. @savuor @alalek

savuor commented 4 years ago

@achao2013 I'm currently working on speed & quality improvement. Sparse solver is going to be used as well as better optimization function. Will debug this and other issues soon.

achao2013 commented 4 years ago

thank you. I seriously hope you can provide your offline test data which can reconstruct successfully using default params . When i read the code carefully , i find marchingcube reconstruct operation in rendersurface. I think it's not resonable because the marchingcubes result will be noisy if the volume is not integrated fully. I think raycast is enough, so i wonder to know the reason. Maybe i can help to debug this code if need. @savuor

savuor commented 4 years ago

@achao2013 Currently optimization function is to be rewritten from scratch. It will use Dual Quaternions Blending as in the original paper instead of SE(3) matrices mixture. Talking of marching cubes usage, we cannot use raycasting because of warp field applied to the TSDF volume data. If we get the depth with raycast() we'll get a 2d set of points which looks like a smooth dense surface - which is what we need for next coming ICP alignment (point-to-plane distance requires such kind of a point set). But after applying the warp field to that set we will also get a set of points which doesn't look like a dense surface, there will be holes, areas of sparsity and some points can occlude each other (which is bad for next coming ICP correspondence matching). By using marching cubes we can get dense surface that remains dense even after applying the warp field. Making a raycast-like dense surface is done by rendering that mesh.

YJonmo commented 3 years ago

Hi there,

When is the dynamic fusion implementation ready?

Thanks

savuor commented 3 years ago

@YJonmo Hi, it's still in progress, but w/o any approximate date