Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Focal length, Pixel Size of Perspective Camera #102

Open
varun19299 opened this issue Jan 28, 2021 · 6 comments
Open

Focal length, Pixel Size of Perspective Camera #102

varun19299 opened this issue Jan 28, 2021 · 6 comments

Comments

@varun19299
Copy link

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?

@varun19299
Copy link
Author

Maybe I can just use the FOV as indicated here?

mmp/pbrt-v3#255

@varun19299
Copy link
Author

I'm also assuming square pixels are used, is this correct?

@mmp
Copy link
Owner

mmp commented Feb 9, 2021

Pixels are indeed square. It uses a standard perspective projection with the specified FOV.

@varun19299
Copy link
Author

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 LookAt etc

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)

image

(I'm still determining if the error lies on the reconstruction side or the intrinsics).

@pbrt4bounty
Copy link
Contributor

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

camera_fov

@qihang1019
Copy link

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.

huongoss pushed a commit to huongoss/pbrt-v4-docker that referenced this issue Aug 30, 2024
Allow tev to be remote-controlled over the network
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants