| 235 | std::cout << "====================================" << std::endl; |
| 236 | } |
| 237 | void SceneData::Save(bool extended_save) |
| 238 | { |
| 239 | ScopedTimerPrintLine tim("SceneData::Save"); |
| 240 | SAIGA_ASSERT(!frames.empty()); |
| 241 | |
| 242 | std::filesystem::create_directories(file_dataset_base); |
| 243 | |
| 244 | |
| 245 | { |
| 246 | std::ofstream strm2(file_exposure, std::ios_base::out); |
| 247 | for (auto f : frames) |
| 248 | { |
| 249 | strm2 << std::scientific << std::setprecision(15); |
| 250 | strm2 << f.exposure_value << "\n"; |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | { |
| 255 | std::ofstream ostream1(file_white_balance, std::ios_base::out); |
| 256 | for (auto& fd : frames) |
| 257 | { |
| 258 | vec3 V = fd.white_balance; |
| 259 | ostream1 << V(0) << " " << V(1) << " " << V(2) << "\n"; |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | { |
| 264 | std::vector<Sophus::SE3d> posesd; |
| 265 | |
| 266 | std::ofstream strm2(file_pose, std::ios_base::out); |
| 267 | for (auto f : frames) |
| 268 | { |
| 269 | SE3 p = f.pose; |
| 270 | |
| 271 | Quat q = p.unit_quaternion(); |
| 272 | Vec3 t = p.translation(); |
| 273 | strm2 << std::scientific << std::setprecision(15); |
| 274 | strm2 << q.x() << " " << q.y() << " " << q.z() << " " << q.w() << " " << t.x() << " " << t.y() << " " |
| 275 | << t.z() << "\n"; |
| 276 | |
| 277 | posesd.push_back(p); |
| 278 | } |
| 279 | |
| 280 | if (extended_save) |
| 281 | { |
| 282 | std::ofstream ostream1(scene_path + "/poses_view_matrix.txt"); |
| 283 | for (auto m : posesd) |
| 284 | { |
| 285 | auto V = m.inverse().matrix(); |
| 286 | ostream1 << V << "\n"; |
| 287 | } |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | if (extended_save) |
| 292 | { |
| 293 | std::ofstream ostream2(scene_path + "/K_matrix.txt"); |
| 294 | for (auto m : scene_cameras) |
no outgoing calls
no test coverage detected