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?)
|
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 |