see: src/base/reconstruction.cc void Reconstruction::WriteCamerasBinary(const std::string& path) void Reconstruction::ReadCamerasBinary(const std::string& path)
(cameras, path_to_model_file)
| 171 | |
| 172 | |
| 173 | def write_cameras_binary(cameras, path_to_model_file): |
| 174 | """ |
| 175 | see: src/base/reconstruction.cc |
| 176 | void Reconstruction::WriteCamerasBinary(const std::string& path) |
| 177 | void Reconstruction::ReadCamerasBinary(const std::string& path) |
| 178 | """ |
| 179 | with open(path_to_model_file, "wb") as fid: |
| 180 | write_next_bytes(fid, len(cameras), "Q") |
| 181 | for _, cam in cameras.items(): |
| 182 | model_id = CAMERA_MODEL_NAMES[cam.model].model_id |
| 183 | camera_properties = [cam.id, |
| 184 | model_id, |
| 185 | cam.width, |
| 186 | cam.height] |
| 187 | write_next_bytes(fid, camera_properties, "iiQQ") |
| 188 | for p in cam.params: |
| 189 | write_next_bytes(fid, float(p), "d") |
| 190 | return cameras |
| 191 | |
| 192 | |
| 193 | def read_images_text(path): |
no test coverage detected