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