pbrt-v4
pbrt-v4 copied to clipboard
Focal length, Pixel Size of Perspective Camera
I'm trying to calculate the intrinsic matrix used by the Perspective cameras. I need to determine:
- focal length
- Pixel Size (in metres).
I think the latter can be computed using the diagonal size and resolution under Film. But I haven't been able to find the default focal length used.
Finally, is it assumed that the camera centre lies directly above the image centre?
Maybe I can just use the FOV as indicated here?
https://github.com/mmp/pbrt-v3/issues/255
I'm also assuming square pixels are used, is this correct?
Pixels are indeed square. It uses a standard perspective projection with the specified FOV.
Thanks for the reply!
I derived the intrinsic and extrinsic matrices using the scene file, assuming:
- default film diagonal is 35 mm
- FOV is used to determine focal length. FOV = 2 * arctan(shorter_side/2f).
- Here, FOV is the minimum FOV of the two sides.
- Extrinsics got from
LookAtetc
I tested this on a structured light simulation (of a sphere of radius 1m).
Unfortunately, the reconstruction is skewed in the axis: (ellipsoid instead of a sphere)
(I'm still determining if the error lies on the reconstruction side or the intrinsics).
Hi.. I have some issues in Blender, but not at this level. I use this formule, that is not perfect, of course
aspect = 1.0 if (sizeX > sizeY) else (sizeX / sizeY)
fov = focal_lenght / aspect

I have a similar problem to yours.I need to use PBRT to simulate an image taken by a real camera. I already know the intrinsic matrix of the real camera and how to set the intrinsic matrix parameters of the camera in PBRT.