Skip to content

Commit ae36683

Browse files
committed
fix: name shots follow lexicographical order
1 parent 3fac9a0 commit ae36683

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

opensfm/synthetic_data/synthetic_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def add_shots_to_reconstruction(positions, rotations,
167167
shift = len(reconstruction.shots)
168168
for i, item in enumerate(zip(positions, rotations)):
169169
shot = types.Shot()
170-
shot.id = 'shot' + str(shift+i)
170+
shot.id = 'shot%04d' % (shift + i)
171171
shot.camera = camera
172172
shot.pose = types.Pose()
173173
shot.pose.set_rotation_matrix(item[1])

opensfm/synthetic_data/synthetic_scene.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def __init__(self, num_cameras, num_points, noise):
8686
self.cameras = {}
8787
for i in range(num_cameras):
8888
camera = camera = pygeometry.Camera.create_perspective(0.9, -0.1, 0.01)
89-
camera.id = 'camera' + str(i)
89+
camera.id = 'camera%04d' % i
9090
camera.height = 600
9191
camera.width = 800
9292
self.cameras[camera.id] = camera
@@ -106,8 +106,8 @@ def __init__(self, num_cameras, num_points, noise):
106106
up = [alpha * 0.2, alpha * 0.2, 1.0]
107107

108108
shot = types.Shot()
109-
shot.id = 'shot' + str(i)
110-
shot.camera = self.cameras['camera' + str(i)]
109+
shot.id = 'shot%04d' % i
110+
shot.camera = self.cameras['camera%04d' % i]
111111
shot.pose = camera_pose(position, lookat, up)
112112
self.shots[shot.id] = shot
113113

0 commit comments

Comments
 (0)