facebookresearch / pytorch3d

PyTorch3D is FAIR's library of reusable components for deep learning with 3D data
https://pytorch3d.org/
Other
8.81k stars 1.32k forks source link

Docs for cameras inconsistency with implementation #1543

Open orweiser-code opened 1 year ago

orweiser-code commented 1 year ago

in the cameras.md documentation you specify that the Pytorch3d coord. convention defines the screen space (0,0) as the top left corner of the top left pixel. From what I understand the OpenCV coord. convention defines the (0,0) as the center of the top left pixel (unless i am mistaken here).

This implies that an offset of 0.5 pixels should be applied when converting from one space to the other, however the function pytorch3d.renderer.camera_conversions._cameras_from_opencv_projection does not do this (as far as I can tell).

I think the fix should be adding 0.5 to the principal point before shifting and scaling to ndc.

orweiser-code commented 1 year ago

Any thoughts?

orweiser-code commented 1 year ago

@bottler am i wrong here?