see: src/colmap/scene/reconstruction.cc void Reconstruction::WriteCamerasBinary(const std::string& path) void Reconstruction::ReadCamerasBinary(const std::string& path)
(cameras, path_to_model_file)
| 334 | |
| 335 | |
| 336 | def write_cameras_binary(cameras, path_to_model_file): |
| 337 | """ |
| 338 | see: src/colmap/scene/reconstruction.cc |
| 339 | void Reconstruction::WriteCamerasBinary(const std::string& path) |
| 340 | void Reconstruction::ReadCamerasBinary(const std::string& path) |
| 341 | """ |
| 342 | with open(path_to_model_file, "wb") as fid: |
| 343 | write_next_bytes(fid, len(cameras), "Q") |
| 344 | for _, cam in cameras.items(): |
| 345 | model_id = CAMERA_MODEL_NAMES[cam.model].model_id |
| 346 | camera_properties = [cam.id, model_id, cam.width, cam.height] |
| 347 | write_next_bytes(fid, camera_properties, "iiQQ") |
| 348 | for p in cam.params: |
| 349 | write_next_bytes(fid, float(p), "d") |
| 350 | return cameras |
| 351 | |
| 352 | |
| 353 | def write_images_text(images, path): |
no test coverage detected