| 65 | } |
| 66 | |
| 67 | nlohmann::json serializeCamera(const spectacularAI::Camera &camera) { |
| 68 | float near = 0.01f, far = 100.0f; |
| 69 | const Matrix3d &intrinsics = camera.getIntrinsicMatrix(); |
| 70 | const Matrix4d &projectionMatrixOpenGL = camera.getProjectionMatrixOpenGL(near, far); |
| 71 | |
| 72 | nlohmann::json json; |
| 73 | json["intrinsics"] = intrinsics; |
| 74 | json["projectionMatrixOpenGL"] = projectionMatrixOpenGL; |
| 75 | return json; |
| 76 | } |
| 77 | |
| 78 | void serializePointCloud(const std::string &filename, std::shared_ptr<spectacularAI::mapping::PointCloud> pointCloud) { |
| 79 | std::ofstream outputStream(filename.c_str(), std::ios::out | std::ios::binary | std::ios::trunc); |
no test coverage detected