MCPcopy Create free account
hub / github.com/ai4ce/RAP / write_points3D_binary

Function write_points3D_binary

utils/read_write_model.py:458–474  ·  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

456
457
458def write_points3D_binary(points3D, path_to_model_file):
459 """
460 see: src/colmap/scene/reconstruction.cc
461 void Reconstruction::ReadPoints3DBinary(const std::string& path)
462 void Reconstruction::WritePoints3DBinary(const std::string& path)
463 """
464 with open(path_to_model_file, "wb") as fid:
465 write_next_bytes(fid, len(points3D), "Q")
466 for _, pt in points3D.items():
467 write_next_bytes(fid, pt.id, "Q")
468 write_next_bytes(fid, pt.xyz.tolist(), "ddd")
469 write_next_bytes(fid, pt.rgb.tolist(), "BBB")
470 write_next_bytes(fid, pt.error, "d")
471 track_length = pt.image_ids.shape[0]
472 write_next_bytes(fid, track_length, "Q")
473 for image_id, point2D_id in zip(pt.image_ids, pt.point2D_idxs):
474 write_next_bytes(fid, [image_id, point2D_id], "ii")
475
476
477def detect_model_format(path, ext):

Callers 1

write_modelFunction · 0.85

Calls 1

write_next_bytesFunction · 0.85

Tested by

no test coverage detected