see: src/base/reconstruction.cc void Reconstruction::ReadPoints3DBinary(const std::string& path) void Reconstruction::WritePoints3DBinary(const std::string& path)
(points3D, path_to_model_file)
| 391 | |
| 392 | |
| 393 | def write_points3D_binary(points3D, path_to_model_file): |
| 394 | """ |
| 395 | see: src/base/reconstruction.cc |
| 396 | void Reconstruction::ReadPoints3DBinary(const std::string& path) |
| 397 | void Reconstruction::WritePoints3DBinary(const std::string& path) |
| 398 | """ |
| 399 | with open(path_to_model_file, "wb") as fid: |
| 400 | write_next_bytes(fid, len(points3D), "Q") |
| 401 | for _, pt in points3D.items(): |
| 402 | write_next_bytes(fid, pt.id, "Q") |
| 403 | write_next_bytes(fid, pt.xyz.tolist(), "ddd") |
| 404 | write_next_bytes(fid, pt.rgb.tolist(), "BBB") |
| 405 | write_next_bytes(fid, pt.error, "d") |
| 406 | track_length = pt.image_ids.shape[0] |
| 407 | write_next_bytes(fid, track_length, "Q") |
| 408 | for image_id, point2D_id in zip(pt.image_ids, pt.point2D_idxs): |
| 409 | write_next_bytes(fid, [image_id, point2D_id], "ii") |
| 410 | |
| 411 | |
| 412 | def detect_model_format(path, ext): |
no test coverage detected