graphdeco-inria / gaussian-splatting

Original reference implementation of "3D Gaussian Splatting for Real-Time Radiance Field Rendering"
https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/
Other
14.76k stars 1.93k forks source link

question about getProjectionMatrix #376

Open Torment123 opened 1 year ago

Torment123 commented 1 year ago

Hi, I'm a bit new to multi-view geometry, could someone help me explain the getProjectionMatrix function in graphics_utils.py ? Is it calculating the camera intrinsic matrix? but there is no focal length?

yzslab commented 1 year ago

Hi, here is a detailed explation: http://www.songho.ca/opengl/gl_projectionmatrix.html.

deepshwang commented 1 year ago

Thanks @yzslab for the reference.

However, according to the derivation in the link (which I followed its derivation and think it's right) the P[2, 2] should be z_sign (zfar + znear) / (zfar - znear), whereas the code's implementation is z_sign zfar / (zfar - znear). Any ideas??

grgkopanas commented 1 year ago

Possibly a potential bug have to double check my notes, but if you think about it we never use the normalized z value anywhere in the computations

On Mon, Oct 23, 2023, 09:48 Sungwon Hwang @.***> wrote:

Thanks @yzslab https://github.com/yzslab for the reference.

However, according to the derivation in the link (which I followed its derivation and think it's right) the P[2, 2] should be z_sign (zfar + z_near) / (zfar - znear), whereas the code's implementation is z_sign zfar / (zfar - znear). Any ideas??

— Reply to this email directly, view it on GitHub https://github.com/graphdeco-inria/gaussian-splatting/issues/376#issuecomment-1774613144, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACGXXYIHMPHDJ3LQZ7MRQ2DYAYONLAVCNFSM6AAAAAA6LJXQH6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZUGYYTGMJUGQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ShaohuaL commented 9 months ago

Please refer to https://www.scratchapixel.com/lessons/3d-basic-rendering/perspective-and-orthographic-projection-matrix/building-basic-perspective-projection-matrix.html