Skip to content

Commit

Permalink
Small fix to VisualSfM export script
Browse files Browse the repository at this point in the history
  • Loading branch information
ahojnnes committed Nov 8, 2018
1 parent 6ba75ed commit 6351463
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scripts/python/export_to_visualsfm.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def main():
(image_id,))
row = next(cursor)
if row[0] is None:
keypoints = np.zeros((0, 4), dtype=np.float32)
keypoints = np.zeros((0, 6), dtype=np.float32)
descriptors = np.zeros((0, 128), dtype=np.uint8)
else:
keypoints = np.fromstring(row[0], dtype=np.float32).reshape(-1, 6)
Expand All @@ -109,8 +109,7 @@ def main():
with open(key_file_name, "w") as fid:
fid.write("%d %d\n" % (keypoints.shape[0], descriptors.shape[1]))
for r in range(keypoints.shape[0]):
fid.write("%f %f %f %f " % (keypoints[r, 0], keypoints[r, 1],
keypoints[r, 2], keypoints[r, 3]))
fid.write("%f %f 0 0 " % (keypoints[r, 0], keypoints[r, 1]))
fid.write(" ".join(map(str, descriptors[r].ravel().tolist())))
fid.write("\n")

Expand Down

0 comments on commit 6351463

Please sign in to comment.