Simplify triangulation core and remove integrations
This commit is contained in:
+18
-15
@@ -144,6 +144,14 @@ struct TriangulationTrace
|
||||
|
||||
// =================================================================================================
|
||||
|
||||
struct TriangulationOptions
|
||||
{
|
||||
float min_match_score = 0.95f;
|
||||
size_t min_group_size = 1;
|
||||
};
|
||||
|
||||
// =================================================================================================
|
||||
|
||||
std::vector<PairCandidate> build_pair_candidates(const PoseBatch2DView &poses_2d);
|
||||
|
||||
PreviousPoseFilterDebug filter_pairs_with_previous_poses(
|
||||
@@ -151,17 +159,17 @@ PreviousPoseFilterDebug filter_pairs_with_previous_poses(
|
||||
const std::vector<Camera> &cameras,
|
||||
const std::vector<std::string> &joint_names,
|
||||
const PoseBatch3DView &previous_poses_3d,
|
||||
float min_match_score = 0.95f);
|
||||
const TriangulationOptions &options = {});
|
||||
|
||||
inline PreviousPoseFilterDebug filter_pairs_with_previous_poses(
|
||||
const PoseBatch2D &poses_2d,
|
||||
const std::vector<Camera> &cameras,
|
||||
const std::vector<std::string> &joint_names,
|
||||
const PoseBatch3D &previous_poses_3d,
|
||||
float min_match_score = 0.95f)
|
||||
const TriangulationOptions &options = {})
|
||||
{
|
||||
return filter_pairs_with_previous_poses(
|
||||
poses_2d.view(), cameras, joint_names, previous_poses_3d.view(), min_match_score);
|
||||
poses_2d.view(), cameras, joint_names, previous_poses_3d.view(), options);
|
||||
}
|
||||
|
||||
TriangulationTrace triangulate_debug(
|
||||
@@ -170,8 +178,7 @@ TriangulationTrace triangulate_debug(
|
||||
const std::array<std::array<float, 3>, 2> &roomparams,
|
||||
const std::vector<std::string> &joint_names,
|
||||
const PoseBatch3DView *previous_poses_3d = nullptr,
|
||||
float min_match_score = 0.95f,
|
||||
size_t min_group_size = 1);
|
||||
const TriangulationOptions &options = {});
|
||||
|
||||
inline TriangulationTrace triangulate_debug(
|
||||
const PoseBatch2D &poses_2d,
|
||||
@@ -179,8 +186,7 @@ inline TriangulationTrace triangulate_debug(
|
||||
const std::array<std::array<float, 3>, 2> &roomparams,
|
||||
const std::vector<std::string> &joint_names,
|
||||
const PoseBatch3D *previous_poses_3d = nullptr,
|
||||
float min_match_score = 0.95f,
|
||||
size_t min_group_size = 1)
|
||||
const TriangulationOptions &options = {})
|
||||
{
|
||||
PoseBatch3DView previous_view_storage;
|
||||
const PoseBatch3DView *previous_view = nullptr;
|
||||
@@ -190,7 +196,7 @@ inline TriangulationTrace triangulate_debug(
|
||||
previous_view = &previous_view_storage;
|
||||
}
|
||||
return triangulate_debug(
|
||||
poses_2d.view(), cameras, roomparams, joint_names, previous_view, min_match_score, min_group_size);
|
||||
poses_2d.view(), cameras, roomparams, joint_names, previous_view, options);
|
||||
}
|
||||
|
||||
// =================================================================================================
|
||||
@@ -202,8 +208,7 @@ inline TriangulationTrace triangulate_debug(
|
||||
* @param cameras List of cameras.
|
||||
* @param roomparams Room parameters (room size, room center).
|
||||
* @param joint_names List of 2D joint names.
|
||||
* @param min_match_score Minimum score to consider a triangulated joint as valid.
|
||||
* @param min_group_size Minimum number of camera pairs that need to see a person.
|
||||
* @param options Triangulation options.
|
||||
*
|
||||
* @return Pose tensor of shape [persons, joints, 4].
|
||||
*/
|
||||
@@ -213,8 +218,7 @@ PoseBatch3D triangulate_poses(
|
||||
const std::array<std::array<float, 3>, 2> &roomparams,
|
||||
const std::vector<std::string> &joint_names,
|
||||
const PoseBatch3DView *previous_poses_3d = nullptr,
|
||||
float min_match_score = 0.95f,
|
||||
size_t min_group_size = 1);
|
||||
const TriangulationOptions &options = {});
|
||||
|
||||
inline PoseBatch3D triangulate_poses(
|
||||
const PoseBatch2D &poses_2d,
|
||||
@@ -222,8 +226,7 @@ inline PoseBatch3D triangulate_poses(
|
||||
const std::array<std::array<float, 3>, 2> &roomparams,
|
||||
const std::vector<std::string> &joint_names,
|
||||
const PoseBatch3D *previous_poses_3d = nullptr,
|
||||
float min_match_score = 0.95f,
|
||||
size_t min_group_size = 1)
|
||||
const TriangulationOptions &options = {})
|
||||
{
|
||||
PoseBatch3DView previous_view_storage;
|
||||
const PoseBatch3DView *previous_view = nullptr;
|
||||
@@ -233,5 +236,5 @@ inline PoseBatch3D triangulate_poses(
|
||||
previous_view = &previous_view_storage;
|
||||
}
|
||||
return triangulate_poses(
|
||||
poses_2d.view(), cameras, roomparams, joint_names, previous_view, min_match_score, min_group_size);
|
||||
poses_2d.view(), cameras, roomparams, joint_names, previous_view, options);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user