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

Could you explain why you compute the initial rotation vector like this? #15

Open
jimlinntu opened this issue Jun 4, 2020 · 1 comment

Comments

@jimlinntu
Copy link
Contributor

jimlinntu commented Jun 4, 2020

Hi, I found that you've tried to use the vertical vanishing point to give a good guess of the initial rotation vector.
Although you eventually commented out the theta_0 computed from the vanishing point, I am curious about why you computed the rotation vector like that.
(If possible, could you explain by an illustration?)

rebook/rebook/dewarp.py

Lines 1101 to 1104 in 4bc3920

xz_ratio = -f / vx # theta_x / theta_z
norm_theta_sq = (atan2(np.sqrt(vx ** 2 + f ** 2), vy) - pi) ** 2
theta_z = np.sqrt(norm_theta_sq / (xz_ratio ** 2 + 1))
theta_x = xz_ratio * theta_z

@phulin
Copy link
Owner

phulin commented Jun 15, 2020

I wrote this code a long time ago, so I'm probably not in a much better position to draw this diagram than you are. I imagine I just found the vertical vanishing point on the projected plane and computed what the rotation angle must be.

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