Some mixed cleanups.

This commit is contained in:
Daniel
2025-02-28 14:01:12 +01:00
parent 1d259846fc
commit 2e1d401dd4
8 changed files with 23 additions and 67 deletions

View File

@ -1,8 +1,10 @@
#include <algorithm>
#include <chrono>
#include <cmath>
#include <iomanip>
#include <map>
#include <numeric>
#include <omp.h>
#include <opencv2/opencv.hpp>
#include <unordered_map>
#include "camera.hpp"
#include "triangulator.hpp"
@ -10,45 +12,6 @@
// =================================================================================================
// =================================================================================================
[[maybe_unused]] static void print_2d_mat(const cv::Mat &mat)
{
// Ensure the matrix is 2D
if (mat.dims != 2)
{
std::cerr << "Error: The matrix is not 2D." << std::endl;
return;
}
// Retrieve matrix dimensions
int rows = mat.rows;
int cols = mat.cols;
// Print the matrix in a NumPy-like style
std::cout << "cv::Mat('shape': (" << rows << ", " << cols << ")";
std::cout << ", 'data': [" << std::endl;
for (int i = 0; i < rows; ++i)
{
std::cout << " [";
for (int j = 0; j < cols; ++j)
{
std::cout << std::fixed << std::setprecision(3) << mat.at<float>(i, j);
if (j < cols - 1)
{
std::cout << ", ";
}
}
std::cout << "]";
if (i < rows - 1)
{
std::cout << "," << std::endl;
}
}
std::cout << "])" << std::endl;
}
// =================================================================================================
[[maybe_unused]] static void print_2d_poses(const std::vector<std::array<float, 3>> &poses)
{
std::cout << "Poses: (" << poses.size() << ", 3)[" << std::endl;

View File

@ -1,12 +1,9 @@
#pragma once
#include <array>
#include <iostream>
#include <string>
#include <vector>
#include <opencv2/opencv.hpp>
#include "camera.hpp"
// =================================================================================================