50 lines
1.4 KiB
C++
50 lines
1.4 KiB
C++
#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;
|
|
};
|