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

what is the length unit of focal length? #57

Open
GLY-123 opened this issue Oct 26, 2024 · 4 comments
Open

what is the length unit of focal length? #57

GLY-123 opened this issue Oct 26, 2024 · 4 comments

Comments

@GLY-123
Copy link

GLY-123 commented Oct 26, 2024

No description provided.

@hbardak
Copy link

hbardak commented Oct 27, 2024

In the real world millimeter (mm ) but you need to know the aperture size to get an angle of view.

In the ML dev world is in pixels apparently :)

@GLY-123
Copy link
Author

GLY-123 commented Oct 30, 2024

In the real world millimeter (mm ) but you need to know the aperture size to get an angle of view.

In the ML dev world is in pixels apparently :)

For example,what does the prediction["focallength_px"]=1402.6646 mean? does it mean focal_lentgh=1402.6646(mm)? or othrewise.

@hbardak
Copy link

hbardak commented Nov 4, 2024

def fpx_from_f35(width: float, height: float, f_mm: float = 50) -> float:
Convert a focal length given in mm (35mm film equivalent) to pixels.
return f_mm * np.sqrt(width**2.0 + height**2.0) / np.sqrt(36**2 + 24**2)

@NicolaCovallero
Copy link

As said, the focal length is given in pixel units. The physical quantity, measured in meter scale, is dependent on the physical size of the pixel, that in many applications is unknown but often unnecessary. if you known which sensor is used to capture your image you can convert the focal length to meter scale given the pixel size.

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

3 participants