MCPcopy Create free account
hub / github.com/NVlabs/InstantSplat / write_points3D_binary

Function write_points3D_binary

scene/colmap_loader.py:445–461  ·  view source on GitHub ↗

see: src/colmap/scene/reconstruction.cc void Reconstruction::ReadPoints3DBinary(const std::string& path) void Reconstruction::WritePoints3DBinary(const std::string& path)

(points3D, path_to_model_file)

Source from the content-addressed store, hash-verified

443
444
445def write_points3D_binary(points3D, path_to_model_file):
446 """
447 see: src/colmap/scene/reconstruction.cc
448 void Reconstruction::ReadPoints3DBinary(const std::string& path)
449 void Reconstruction::WritePoints3DBinary(const std::string& path)
450 """
451 with open(path_to_model_file, "wb") as fid:
452 write_next_bytes(fid, len(points3D), "Q")
453 for _, pt in points3D.items():
454 write_next_bytes(fid, pt.id, "Q")
455 write_next_bytes(fid, pt.xyz.tolist(), "ddd")
456 write_next_bytes(fid, pt.rgb.tolist(), "BBB")
457 write_next_bytes(fid, pt.error, "d")
458 track_length = pt.image_ids.shape[0]
459 write_next_bytes(fid, track_length, "Q")
460 for image_id, point2D_id in zip(pt.image_ids, pt.point2D_idxs):
461 write_next_bytes(fid, [image_id, point2D_id], "ii")

Callers

nothing calls this directly

Calls 1

write_next_bytesFunction · 0.85

Tested by

no test coverage detected