| 52 | |
| 53 | template <typename Derived> |
| 54 | void WriteMatrix(const Eigen::MatrixBase<Derived>& matrix, |
| 55 | std::ofstream* file) { |
| 56 | using index_t = typename Eigen::MatrixBase<Derived>::Index; |
| 57 | for (index_t r = 0; r < matrix.rows(); ++r) { |
| 58 | for (index_t c = 0; c < matrix.cols() - 1; ++c) { |
| 59 | *file << matrix(r, c) << " "; |
| 60 | } |
| 61 | *file << matrix(r, matrix.cols() - 1) << '\n'; |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | // Write projection matrix P = K * [R t] to file and prepend given header. |
| 66 | void WriteProjectionMatrix(const std::filesystem::path& path, |
no outgoing calls
no test coverage detected