Skip to content

Commit

Permalink
fix: name shots follow lexicographical order
Browse files Browse the repository at this point in the history
  • Loading branch information
paulinus committed Jun 5, 2020
1 parent 3fac9a0 commit b98d53e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion opensfm/synthetic_data/synthetic_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def add_shots_to_reconstruction(positions, rotations,
shift = len(reconstruction.shots)
for i, item in enumerate(zip(positions, rotations)):
shot = types.Shot()
shot.id = 'shot' + str(shift+i)
shot.id = 'shot%04d' % (shift + i)
shot.camera = camera
shot.pose = types.Pose()
shot.pose.set_rotation_matrix(item[1])
Expand Down
6 changes: 3 additions & 3 deletions opensfm/synthetic_data/synthetic_scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __init__(self, num_cameras, num_points, noise):
self.cameras = {}
for i in range(num_cameras):
camera = camera = pygeometry.Camera.create_perspective(0.9, -0.1, 0.01)
camera.id = 'camera' + str(i)
camera.id = 'camera%04d' + i
camera.height = 600
camera.width = 800
self.cameras[camera.id] = camera
Expand All @@ -106,8 +106,8 @@ def __init__(self, num_cameras, num_points, noise):
up = [alpha * 0.2, alpha * 0.2, 1.0]

shot = types.Shot()
shot.id = 'shot' + str(i)
shot.camera = self.cameras['camera' + str(i)]
shot.id = 'shot%04d' % i
shot.camera = self.cameras['camera%04d' % i]
shot.pose = camera_pose(position, lookat, up)
self.shots[shot.id] = shot

Expand Down

0 comments on commit b98d53e

Please sign in to comment.