def find_camera_poses(self, verbose=False):
ix_cam = 0
for video in self.videos:
camera = self.cameras[ix_cam]
if verbose:
print("Finding camera poses for video {:s} ... (this may take awhile)".format(video.name))
video.poses = []
rotations, translations = calibrate_intrinsics(camera, video.image_points,
self.board_object_corner_set,
self.args.use_rational_model,
self.args.use_tangential_coeffs,
self.args.use_thin_prism,
fix_radial=True,
fix_thin_prism=True,
max_iterations=1,
use_existing_guess=True,
test=True)
if verbose:
print("Camera pose reprojection error for video {:s}: {:.4f}"
.format(video.name, camera.intrinsics.error))
for ix_pose in range(len(rotations)):
translation = translations[ix_pose]
rotation = rotations[ix_pose]
pose = Pose(rotation=rotation, translation_vector=translation)
video.poses.append(pose)
ix_cam += 1
评论列表
文章目录