Skip to content

Commit

Permalink
keep traj under cv coordinate
Browse files Browse the repository at this point in the history
  • Loading branch information
Jianxff committed May 2, 2024
1 parent 4f1bd9c commit c816af8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
3 changes: 1 addition & 2 deletions modules/droid.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class Options:
intrinsic: np.ndarray = None
focal: float = None
trajectory_path: Path = None
convert_pose_gl: bool = False
poses_dir: Path = None
distort: np.ndarray = None
global_ba_frontend: int = 0
Expand Down Expand Up @@ -144,6 +143,6 @@ def extract_rgb_stream(stream: RGBDStream):
# save pose44 matrix under opencv/opengl coordinate, ordered by frame
if setting.poses_dir is not None:
from .utils import trajectory_to_poses
trajectory_to_poses(traj_est, setting.poses_dir, convert_opengl=setting.convert_pose_gl)
trajectory_to_poses(traj_est, setting.poses_dir)

print('finished')
3 changes: 0 additions & 3 deletions modules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ def quaternion_to_matrix(q: np.ndarray) -> np.ndarray:
def trajectory_to_poses(
traj: Union[str, Path, np.ndarray],
out_dir: Union[str, Path],
convert_opengl: bool = False
) -> None:
if isinstance(traj, (str, Path)):
traj = np.loadtxt(traj)
Expand All @@ -142,8 +141,6 @@ def trajectory_to_poses(
# Twc = [R | t]
T[:3, :3] = R
T[:3, 3] = t
if convert_opengl:
T = np.array([[1, 0, 0, 0], [0, -1, 0, 0], [0, 0, -1, 0], [0, 0, 0, 1]]) @ T
# write to poses
np.savetxt(out_dir / f'{i:06d}.txt', T)

Expand Down

0 comments on commit c816af8

Please sign in to comment.