JingwenWang95 / KinectFusion

KinectFusion implemented in Python with PyTorch
MIT License
182 stars 23 forks source link

Ray Cast details #3

Closed MisEty closed 1 year ago

MisEty commented 1 year ago

Hello! I also try to implement KinectFusion on python and I notice that there are some differents in your code compared with paper:

  1. In render_model function, the predicted surface points are: hit_pts = ray_pts_w[hs, ws, indices][hit_surface_mask]. But in the paper, the points are defined by bi-interpolate on the ray
  2. Also, the normals are computed by nearest-nerghor search on raw TSDF volume. But in the paper, the points are defined by tri-interpolate on global frame.

Could you help me out this problem? Thanks

JingwenWang95 commented 1 year ago

Hi @MisEty, thanks for your interest! I will try to answer your questions:

  1. So here I just used the simplest way of finding the intersection point. I think you can try more sophisticated ways like in the paper. I can't remember exactly why I did it this way as I have written this repo a yea ago... But given that the number of samples along the ray is so big compared with the near and far bound, I guess the simplest method should work for most cases.
  2. For the normals, I can't remember exactly why I didn't do tri-linear interpolation (It seems that I also implemented the trilinear interploation but didnt use it). Maybe I tried it but it didn't bring too much improvement. But you can try that as well.

So these are basically just design choices I made when I wrote the code and are very flexible and largely personal. I can't remember many of those implementation details as it's been a year since I wrote this repo and I didn't thouroughly test all the possible combinationds of settings as this repo is mainly for studying purpose. So just feel free to play with different settings and let me know if you have some more intersting discoveries.

Best Jingwen

MisEty commented 1 year ago

Thanks for your quickly help! I will try more differnet settings according to the paper.