Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yocabon committed Mar 11, 2024
1 parent 6934e6b commit 05801c2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions kapture_localization/colmap/pycolmap_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ def absolute_pose_estimation(points2D, points3D, camera_dict, max_error, min_inl
ret = {'success': False}
else:
ret['success'] = True
try:
retmat = ret['cam_from_world'].matrix
except Exception as e:
if callable(ret['cam_from_world'].matrix):
retmat = ret['cam_from_world'].matrix()
else:
retmat = ret['cam_from_world'].matrix
ret['qvec'] = quaternion.from_rotation_matrix(retmat[:3, :3])
ret['tvec'] = retmat[:3, 3]
return ret
Expand Down Expand Up @@ -74,10 +74,10 @@ def rig_absolute_pose_estimation(points2D, points3D, cameras_dict, qvec, tvec, m
ret = {'success': False}
else:
ret['success'] = True
try:
retmat = ret['cam_from_world'].matrix
except Exception as e:
if callable(ret['cam_from_world'].matrix):
retmat = ret['cam_from_world'].matrix()
else:
retmat = ret['cam_from_world'].matrix
ret['qvec'] = quaternion.from_rotation_matrix(retmat[:3, :3])
ret['tvec'] = retmat[:3, 3]
return ret
Expand All @@ -101,10 +101,10 @@ def pose_refinement(tvec, qvec, points2D, points3D, inlier_mask, camera_dict):
ret = {'success': False}
else:
ret['success'] = True
try:
retmat = ret['cam_from_world'].matrix
except Exception as e:
if callable(ret['cam_from_world'].matrix):
retmat = ret['cam_from_world'].matrix()
else:
retmat = ret['cam_from_world'].matrix
ret['qvec'] = quaternion.from_rotation_matrix(retmat[:3, :3])
ret['tvec'] = retmat[:3, 3]
return ret

0 comments on commit 05801c2

Please sign in to comment.