MCPcopy Create free account
hub / github.com/KIMGEONUNG/VideoFrom3D / write_points3D_binary

Function write_points3D_binary

colmap.py:444–460  ·  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

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

Callers 1

write_modelFunction · 0.70

Calls 1

write_next_bytesFunction · 0.70

Tested by

no test coverage detected