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

Is it a written mistake in Line 45 in bundle.py? #4

Open
zhchyang2004 opened this issue Jan 21, 2019 · 1 comment
Open

Is it a written mistake in Line 45 in bundle.py? #4

zhchyang2004 opened this issue Jan 21, 2019 · 1 comment

Comments

@zhchyang2004
Copy link

Hi, whether the correct formular should be 'f = width/2 / tan(radians(fovh)/2)' instead of the current one on Line 45?

@zbynekwinkler
Copy link
Member

Just to have a reference, we are talking about this code:

simple-sfm/bundle.py

Lines 42 to 50 in 6f3a462

def cam2mat(camera):
# http://docs.opencv.org/trunk/d9/d0c/group__calib3d.html#details
fovh, width, height = camera
f = width/2 * tan(radians(fovh)/2)
cx, cy = width/2, height/2
return np.array(
((f, 0, cx),
(0, f, cy),
(0, 0, 1)))

where f is the calculated focal distance in pixels using horizontal field of view and pixel width and height.

The focal length should be increasing with the FOV decreasing. You are right, thanks 👍. Too bad I never got to finish this.

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