Initial cpp reimplementation.

This commit is contained in:
Daniel
2024-09-11 11:40:00 +02:00
parent 7b426d209c
commit 244f46559c
14 changed files with 1904 additions and 1 deletions

49
spt/interface.hpp Normal file
View File

@ -0,0 +1,49 @@
#pragma once
#include <string>
#include <vector>
#include "camera.hpp"
// =================================================================================================
// Forward declaration of the class, that swig does try to parse all its dependencies.
class TriangulatorInternal;
// =================================================================================================
class Triangulator
{
public:
/**
* Triangulator to predict poses from multiple views.
*
*
* @param min_score Minimum score to consider a triangulated joint as valid.
*/
Triangulator(
double min_score = 0.95);
/**
* Calculate a triangulation.
*
*
* @param poses_2d List of shape [views, persons, joints, 3], containing the 2D poses.
* @param cameras List of cameras.
* @param roomparams Room parameters (room center, room size).
* @param joint_names List of 2D joint names.
*
* @return List of shape [persons, joints, 4], containing the 3D poses.
*/
std::vector<std::vector<std::array<double, 4>>> triangulate_poses(
const std::vector<std::vector<std::vector<std::array<double, 3>>>> &poses_2d,
const std::vector<Camera> &cameras,
const std::array<std::array<double, 3>, 2> &roomparams,
const std::vector<std::string> &joint_names);
/** Reset the triangulator. */
void reset();
private:
TriangulatorInternal *triangulator;
};