donydchen / mvsplat

🌊 [ECCV'24] MVSplat: Efficient 3D Gaussian Splatting from Sparse Multi-View Images
https://donydchen.github.io/mvsplat
Other
498 stars 22 forks source link

why fix the fx and fy when center-crop the image patch in the code? #35

Open Miaosheng1 opened 4 weeks ago

Miaosheng1 commented 4 weeks ago

hello. when you apply center-crop for the image, I think you should fix the cx and cy for the image intrinsics. But in your implementation, you fix the fx and fy. Is this your implementation bug? https://github.com/donydchen/mvsplat/blob/378ff818c0151719bbc052ac2797a2c769766320/src/dataset/shims/patch_shim.py#L15-L21

donydchen commented 4 weeks ago

Hi @Miaosheng1, typically, when applying center-cropping, one should update cx and cy in the unnormalized camera intrinsics. However, the difference in our implementation is caused by the fact that our code uses normalized camera intrinsics (https://github.com/donydchen/mvsplat/issues/28).

You can derive the operation by first unnormalizing and then normalizing using the new width and height. For example, when applying center cropping, the new normalized focal length of x is (fx / old_w) * old_w / new_w = fx / new_w, so we update it by multiplying with old_w / new_w. While the new normalized principle point of x is (cx / old_w) * old_w * (new_w / old_w) / new_w = cx / old_w, which is the same as the old normalized one.

Miaosheng1 commented 4 weeks ago

Thank you for your clear and kind response.