pytorch3d icon indicating copy to clipboard operation
pytorch3d copied to clipboard

PerspectiveCameras principal point

Open classner opened this issue 3 years ago • 1 comments

🐛 Bugs / Unexpected behaviors

Hi team!

Someone just reached out to me concerning unexpected behavior of PerspectiveCameras in conjunction with Pulsar. I tracked this back to here https://github.com/facebookresearch/pytorch3d/blob/1b0584f7bd2bbf0d6a2e5563a8c530d62f2338ba/pytorch3d/renderer/cameras.py#L1266 . The default initialization for PerspectiveCameras uses a principal point of (0., 0.), which, according to the documentation is the xy coordinate of the principal point (and hence places it in the top left corner). Is that intended and shouldn't it be half of image size by default? Could it be that this definition changed during the last year at some point? In any case, the Pulsar unified interface is currently using this value incorrectly in https://github.com/facebookresearch/pytorch3d/blob/1b0584f7bd2bbf0d6a2e5563a8c530d62f2338ba/pytorch3d/renderer/points/pulsar/unified.py#L249 and https://github.com/facebookresearch/pytorch3d/blob/1b0584f7bd2bbf0d6a2e5563a8c530d62f2338ba/pytorch3d/renderer/points/pulsar/unified.py#L323 . I'm happy to make a PR once clarified how it's intended to work.

classner avatar Jul 31 '22 23:07 classner

@classner This is NDC coordinates, so (0,0) is the center of the image.

gkioxari avatar Aug 10 '22 09:08 gkioxari