Simplify triangulation core and remove integrations

This commit is contained in:
2026-03-11 23:55:04 +08:00
parent 103aeb5887
commit 7df34b18c3
20 changed files with 222 additions and 1969 deletions
+24 -9
View File
@@ -167,6 +167,11 @@ NB_MODULE(_core, m)
return camera.to_string();
});
nb::class_<TriangulationOptions>(m, "TriangulationOptions")
.def(nb::init<>())
.def_rw("min_match_score", &TriangulationOptions::min_match_score)
.def_rw("min_group_size", &TriangulationOptions::min_group_size);
nb::class_<PairCandidate>(m, "PairCandidate")
.def(nb::init<>())
.def_rw("view1", &PairCandidate::view1)
@@ -268,12 +273,14 @@ NB_MODULE(_core, m)
const PoseArray3DConst &previous_poses_3d,
float min_match_score)
{
TriangulationOptions options;
options.min_match_score = min_match_score;
return filter_pairs_with_previous_poses(
pose_batch_view_from_numpy(poses_2d, person_counts),
cameras,
joint_names,
pose_batch3d_view_from_numpy(previous_poses_3d),
min_match_score);
options);
},
"poses_2d"_a,
"person_counts"_a,
@@ -292,14 +299,16 @@ NB_MODULE(_core, m)
float min_match_score,
size_t min_group_size)
{
TriangulationOptions options;
options.min_match_score = min_match_score;
options.min_group_size = min_group_size;
return triangulate_debug(
pose_batch_view_from_numpy(poses_2d, person_counts),
cameras,
roomparams_from_numpy(roomparams),
joint_names,
nullptr,
min_match_score,
min_group_size);
options);
},
"poses_2d"_a,
"person_counts"_a,
@@ -321,14 +330,16 @@ NB_MODULE(_core, m)
size_t min_group_size)
{
const PoseBatch3DView previous_view = pose_batch3d_view_from_numpy(previous_poses_3d);
TriangulationOptions options;
options.min_match_score = min_match_score;
options.min_group_size = min_group_size;
return triangulate_debug(
pose_batch_view_from_numpy(poses_2d, person_counts),
cameras,
roomparams_from_numpy(roomparams),
joint_names,
&previous_view,
min_match_score,
min_group_size);
options);
},
"poses_2d"_a,
"person_counts"_a,
@@ -349,14 +360,16 @@ NB_MODULE(_core, m)
float min_match_score,
size_t min_group_size)
{
TriangulationOptions options;
options.min_match_score = min_match_score;
options.min_group_size = min_group_size;
const PoseBatch3D poses_3d = triangulate_poses(
pose_batch_view_from_numpy(poses_2d, person_counts),
cameras,
roomparams_from_numpy(roomparams),
joint_names,
nullptr,
min_match_score,
min_group_size);
options);
return pose_batch_to_numpy(poses_3d);
},
"poses_2d"_a,
@@ -379,14 +392,16 @@ NB_MODULE(_core, m)
size_t min_group_size)
{
const PoseBatch3DView previous_view = pose_batch3d_view_from_numpy(previous_poses_3d);
TriangulationOptions options;
options.min_match_score = min_match_score;
options.min_group_size = min_group_size;
const PoseBatch3D poses_3d = triangulate_poses(
pose_batch_view_from_numpy(poses_2d, person_counts),
cameras,
roomparams_from_numpy(roomparams),
joint_names,
&previous_view,
min_match_score,
min_group_size);
options);
return pose_batch_to_numpy(poses_3d);
},
"poses_2d"_a,