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, fov? #12

Open
tweezlednutball opened this issue Dec 18, 2024 · 4 comments
Open

focal_length, fov? #12

tweezlednutball opened this issue Dec 18, 2024 · 4 comments

Comments

@tweezlednutball
Copy link

preprocessing_utils.py
line 233
FOCAL_LENGTH = 50*128

Hello. I am trying to figure out where trace is getting the camera fov?

The closest I can find is numpy camera intrinsics but I also see this variable to Focal Length. Isn't focal length arbitrary since it relies on a formula between 2 known values? yet the only known factors in this regard is resolution and FOCAL_LENGTH = 50*128

6400?

Can someone help explain where to enter a custom fov or focal length if the number is already known and don't need trace to calculate that value. thank you!

@jzr99
Copy link
Collaborator

jzr99 commented Dec 18, 2024

Hi, if you've already known the camera intrinsics, you can modify and set it here

@tweezlednutball
Copy link
Author

Hi, if you've already known the camera intrinsics, you can modify and set it here

yes I understand. but what I am saying is focal length here doesn't make any sense. I know the value cant be focal length but something else. Since the focal length relies on the image back plate value which doesn't exist.

I think focal_length is miss named and is probably fov, but I am not sure. or if it is focal length, is it just based on the value from the source images resolution as 1 pixel μm?

for example if the plate was 1920x1080. and the focal length was 50mm would the focal length actually be 2.2 (horizontal field of view) or possibly 2.52 (diagonal fov)?

also, what is this?
preprocessing_utils.py
line 233
FOCAL_LENGTH = 50*128

@jzr99
Copy link
Collaborator

jzr99 commented Dec 18, 2024

The definition of the focal length from Opencv pinhole camera model and the physical focal length is different. According to the book Learning OpenCV (p373)

The focal length fx (for example) is actually the product of the physical focal length of the lens and the size sx of the individual imager elements.

The variable FOCAL_LENGTH in preprocessing_utils.py is a default focal length value which is never used.

@tweezlednutball
Copy link
Author

thank you. I will use the formula

focal_length*image_x/sensor_x

and y respectively. I will report back with results.

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

2 participants