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)
| 443 | |
| 444 | |
| 445 | def 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") |
nothing calls this directly
no test coverage detected